/* Summit English Academy - Custom CSS with Tailwind-like utilities */
/* Brand Colors: Blue (#2563EB) & Orange (#F97316) */

:root {
  --primary: #2563EB;
  --secondary: #F97316;
  --dark: #1E293B;
  --light: #F8FAFC;
  --gray: #334155;
  --success: #10B981;
  --white: #FFFFFF;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--white);
  overflow-x: hidden;
}

/* Container with responsive padding and max-width */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

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

/* Ensure no horizontal overflow */
@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

/* Responsive gap adjustments */
@media (max-width: 640px) {
  .gap-8 { gap: 1.5rem; }
  .gap-12 { gap: 2rem; }
}

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing */
.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.pt-8 { padding-top: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-20 { margin-bottom: 5rem; }

/* Responsive spacing adjustments */
@media (max-width: 640px) {
  .py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .py-20 { padding-top: 3rem; padding-bottom: 3rem; }
  .py-24 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
}

/* Section spacing - consistent gaps between sections */
section {
  margin-bottom: 0;
}

section:last-child {
  margin-bottom: 0;
}

/* Space-y utilities (vertical spacing between children) */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Text */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-white { color: var(--white); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-gray { color: var(--gray); }
.text-dark { color: var(--dark); }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Responsive text scaling */
@media (max-width: 640px) {
  .text-5xl { font-size: 1.875rem; line-height: 2.25rem; }
  .text-4xl { font-size: 1.5rem; line-height: 2rem; }
  .text-3xl { font-size: 1.5rem; line-height: 2rem; }
  .text-2xl { font-size: 1.25rem; line-height: 1.75rem; }
  .text-xl { font-size: 1.125rem; line-height: 1.75rem; }
  .text-lg { font-size: 1rem; line-height: 1.5rem; }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .text-5xl { font-size: 2.25rem; line-height: 2.5rem; }
  .text-4xl { font-size: 1.875rem; line-height: 2.25rem; }
  .text-3xl { font-size: 1.5rem; line-height: 2rem; }
}

/* Backgrounds */
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-light { background-color: var(--light); }
.bg-white { background-color: var(--white); }
.bg-dark { background-color: var(--dark); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
  }
}

.btn-primary {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #EA580C 0%, #DC2626 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.btn-outline {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%);
  border: 2px solid var(--primary);
  color: var(--primary);
  position: relative;
  overflow: hidden;
}

.btn-outline::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn-outline:hover {
  color: var(--white);
  border-color: var(--primary);
}

.btn-outline:hover::before {
  left: 0;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

@media (max-width: 640px) {
  .btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
  }
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.1);
  transition: all 0.3s ease;
}

@media (max-width: 640px) {
  .card {
    padding: 1.25rem;
    border-radius: 8px;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .card {
    padding: 1.5rem;
  }
}

.card button {
  width: 100%;
  text-align: left;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.card button:hover {
  background: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
}

@media (max-width: 640px) {
  .card:hover {
    transform: translateY(-3px);
  }
}

/* Header/Navbar */
.navbar {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

@media (min-width: 640px) {
  .navbar .container {
    padding: 1rem 1.5rem;
  }
}

.navbar .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--dark);
  font-weight: 700;
  font-size: 1.25rem;
}

@media (max-width: 640px) {
  .navbar .logo {
    font-size: 1.125rem;
    gap: 0.5rem;
  }
}

.navbar .logo img {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .navbar .logo img {
    width: 40px;
    height: 40px;
  }
}

.navbar .logo span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 360px) {
  .navbar .logo span {
    max-width: 180px;
  }
}

.navbar nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 769px) and (max-width: 1023px) {
  .navbar nav ul {
    gap: 1rem;
  }

  .navbar nav a {
    font-size: 0.9375rem;
  }
}

.navbar nav a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar nav a:hover {
  color: var(--primary);
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark);
  padding: 0.5rem;
  margin: -0.5rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1E40AF 100%);
  color: var(--white);
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .hero {
    padding: 2.5rem 0;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .hero {
    padding: 4rem 0;
  }
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../images/hero.png') center/cover;
  opacity: 0.15;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

/* Images - prevent overflow and ensure proper scaling */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure images in grid layouts scale properly */
.grid img,
.card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.rounded-full {
  border-radius: 9999px;
}

/* Width utilities with responsive sizing */
.w-32 {
  width: 8rem;
}

.h-32 {
  height: 8rem;
}

@media (max-width: 640px) {
  .w-32 {
    width: 6rem;
  }

  .h-32 {
    height: 6rem;
  }
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.max-w-3xl {
  max-width: 48rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .form-group {
    margin-bottom: 1.25rem;
  }
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--dark);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #E2E8F0;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #64748B;
  opacity: 1;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Footer */
.footer {
  background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  color: white;
  padding: 4rem 0 1.5rem;
  margin-top: 6rem;
  border-top: 4px solid var(--primary);
  position: relative;
}

@media (max-width: 640px) {
  .footer {
    padding: 2.5rem 0 1rem;
    margin-top: 3rem;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .footer {
    padding: 3rem 0 1.25rem;
    margin-top: 4rem;
  }
}

.footer p,
.footer .text-gray {
  color: rgba(255, 255, 255, 0.9);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--secondary) 50%, transparent 100%);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--secondary);
}

