/* Enhanced CSS for DevUnion with accessibility and performance optimizations */

/* Notification System */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.notification {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  max-width: 400px;
  pointer-events: all;
  display: flex;
  align-items: center;
  padding: 16px;
  border-left: 4px solid;
  animation: slideInRight 0.3s ease-out;
  transition: all 0.3s ease;
}

.notification:hover {
  transform: translateX(-5px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.notification-success {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.notification-error {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.notification-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.notification-info {
  border-left-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.notification-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.notification-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  flex-shrink: 0;
}

.notification-icon svg {
  width: 100%;
  height: 100%;
}

.notification-success .notification-icon {
  color: #10b981;
}

.notification-error .notification-icon {
  color: #ef4444;
}

.notification-warning .notification-icon {
  color: #f59e0b;
}

.notification-info .notification-icon {
  color: #3b82f6;
}

.notification-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

.notification-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  margin-left: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #e5e7eb;
  border-radius: 0 0 4px 4px;
  overflow: hidden;
}

.notification-progress-bar {
  height: 100%;
  background: currentColor;
  width: 100%;
  animation: progress 5s linear forwards;
}

.notification-success .notification-progress-bar {
  color: #10b981;
}

.notification-error .notification-progress-bar {
  color: #ef4444;
}

.notification-warning .notification-progress-bar {
  color: #f59e0b;
}

.notification-info .notification-progress-bar {
  color: #3b82f6;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #6b7280;
  transition: all 0.2s ease;
  z-index: 1;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #374151;
  transform: scale(1.1);
}

.modal-body {
  padding: 32px;
}

.lead-modal-header {
  text-align: center;
  margin-bottom: 32px;
}

.lead-modal-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 24px;
  font-weight: 600;
}

/* Enhanced Form Styles */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group label {
  position: absolute;
  top: 16px;
  left: 16px;
  color: #9ca3af;
  font-size: 16px;
  pointer-events: none;
  transition: all 0.3s ease;
  background: white;
  padding: 0 4px;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  top: -8px;
  left: 12px;
  font-size: 12px;
  color: #3b82f6;
}

.form-group.error input,
.form-group.error textarea {
  border-color: #ef4444;
}

.form-group.error label {
  color: #ef4444;
}

.field-error {
  color: #ef4444;
  font-size: 14px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-error::before {
  content: "⚠";
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9998;
}

.loading-small {
  font-size: 14px;
}

.loading-medium {
  font-size: 16px;
}

.loading-large {
  font-size: 18px;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-small .loading-spinner {
  width: 16px;
  height: 16px;
}

.loading-large .loading-spinner {
  width: 24px;
  height: 24px;
}

.loading-text {
  color: #6b7280;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Accessibility Improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for better keyboard navigation */
*:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

button:focus,
input:focus,
textarea:focus,
select:focus,
a:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #1f2937;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10000;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .notification {
    border: 2px solid;
  }
  
  .modal-content {
    border: 2px solid #000;
  }
  
  button:focus,
  input:focus,
  textarea:focus,
  select:focus,
  a:focus {
    outline: 3px solid #000;
    outline-offset: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .notification {
    background: #1f2937;
    color: #f9fafb;
  }
  
  .notification-message {
    color: #f9fafb;
  }
  
  .modal-content {
    background: #1f2937;
    color: #f9fafb;
  }
  
  .form-group input,
  .form-group textarea {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .form-group label {
    background: #1f2937;
  }
  
  .modal-close {
    background: #374151;
    color: #9ca3af;
  }
  
  .modal-close:hover {
    background: #4b5563;
    color: #f9fafb;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .notification {
    max-width: none;
  }
  
  .modal-content {
    width: 95%;
    margin: 10px;
  }
  
  .modal-body {
    padding: 24px 20px;
  }
  
  .lead-modal-header h3 {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .modal-body {
    padding: 20px 16px;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Print styles */
@media print {
  .notification-container,
  .modal-overlay,
  .loading-overlay {
    display: none !important;
  }
}

/* Performance optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Enhanced button styles */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

/* Enhanced pricing buttons */
.pricing-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.pricing-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.pricing-btn:active {
  transform: translateY(0);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better image handling */
img {
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
}

/* Enhanced form validation styles */
.form-group.success input,
.form-group.success textarea {
  border-color: #10b981;
}

.form-group.success label {
  color: #10b981;
}

.form-group.loading input,
.form-group.loading textarea {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10" stroke-dasharray="31.416" stroke-dashoffset="31.416"><animate attributeName="stroke-dashoffset" dur="1s" from="31.416" to="0" repeatCount="indefinite"/></circle></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

/* Enhanced accessibility for screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Enhanced color contrast for text */
.text-high-contrast {
  color: #000000;
}

@media (prefers-color-scheme: dark) {
  .text-high-contrast {
    color: #ffffff;
  }
}
