@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;500;600;700;800;900&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* Modern color palette */
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 262.1 83.3% 57.8%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 36.9%; /* Darker for better contrast */
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 262.1 83.3% 57.8%;
    --radius: 0.75rem;
    
    /* Custom gradient colors */
    --gradient-start: #8B5CF6;
    --gradient-mid: #7C3AED;
    --gradient-end: #6D28D9;
    --accent-gradient-start: #EC4899;
    --accent-gradient-end: #F43F5E;
    
    /* Glass effect variables */
    --glass-bg: rgba(31, 41, 55, 0.85); /* Dark background for better contrast */
    --glass-border: rgba(107, 114, 128, 0.3); /* Gray border */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3); /* Stronger shadow */
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 262.1 83.3% 57.8%;
    --primary-foreground: 210 40% 98%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 262.1 83.3% 57.8%;
    
    /* Dark mode glass effect */
    --glass-bg: rgba(17, 25, 40, 0.75);
    --glass-border: rgba(255, 255, 255, 0.125);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  }
}

@layer utilities {
  /* Flexbox gap fallback for older browsers */
  @supports not (gap: 1rem) {
    .gap-1 > * + * { margin-left: 0.25rem; }
    .gap-2 > * + * { margin-left: 0.5rem; }
    .gap-3 > * + * { margin-left: 0.75rem; }
    .gap-4 > * + * { margin-left: 1rem; }
    .gap-5 > * + * { margin-left: 1.25rem; }
    .gap-6 > * + * { margin-left: 1.5rem; }
    .gap-8 > * + * { margin-left: 2rem; }
  }
  
  /* Responsive text utilities */
  .text-responsive {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.6;
  }
  
  .heading-responsive {
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    line-height: 1.2;
  }
  
  /* Responsive spacing utilities */
  .py-responsive {
    padding-top: clamp(2rem, 5vw, 4rem);
    padding-bottom: clamp(2rem, 5vw, 4rem);
  }
  
  .px-responsive {
    padding-left: clamp(1rem, 3vw, 2rem);
    padding-right: clamp(1rem, 3vw, 2rem);
  }
  
  /* Responsive grid utilities */
  .grid-responsive {
    display: grid;
    gap: clamp(1rem, 3vw, 2rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  }
  /* Modern gradient mask */
  .gradient-mask {
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
  }

  /* Enhanced shimmer effect */
  .shimmer {
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.7) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
  }

  @keyframes shimmer {
    0% {
      background-position: -100% 0;
    }
    100% {
      background-position: 100% 0;
    }
  }

  /* Modern glow effect */
  .glow {
    animation: glow 3s ease-in-out infinite alternate;
  }

  @keyframes glow {
    from {
      filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
    }
    to {
      filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.8)) drop-shadow(0 0 60px rgba(139, 92, 246, 0.4));
    }
  }

  /* Aurora gradient effect */
  .aurora-gradient {
    background: linear-gradient(45deg, #8B5CF6, #7C3AED, #EC4899, #F43F5E);
    background-size: 300% 300%;
    animation: aurora 15s ease infinite;
  }

  @keyframes aurora {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  /* Modern gradient border */
  .gradient-border {
    position: relative;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
    padding: 1px;
    border-radius: var(--radius);
  }

  .gradient-border > * {
    background: var(--background);
    border-radius: calc(var(--radius) - 1px);
  }

  /* Animated gradient border */
  .gradient-border-animated {
    position: relative;
    background: linear-gradient(45deg, #8B5CF6, #7C3AED, #EC4899, #F43F5E, #8B5CF6);
    background-size: 200% 200%;
    padding: 1px;
    border-radius: var(--radius);
    animation: gradient-shift 4s ease infinite;
  }

  @keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }

  .float-animation {
    animation: float 6s ease-in-out infinite;
  }

  @keyframes float {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-20px);
    }
  }

  .slide-up {
    animation: slide-up 0.6s ease-out;
  }

  @keyframes slide-up {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .fade-in {
    animation: fade-in 0.8s ease-out;
  }

  @keyframes fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .pulse-border {
    animation: pulse-border 2s infinite;
  }

  @keyframes pulse-border {
    0% {
      box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    70% {
      box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
  }

  /* Enhanced gradient text */
  .gradient-text {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback for browsers that don't support text-fill-color */
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
  }

  /* Accent gradient text */
  .gradient-text-accent {
    background: linear-gradient(135deg, var(--accent-gradient-start) 0%, var(--accent-gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Standard property */
  }

  .hover-lift {
    transition: all 0.3s ease;
  }

  .hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  }

  /* Enhanced glassmorphism with fallback */
  .glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
  }
  
  /* Fallback for browsers without backdrop-filter support */
  @supports not (backdrop-filter: blur(12px)) {
    .glass-effect {
      background: rgba(31, 41, 55, 0.95); /* Dark fallback for better contrast */
    }
  }

  /* Subtle glass effect */
  .glass-subtle {
    background: rgba(255, 255, 255, 0.08); /* Slightly more opaque */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15); /* More visible border */
  }

  /* Modern card shadow */
  .modern-shadow {
    box-shadow: 
      0 10px 25px -5px rgba(0, 0, 0, 0.1),
      0 10px 10px -5px rgba(0, 0, 0, 0.04),
      0 0 0 1px rgba(0, 0, 0, 0.02);
  }

  .modern-shadow-lg {
    box-shadow: 
      0 20px 50px -12px rgba(0, 0, 0, 0.15),
      0 10px 20px -5px rgba(0, 0, 0, 0.04),
      0 0 0 1px rgba(0, 0, 0, 0.02);
  }

  .text-balance {
    text-wrap: balance;
  }

  @media (max-width: 768px) {
    .mobile-full-width {
      width: 100% !important;
      max-width: 100% !important;
    }
    
    .mobile-text-center {
      text-align: center !important;
    }
    
    .mobile-px-4 {
      padding-left: 1rem !important;
      padding-right: 1rem !important;
    }
  }
}

body {
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 18px;
  line-height: 1.75;
  color: #1a1a1a; /* Dark gray for maximum contrast */
  background-color: #ffffff; /* Pure white background */
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

/* Modern typography scale */
h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  color: #1a202c; /* Ensure dark heading color */
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a202c; /* Ensure dark heading color */
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #2d3748; /* Dark gray for h3 */
}

p {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  line-height: 1.75;
  color: #4a5568; /* Direct dark gray for better contrast */
}

/* List items */
li {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.8;
  color: #2d3748; /* Dark gray for list items */
}

/* Input and button text */
input, button {
  font-size: 1.25rem;
}

/* Small text */
.text-sm {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: #4a5568; /* Medium gray for smaller text */
}

.text-xs {
  font-size: clamp(0.875rem, 1.5vw, 1.125rem);
  color: #4a5568; /* Medium gray for extra small text */
}

.text-base {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: #2d3748; /* Dark gray for base text */
}

.text-lg {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  color: #2d3748; /* Dark gray for large text */
}

.text-xl {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  color: #1a202c; /* Very dark gray for extra large text */
}

.text-2xl {
  font-size: clamp(1.875rem, 3.5vw, 2.25rem);
  color: #1a202c; /* Very dark gray for 2xl text */
}

/* Modern hero pattern */
.hero-pattern {
  background-color: hsl(var(--background));
  background-image: 
    radial-gradient(at 20% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(at 80% 20%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
    radial-gradient(at 40% 40%, rgba(244, 63, 94, 0.08) 0%, transparent 50%); /* Lighter gradients to not interfere with text */
  position: relative;
}

.hero-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, hsl(var(--background)) 90%);
  pointer-events: none;
}

.section-divider {
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.15), transparent); /* More visible divider */
  height: 1px;
  width: 100%;
  margin: 4rem 0;
}

