/* Diana Andre Ophthalmology Consulting - Custom CSS */

/* CSS Custom Properties (Design System) */
:root {
  /* Primary Colors (Medical Blue Theme) */
  --color-primary: #1e40af;
  --color-primary-light: #3b82f6;
  --color-primary-dark: #1e3a8a;
  --color-accent: #60a5fa;

  /* Secondary Colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  /* Neutral Colors */
  --color-white: #ffffff;
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* Medical Accent Colors */
  --color-gold: #fbbf24;
  --color-silver: #94a3b8;
  --color-teal: #06b6d4;

  /* Typography */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-family-secondary: 'Plus Jakarta Sans', 'Inter', sans-serif;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

/* Base Typography */
.font-inter {
  font-family: var(--font-family-primary);
}

.font-jakarta {
  font-family: var(--font-family-secondary);
}

/* Enhanced focus states for accessibility */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Enhanced hover effects for service cards */
.service-card {
  transition: all var(--transition-normal);
  border: 1px solid var(--color-gray-200);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary-light);
}

/* Hero section gradient enhancement */
.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
  pointer-events: none;
}

/* Results section styling */
.results-section {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  position: relative;
}

.results-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* ROI Calculator styling */
.roi-calculator-section {
  background: linear-gradient(to bottom, var(--color-white) 0%, var(--color-gray-50) 100%);
}

#roi-calculator-form {
  position: relative;
}

/* Range slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
  background: var(--color-gray-200);
  height: 8px;
  border-radius: var(--radius-lg);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-primary);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

input[type="range"]::-moz-range-track {
  background: var(--color-gray-200);
  height: 8px;
  border-radius: var(--radius-lg);
  border: none;
}

input[type="range"]::-moz-range-thumb {
  background: var(--color-primary);
  height: 20px;
  width: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

/* Button enhancements */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: all var(--transition-normal);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: all var(--transition-normal);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Navigation enhancements */
header {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

/* Mobile menu animation and iOS fixes */
#mobile-menu-button {
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: pointer;
}

#mobile-menu {
  transition: all var(--transition-normal);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

#mobile-menu.show,
#mobile-menu.block {
  display: block !important;
  animation: slideDown var(--transition-normal) ease-out;
}

#mobile-menu.hidden {
  animation: slideUp var(--transition-normal) ease-out forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  #mobile-menu-button:active {
    background-color: rgba(59, 130, 246, 0.1);
  }
}

/* Mobile touch targets */
@media (max-width: 768px) {
  button, a {
    min-height: 44px;
  }
  
  #mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 50px;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
    tap-highlight-color: rgba(59, 130, 246, 0.1);
  }
  
  #mobile-menu-button {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Testimonial styling */
.testimonial-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-normal);
}

.testimonial-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Metric cards animation */
.metric-card {
  transition: all var(--transition-normal);
}

.metric-card:hover {
  transform: scale(1.05);
}

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #000080;
    --color-gray-600: #000000;
    --color-gray-400: #666666;
  }
}

/* Print styles */
@media print {
  .hero-section,
  .results-section,
  header,
  footer,
  #roi-calculator {
    display: none !important;
  }
  
  body {
    color: #000000 !important;
    background: #ffffff !important;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* Responsive utilities */
@media (max-width: 640px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .hero-section h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .service-card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  .grid-responsive {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Form styling */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 0.5rem;
}

/* Success states */
.success-message {
  background: var(--color-success);
  color: var(--color-white);
  padding: 1rem;
  border-radius: var(--radius-lg);
  margin: 1rem 0;
}

.error-message {
  background: var(--color-error);
  color: var(--color-white);
  padding: 1rem;
  border-radius: var(--radius-lg);
  margin: 1rem 0;
}

/* Animation utilities */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.slide-up {
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 0.6s ease-out forwards;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Utility classes */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bg-pattern {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.15) 1px, transparent 0);
  background-size: 20px 20px;
}

.backdrop-blur {
  backdrop-filter: blur(10px);
}

/* Medical theme enhancements */
.medical-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.medical-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--color-success);
}

.credential-badge {
  display: inline-flex;
  align-items: center;
  background: var(--color-gold);
  color: var(--color-gray-900);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-xl);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.25rem;
}

.roi-highlight {
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}