/* Accordion transitions */
.accordion-content {
  overflow: hidden;
  padding-top: 1rem;
}

/* FAQ card spacing */
.card.mb-4 {
  padding: 1.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .card.mb-4 {
    padding: 1rem;
  }
}

.card.mb-4:last-child {
  margin-bottom: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 2rem;
}

@media (max-width: 640px) {
  .modal-content {
    padding: 1.5rem;
    border-radius: 8px;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--light);
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.75rem;
  line-height: 1;
  transition: all 0.3s;
  color: var(--dark);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .modal-close {
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
    top: 0.5rem;
    right: 0.5rem;
  }
}

.modal-close:hover {
  background: var(--gray);
  transform: rotate(90deg);
}

/* Cookie Consent */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark);
  color: var(--white);
  padding: 1.5rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: none;
}

@media (max-width: 640px) {
  .cookie-consent {
    padding: 1rem;
  }

  .cookie-consent .container {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .cookie-consent .btn {
    width: 100%;
  }

  .cookie-consent p {
    text-align: center;
  }
}

.cookie-consent.show {
  display: block;
}

/* Responsive Grid Breakpoints */
@media (max-width: 640px) {
  .navbar nav {
    display: none;
  }

  .navbar nav.mobile-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }

  .navbar nav.mobile-open ul {
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }

  .navbar nav.mobile-open li {
    padding: 1rem 0;
    border-bottom: 1px solid #E2E8F0;
    width: 100%;
  }

  .navbar nav.mobile-open li:last-child {
    border-bottom: none;
  }

  .navbar nav.mobile-open a {
    display: block;
    width: 100%;
  }

  .mobile-menu-btn {
    display: block;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .md\:grid-cols-2,
  .md\:grid-cols-3,
  .md\:grid-cols-4 {
    grid-template-columns: 1fr;
  }

  /* Hide hero image on mobile to prevent layout issues */
  .hero .grid > div:last-child {
    display: none;
  }
}

/* Tablet breakpoint (641px - 1023px) */
@media (min-width: 641px) and (max-width: 1023px) {
  .md\:grid-cols-3,
  .md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Better grid for footer on tablet */
  .footer .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop breakpoint */
@media (min-width: 1024px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Utilities */
.rounded { border-radius: 0.5rem; }
.rounded-lg { border-radius: 1rem; }
.shadow { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); }
.w-full { width: 100%; }
.h-auto { height: auto; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }

/* Disabled state for buttons */
.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:disabled:hover,
.btn[disabled]:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Avatar circles - responsive sizes */
.avatar-circle {
  width: 8rem;
  height: 8rem;
  border-radius: 9999px;
}

@media (max-width: 640px) {
  .avatar-circle {
    width: 6rem;
    height: 6rem;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .avatar-circle {
    width: 7rem;
    height: 7rem;
  }
}

/* Avatar circles for different sizes */
.avatar-sm {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
}

@media (max-width: 640px) {
  .avatar-sm {
    width: 3.5rem;
    height: 3.5rem;
  }
}

.avatar-lg {
  width: 10rem;
  height: 10rem;
  border-radius: 9999px;
}

@media (max-width: 640px) {
  .avatar-lg {
    width: 7rem;
    height: 7rem;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .avatar-lg {
    width: 8.5rem;
    height: 8.5rem;
  }
}

/* Additional width/height utilities for avatars */
.w-16 {
  width: 4rem;
}

.h-16 {
  height: 4rem;
}

@media (max-width: 640px) {
  .w-16 {
    width: 3.5rem;
  }

  .h-16 {
    height: 3.5rem;
  }
}

.w-40 {
  width: 10rem;
}

.h-40 {
  height: 10rem;
}

@media (max-width: 640px) {
  .w-40 {
    width: 7rem;
  }

  .h-40 {
    height: 7rem;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .w-40 {
    width: 8.5rem;
  }

  .h-40 {
    height: 8.5rem;
  }
}

/* Height utilities for video/media placeholders */
.h-48 {
  height: 12rem;
}

@media (max-width: 640px) {
  .h-48 {
    height: 10rem;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .h-48 {
    height: 11rem;
  }
}

/* Additional Responsive Fixes for Better Adaptation */

/* Statistics section responsive improvements */
@media (max-width: 640px) {
  .bg-primary .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .bg-primary .grid.md\:grid-cols-4 > div {
    padding: 1rem 0;
  }
}

/* Registration section improvements */
@media (max-width: 640px) {
  section#registration .grid {
    gap: 2rem;
  }

  section#registration .card {
    padding: 1.5rem;
  }
}

/* Success stories section images - better mobile handling */
@media (max-width: 640px) {
  section .grid.md\:grid-cols-2 > div:first-child img {
    margin-bottom: 1.5rem;
  }
}

/* FAQ section max-width improvement */
@media (max-width: 640px) {
  .max-w-3xl {
    max-width: 100%;
  }
}

/* Course tabs responsive improvements */
@media (max-width: 640px) {
  .flex.gap-4.mb-8.justify-center.flex-wrap {
    gap: 0.5rem;
  }

  .flex.gap-4.mb-8.justify-center.flex-wrap .btn {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
  }
}

/* Form improvements on mobile - prevent zoom on iOS */
@media (max-width: 640px) {
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
  }
}

/* Features grid improvements */
@media (max-width: 640px) {
  .bg-light .grid.md\:grid-cols-3 {
    gap: 1.25rem;
  }

  .bg-light .grid.md\:grid-cols-3 .card {
    padding: 1.5rem;
  }
}

/* Course preview cards spacing */
@media (max-width: 640px) {
  section .grid.md\:grid-cols-3 .card ul {
    margin-bottom: 1.25rem;
  }

  section .grid.md\:grid-cols-3 .card ul li {
    font-size: 0.9375rem;
  }
}

/* Better button spacing in hero */
@media (max-width: 640px) {
  .hero .flex.flex-wrap.gap-4 {
    gap: 0.75rem;
  }

  .hero .flex.flex-wrap.gap-4 .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Footer responsive improvements */
@media (max-width: 640px) {
  .footer .grid.md\:grid-cols-4 {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer .grid.md\:grid-cols-4 > div {
    text-align: center;
  }

  .footer .footer-links {
    text-align: center;
  }

  .footer p {
    text-align: center;
  }
}

/* Small mobile devices (below 360px) */
@media (max-width: 359px) {
  .container {
    padding: 0 0.75rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .text-5xl {
    font-size: 1.5rem;
    line-height: 2rem;
  }

  .text-4xl {
    font-size: 1.375rem;
    line-height: 1.875rem;
  }

  .card {
    padding: 1rem;
  }
}

/* Prevent text overflow and ensure readability */
h1, h2, h3, h4, h5, h6 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

p, li, a {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Ensure proper spacing for list items */
ul li {
  margin-bottom: 0.5rem;
}

ul li:last-child {
  margin-bottom: 0;
}

/* Course page specific improvements */
@media (max-width: 640px) {
  section .card .grid.md\:grid-cols-2 {
    gap: 1.5rem;
  }

  section .card .grid.md\:grid-cols-3 {
    gap: 1rem;
  }

  section .card h2 {
    margin-bottom: 1.5rem;
  }

  section .card h3 {
    margin-bottom: 1rem;
  }
}

/* Better touch targets for mobile */
@media (max-width: 640px) {
  a:not(.btn), button:not(.btn) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .navbar nav.mobile-open a {
    min-height: 48px;
    padding: 0.75rem 0;
  }
}

/* Ensure proper image sizing in all contexts */
@media (max-width: 640px) {
  img.rounded-lg {
    border-radius: 0.5rem;
  }

  section img {
    width: 100%;
    height: auto;
  }
}

/* Fix for long text in cards */
.card h3,
.card h4,
.card p {
  hyphens: auto;
  word-break: break-word;
}

/* Responsive padding for sections with background colors */
@media (max-width: 640px) {
  section.py-16.bg-light,
  section.py-16.bg-primary {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

/* Ensure proper spacing in success stories section */
@media (max-width: 640px) {
  section .card.mb-6 {
    margin-bottom: 1.25rem;
  }
}

/* Better mobile grid for courses page */
@media (max-width: 640px) {
  section .grid.md\:grid-cols-3 .card.bg-light {
    padding: 1.25rem;
  }
}

/* Tablet-specific improvements for better layout */
@media (min-width: 641px) and (max-width: 1023px) {
  .hero .grid {
    gap: 2rem;
  }

  section .grid.md\:grid-cols-3 {
    gap: 1.5rem;
  }
}

/* Ensure cookie consent text is readable on mobile */
@media (max-width: 640px) {
  .cookie-consent p {
    font-size: 0.9375rem;
    line-height: 1.5;
  }

  .cookie-consent a {
    text-decoration: underline;
  }
}

/* Fix for registration form on very small screens */
@media (max-width: 359px) {
  .form-input,
  .form-select,
  .form-textarea {
    padding: 0.625rem 0.875rem;
  }
}

/* Better spacing for FAQ accordion on mobile */
@media (max-width: 640px) {
  .card button {
    gap: 0.75rem;
  }

  .card button span {
    font-size: 1.5rem;
    flex-shrink: 0;
  }

  .card button h3 {
    font-size: 1.125rem;
    line-height: 1.5;
  }
}