.email-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Modern CTA button */
.cta-button {
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  color: #ffffff; /* Pure white for maximum contrast on gradient background */
  font-size: 1.125rem;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 14px 0 rgba(139, 92, 246, 0.3),
    0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--gradient-end) 0%, var(--gradient-start) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cta-button:hover::before {
  opacity: 1;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px 0 rgba(139, 92, 246, 0.4),
    0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.cta-button span {
  position: relative;
  z-index: 1;
}

/* Modern input styles */
input[type="email"] {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

input[type="email"]:hover {
  border-color: hsl(var(--border) / 0.8);
}

input[type="email"]:focus {
  border-color: hsl(var(--ring));
  box-shadow: 
    0 0 0 3px hsl(var(--ring) / 0.2),
    0 1px 2px 0 rgba(0, 0, 0, 0.05);
  outline: none;
}

input[type="email"]::placeholder {
  color: #718096; /* Medium gray for placeholders */
  opacity: 0.8; /* Slightly darker placeholder */
}

/* Modern section backgrounds */
.section-gradient {
  background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%); /* Higher contrast gradient */
}

.section-pattern {
  background-color: #ffffff;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(236, 72, 153, 0.03) 0%, transparent 50%); /* Very subtle pattern */
}

/* Modern feature card */
.feature-card {
  background: #ffffff; /* Solid white background */
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
  border: 1px solid #e5e7eb; /* Darker border for better visibility */
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, hsl(var(--primary) / 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: hsl(var(--primary) / 0.3);
}

/* Korean text optimization */
.ko-text {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.9;
}

/* Better spacing for Korean content */
.ko-paragraph {
  letter-spacing: -0.02em;
  line-height: 2;
}

/* Modern card styles */
.modern-card {
  background: #ffffff; /* Solid white background */
  border-radius: calc(var(--radius) * 2);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e5e7eb; /* Visible border */
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.modern-card:hover {
  transform: translateY(-6px);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Card with gradient accent */
.card-gradient-accent {
  position: relative;
  background: #ffffff; /* White background for text contrast */
  border-radius: calc(var(--radius) * 2);
  padding: 2.5rem;
  overflow: hidden;
  border: 1px solid #e5e7eb; /* Add border for definition */
}

.card-gradient-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
}

/* Enhanced glassmorphism card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--radius) * 2);
  box-shadow: var(--glass-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    var(--glass-shadow),
    0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Modern button styles */
.modern-button {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.modern-button:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.modern-button:active {
  transform: translateY(0);
}

/* Ghost button */
.ghost-button {
  background: transparent;
  color: #2d3748; /* Dark gray for readability */
  border: 1px solid #cbd5e0; /* Visible border */
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ghost-button:hover {
  background: #f7fafc; /* Light gray background on hover */
  border-color: #a0aec0; /* Darker border on hover */
  color: #1a202c; /* Even darker text on hover */
}

/* Modern section spacing */
section {
  padding: 5rem 0;
  position: relative;
}

@media (max-width: 768px) {
  section {
    padding: 3rem 0;
  }
}

/* Section transitions */
.section-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-card:hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.testimonial-card {
  background: #f7fafc; /* Solid light background for better contrast */
  border: 1px solid #e2e8f0; /* Add border for definition */
  border-radius: 1rem;
  padding: 2rem;
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  font-size: 4rem;
  color: rgba(0, 0, 0, 0.15); /* Slightly darker quote mark */
  font-weight: 900;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-content.open {
  max-height: 300px;
}

.bonus-badge {
  background: linear-gradient(135deg, #d946ef 0%, #ef4444 100%); /* Darker gradient for better contrast */
  color: #ffffff; /* Pure white text */
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.countdown-timer {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 1.5rem;
  color: #dc2626; /* Darker red for better contrast */
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.responsive-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  body {
    font-size: 16px; /* Better readability on mobile */
  }
  
  .responsive-text {
    font-size: 1rem;
    color: #2d3748; /* Ensure dark text on mobile */
  }
  
  /* Better mobile text sizing */
  p {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #4a5568; /* Consistent dark gray */
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  /* Ensure buttons are touch-friendly */
  button, .button, input[type="submit"] {
    min-height: 44px; /* iOS recommendation */
    min-width: 44px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 17px;
  }
  
  .responsive-text {
    font-size: 1.0625rem;
  }
  
  /* Prevent text overflow on small screens */
  h1, h2, h3 {
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  
  p, li {
    word-break: keep-all;
    overflow-wrap: break-word;
  }
  
  .modern-card {
    padding: 2rem;
  }
}

/* Enhanced Responsive Typography System */
@media (max-width: 320px) {
  /* Very small devices */
  html {
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Navigation responsive */
@media (max-width: 768px) {
  /* Mobile menu button */
  .mobile-menu-button {
    display: block;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 60;
    width: 3rem;
    height: 3rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  
  /* Responsive stat cards */
  .grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Touch-friendly interactive elements */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .card-hover:hover {
    transform: none;
  }
  
  /* Larger tap targets */
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Disable hover animations */
  *:hover {
    animation: none !important;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-gradient {
    min-height: auto;
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  /* Hide scroll indicator in landscape */
  .absolute.bottom-8 {
    display: none;
  }
}

/* High resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper borders and shadows */
  .modern-card {
    border-width: 0.5px;
  }
  
  .glass-effect {
    border-width: 0.5px;
  }
}

/* Print styles */
@media print {
  /* Hide non-essential elements */
  .hero-gradient::before,
  .absolute,
  video,
  .decoration,
  footer {
    display: none !important;
  }
  
  /* Better print layout */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  .modern-card {
    page-break-inside: avoid;
    border: 1px solid #ddd;
    box-shadow: none;
  }
}

/* Responsive utilities for flex layouts */
@media (max-width: 640px) {
  .flex-wrap-mobile {
    flex-wrap: wrap;
  }
  
  .justify-center-mobile {
    justify-content: center;
  }
  
  .text-center-mobile {
    text-align: center;
  }
}

/* Container responsive widths */
@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

@media (min-width: 1280px) and (max-width: 1535px) {
  .container {
    max-width: 1280px;
  }
}

.loading-spinner {
  border: 2px solid #f3f3f3;
  border-radius: 50%;
  border-top: 2px solid #3498db;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.success-message {
  background-color: #059669; /* Darker green for better contrast */
  color: #ffffff; /* Pure white text */
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  animation: slide-down 0.3s ease-out;
}

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

.error-message {
  background-color: #dc2626; /* Darker red for better contrast */
  color: #ffffff; /* Pure white text */
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  animation: shake 0.3s ease-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Responsive table styling */
@media (max-width: 640px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Responsive video embeds */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Better focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Skip links for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #7c3aed; /* Solid purple background */
  color: #ffffff; /* White text for contrast */
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Responsive line height adjustments */
@media (max-width: 640px) {
  p, li {
    line-height: 1.7;
  }
  
  h1, h2, h3 {
    line-height: 1.3;
  }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
  
  * {
    max-width: 100vw;
  }
}