/**
 * Responsive CSS for Modern Age Coders
 * Mobile-First Responsive Design
 */

/* ========================================
   MOBILE-FIRST BASE STYLES (320px+)
   ======================================== */

/* Base responsive container */
.container {
  width: 100%;
  max-width: 100%;
  padding: 0 1rem;
  margin: 0 auto;
}

/* Prevent horizontal scroll */
body {
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  max-width: 100%;
}

/* Responsive images - Requirements: 4.7, 8.2, 8.4, 8.5 */
img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Hero images - maintain aspect ratio */
.hero-image img,
.hero-section img {
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Course thumbnails - maintain aspect ratio */
.card-thumbnail-container img,
.course-image-container img,
.course-image,
.course-card img {
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

/* Logo images */
.logo-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Responsive typography - Mobile base */
body {
  font-size: 14px;
  line-height: 1.6;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.3;
  margin-bottom: 0.875rem;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  line-height: 1.4;
  margin-bottom: 0.625rem;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 65ch;
}

/* Responsive spacing */
.section {
  padding: 2rem 1rem;
  margin-bottom: 2rem;
}

/* Mobile navigation */
.nav-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 20, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  flex-direction: column;
  padding: 2rem 1rem;
  overflow-y: auto;
  z-index: 9998;
  -webkit-transform: translateX(-100%);
  -moz-transform: translateX(-100%);
  -ms-transform: translateX(-100%);
  transform: translateX(-100%);
  -webkit-transition: transform 0.3s ease;
  -moz-transition: transform 0.3s ease;
  transition: transform 0.3s ease;
}

.nav-menu.active {
  display: flex;
  -webkit-transform: translateX(0);
  -moz-transform: translateX(0);
  -ms-transform: translateX(0);
  transform: translateX(0);
}

.nav-item {
  width: 100%;
  margin: 8px 0; /* Minimum 8px spacing between items */
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  min-height: 44px; /* Minimum touch target height */
  min-width: 44px; /* Minimum touch target width */
  font-size: 1.125rem;
  -webkit-transition: background-color 0.2s ease, opacity 0.2s ease;
  -moz-transition: background-color 0.2s ease, opacity 0.2s ease;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Touch feedback for navigation links */
.nav-link:active {
  background-color: rgba(168, 85, 247, 0.2);
  opacity: 0.8;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 10000;
  position: relative;
}

.mobile-menu-btn span {
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  -webkit-border-radius: 2px;
  -moz-border-radius: 2px;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  transition: all 0.3s ease;
  -webkit-transform-origin: center;
  -moz-transform-origin: center;
  -ms-transform-origin: center;
  transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) {
  -webkit-transform: translateY(7px) rotate(45deg);
  -moz-transform: translateY(7px) rotate(45deg);
  -ms-transform: translateY(7px) rotate(45deg);
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  -webkit-transform: translateY(-7px) rotate(-45deg);
  -moz-transform: translateY(-7px) rotate(-45deg);
  -ms-transform: translateY(-7px) rotate(-45deg);
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   TOUCH TARGET OPTIMIZATION (44x44px minimum)
   Requirements: 5.1, 5.2, 5.3, 5.4, 5.5
   ======================================== */

/* All buttons - minimum 44x44px touch targets */
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.btn,
.btn-primary,
.btn-secondary,
.btn-tertiary,
.cta-button,
.card-button,
.plan-button,
.submit-button,
.tab-button,
.view-more-button,
.mobile-menu-btn,
.carousel-arrow,
.certificate-arrow,
.auth-submit-btn,
.auth-modal-close,
.auth-password-toggle,
.feedback-close {
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

/* All links - minimum 44x44px touch targets */
a,
.nav-link,
.dropdown-item,
.footer-link,
.social-link {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
}

/* Minimum 8px spacing between interactive elements */
button + button,
a + a,
button + a,
a + button,
.nav-item + .nav-item,
.tab-button + .tab-button {
  margin-left: 8px;
}

/* Vertical spacing for stacked interactive elements */
.nav-item,
.dropdown-item,
.footer-link {
  margin-bottom: 8px;
}

.nav-item:last-child,
.dropdown-item:last-child,
.footer-link:last-child {
  margin-bottom: 0;
}

/* Visual feedback for all touch interactions */
button:active,
input[type="submit"]:active,
input[type="button"]:active,
input[type="reset"]:active,
.btn:active,
.cta-button:active,
.card-button:active,
.plan-button:active,
.submit-button:active,
.tab-button:active,
.view-more-button:active,
a:active,
.nav-link:active {
  opacity: 0.85;
  -webkit-transform: scale(0.97);
  -moz-transform: scale(0.97);
  -ms-transform: scale(0.97);
  transform: scale(0.97);
  -webkit-transition: all 0.1s ease;
  -moz-transition: all 0.1s ease;
  transition: all 0.1s ease;
}

/* Enhanced touch feedback for primary interactive elements */
.cta-button:active,
.card-button:active,
.plan-button:active,
.submit-button:active {
  -webkit-transform: scale(0.95) translateY(1px);
  -moz-transform: scale(0.95) translateY(1px);
  -ms-transform: scale(0.95) translateY(1px);
  transform: scale(0.95) translateY(1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  -moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Touch feedback for icon buttons */
.mobile-menu-btn:active,
.carousel-arrow:active,
.certificate-arrow:active,
.auth-modal-close:active,
.auth-password-toggle:active,
.feedback-close:active {
  opacity: 0.7;
  -webkit-transform: scale(0.9);
  -moz-transform: scale(0.9);
  -ms-transform: scale(0.9);
  transform: scale(0.9);
}

/* ========================================
   MOBILE FORM OPTIMIZATION
   Requirements: 9.1, 9.2, 9.3, 9.4, 9.5
   ======================================== */

/* Form inputs - minimum 44px height (Requirement 5.4, 9.2) */
input,
textarea,
select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="date"] {
  min-height: 44px;
  font-size: 16px; /* Prevents zoom on iOS - Requirement 9.2 */
  padding: 0.75rem 1rem;
  width: 100%;
  max-width: 100%;
  border-radius: 0.5rem;
  -webkit-border-radius: 0.5rem; /* Safari */
  -moz-border-radius: 0.5rem; /* Firefox */
  transition: all 0.2s ease;
  -webkit-transition: all 0.2s ease; /* Safari */
  -moz-transition: all 0.2s ease; /* Firefox */
  -webkit-appearance: none; /* Remove default iOS styling */
  -moz-appearance: none;
  appearance: none;
}

/* Textarea specific styles */
textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

/* Native mobile select controls - Requirement 9.5 */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23CBD5E1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Visual feedback for form inputs on focus */
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(168, 85, 247, 0.8);
  outline-offset: 2px;
  -webkit-transform: scale(1.01);
  -moz-transform: scale(1.01);
  -ms-transform: scale(1.01);
  transform: scale(1.01);
  border-color: rgba(168, 85, 247, 0.5);
}

/* Valid input state */
input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown),
select:valid {
  border-color: rgba(78, 205, 196, 0.5);
}

/* Invalid input state - Requirement 9.3 */
input:invalid:not(:placeholder-shown):not(:focus),
textarea:invalid:not(:placeholder-shown):not(:focus),
select:invalid:not(:focus) {
  border-color: rgba(255, 107, 107, 0.5);
}

/* Form group container - Requirement 9.4 */
.form-group,
.contact-form-group {
  margin-bottom: 1rem;
  position: relative;
}

/* Labels positioned above inputs - Requirement 9.4 */
label {
  display: block;
  margin-bottom: 8px;
  min-height: 24px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 1rem;
}

/* Required field indicator */
label.required::after,
label[required]::after {
  content: ' *';
  color: rgba(255, 107, 107, 0.8);
  font-weight: bold;
}

/* Validation message styles - Requirement 9.3 */
.validation-message {
  display: none;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  line-height: 1.4;
}

.validation-message.error {
  display: block;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border-left: 3px solid #ff6b6b;
}

.validation-message.success {
  display: block;
  color: #4ecdc4;
  background: rgba(78, 205, 196, 0.1);
  border-left: 3px solid #4ecdc4;
}

.validation-message.info {
  display: block;
  color: #CBD5E1;
  background: rgba(203, 213, 225, 0.1);
  border-left: 3px solid #CBD5E1;
}

/* Input with error state */
input.error,
textarea.error,
select.error {
  border-color: rgba(255, 107, 107, 0.7);
  background-color: rgba(255, 107, 107, 0.05);
}

/* Input with success state */
input.success,
textarea.success,
select.success {
  border-color: rgba(78, 205, 196, 0.7);
  background-color: rgba(78, 205, 196, 0.05);
}

/* Helper text for inputs */
.input-helper {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  display: block;
}

/* Disabled input states */
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: rgba(100, 100, 100, 0.2);
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* Autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0px 1000px rgba(16, 16, 28, 0.8) inset;
  -webkit-transition: background-color 5000s ease-in-out 0s;
  -moz-transition: background-color 5000s ease-in-out 0s;
  transition: background-color 5000s ease-in-out 0s;
}

/* Form submit button spacing */
form button[type="submit"],
form input[type="submit"] {
  margin-top: 0.5rem;
  width: 100%;
}

/* Checkbox and radio button styling for mobile */
input[type="checkbox"],
input[type="radio"] {
  min-width: 20px;
  min-height: 20px;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  cursor: pointer;
}

/* Checkbox/radio labels */
label.checkbox-label,
label.radio-label {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  padding: 0.5rem 0;
}

/* Number input buttons on mobile */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Date input styling */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.8);
  padding: 0.25rem;
}

/* Search input clear button */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23CBD5E1'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 20px 20px;
  cursor: pointer;
}

/* Form-level message styles - Requirement 9.3 */
.form-message {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-message.error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.form-message.success {
  color: #4ecdc4;
  background: rgba(78, 205, 196, 0.1);
  border: 1px solid rgba(78, 205, 196, 0.3);
}

.form-message.info {
  color: #CBD5E1;
  background: rgba(203, 213, 225, 0.1);
  border: 1px solid rgba(203, 213, 225, 0.3);
}

.form-message::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.form-message.error::before {
  content: '⚠';
  font-size: 1.25rem;
}

.form-message.success::before {
  content: '✓';
  font-size: 1.25rem;
}

.form-message.info::before {
  content: 'ℹ';
  font-size: 1.25rem;
}

/* Responsive grids - Mobile First (Requirements: 4.2, 4.3) */
.features-grid,
.courses-grid,
.curriculum-grid,
.testimonial-grid,
.values-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 1.5rem;
  width: 100%;
  margin: 0 auto;
}

/* Inclusivity section grid - convert inline flex to responsive grid */
.inclusivity-demographics-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 1.5rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Demographic cards mobile optimization */
.demographic-card-mobile {
  width: 100%;
  min-width: unset;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* Hero section mobile optimization - Requirements: 4.2, 4.3 */
.hero-section {
  flex-direction: column; /* Stack vertically on mobile */
  text-align: center; /* Center-align content on mobile */
  padding: 2rem 1rem; /* Adjust padding for mobile */
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

.hero-text,
.hero-image {
  width: 100%;
  flex: none;
  max-width: 100%;
}

/* Hero text mobile optimization */
.hero-text {
  order: 1; /* Text first on mobile */
  margin-bottom: 1rem;
}

/* Hero image mobile optimization */
.hero-image {
  order: 2; /* Image second on mobile */
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image svg {
  max-width: 280px;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Mobile image sizing - Requirements: 4.7, 8.4, 8.5 */
.hero-image img {
  max-width: 280px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.card-thumbnail-container,
.course-image-container {
  max-width: 100%;
  overflow: hidden;
}

.card-thumbnail-container img,
.course-image-container img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
}

/* Cards responsive */
.course-card,
.feature-item,
.demographic-card,
.content-card {
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* Dropdown mobile - stacked layout */
.dropdown-content {
  position: static;
  display: none;
  background: rgba(20, 20, 35, 0.95);
  border: none;
  box-shadow: none;
  padding: 0.5rem 0;
  margin-top: 8px; /* Minimum 8px spacing */
  border-left: 3px solid rgba(168, 85, 247, 0.5);
  margin-left: 1rem;
  border-radius: 4px;
}

/* Hide courses dropdown on mobile - only show on tablet/desktop */
@media (max-width: 767px) {
  .nav-item.dropdown:has(.nav-link[href*="course"]) {
    display: none;
  }
}

.dropdown.active .dropdown-content {
  display: block;
  -webkit-animation: slideDown 0.3s ease;
  -moz-animation: slideDown 0.3s ease;
  animation: slideDown 0.3s ease;
}

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

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

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

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  min-height: 44px; /* Minimum touch target height */
  min-width: 44px; /* Minimum touch target width */
  margin: 4px 0; /* Spacing between dropdown items */
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
  border-radius: 4px;
  position: relative;
}

/* Touch feedback for dropdown items */
.dropdown-item:active {
  background-color: rgba(168, 85, 247, 0.3);
  opacity: 0.9;
  transform: scale(0.98);
}

/* Hover state for desktop */
@media (hover: hover) and (pointer: fine) {
  .dropdown-item:hover {
    background-color: rgba(168, 85, 247, 0.2);
  }
}

/* Visual indicator for dropdown toggle on mobile */
@media (max-width: 767px) {
  .dropdown > .nav-link {
    position: relative;
    justify-content: space-between;
  }
  
  .dropdown > .nav-link svg {
    transition: transform 0.3s ease;
  }
  
  .dropdown.active > .nav-link svg {
    transform: rotate(180deg);
  }
}

/* Tables responsive */
table {
  width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========================================
   EXTRA SMALL MOBILE (320px - 359px)
   Touch target optimization for smallest devices
   ======================================== */

@media (max-width: 359px) {
  /* Ensure buttons don't overflow on very small screens */
  .cta-button,
  .card-button,
  .plan-button,
  .submit-button {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Stack buttons vertically with proper spacing */
  .card-button-container,
  .plan-button-container {
    width: 100%;
  }
  
  .card-button,
  .plan-button {
    width: 100%;
    margin-bottom: 8px;
  }
  
  /* Ensure tab buttons fit on small screens */
  .tab-button {
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
    min-width: auto;
    flex: 1;
  }
  
  /* Tighter grid spacing on very small screens */
  .features-grid,
  .courses-grid,
  .curriculum-grid,
  .testimonial-grid,
  .values-grid,
  .inclusivity-demographics-grid {
    gap: 1rem;
    padding: 0 0.5rem;
  }
  
  /* Hero section optimization for very small screens */
  .hero-section {
    padding: 1.5rem 0.75rem;
    gap: 1.5rem;
  }
  
  .hero-image svg,
  .hero-image img {
    max-width: 240px;
  }
}

/* ========================================
   SMALL MOBILE (360px+)
   ======================================== */

@media (min-width: 360px) {
  .container {
    padding: 0 1.25rem;
  }
  
  body {
    font-size: 15px;
  }
  
  .section {
    padding: 2.5rem 1.25rem;
  }
  
  .logo-text {
    display: inline;
    font-size: 1rem;
  }
  
  /* Better spacing for interactive elements on slightly larger screens */
  button + button,
  a + a {
    margin-left: 10px;
  }
}

/* ========================================
   LARGE MOBILE (480px+)
   ======================================== */

@media (min-width: 480px) {
  .container {
    padding: 0 1.5rem;
  }
  
  body {
    font-size: 16px;
  }
  
  h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
  }
  
  .section {
    padding: 3rem 1.5rem;
  }
  
  /* Hero section improvements for larger mobile */
  .hero-section {
    padding: 2.5rem 1.5rem;
    gap: 2.5rem;
  }
  
  .hero-image svg {
    max-width: 350px;
  }
  
  .hero-image img {
    max-width: 350px;
  }
  
  .card-thumbnail-container img,
  .course-image-container img {
    max-height: 220px;
  }
  
  .features-grid,
  .courses-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
  }
  
  /* Inclusivity demographics grid - 2 columns on larger mobile */
  .inclusivity-demographics-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
  }
  
  .course-card,
  .feature-item {
    padding: 2rem;
  }
}

/* ========================================
   TABLET PORTRAIT (768px+)
   ======================================== */

@media (min-width: 768px) {
  .container {
    max-width: 720px;
    padding: 0 2rem;
  }
  
  /* Show desktop navigation */
  .mobile-menu-btn {
    display: none;
  }
  
  .nav-menu {
    display: flex;
    position: static;
    flex-direction: row;
    background: transparent;
    padding: 0;
    transform: none;
    overflow: visible;
  }
  
  .nav-item {
    width: auto;
    margin: 0 0.25rem;
  }
  
  .nav-link {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
  }
  
  /* Dropdown desktop */
  .dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: rgba(16, 16, 28, 0.98);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.875rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
  }
  
  .dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: block;
  }
  
  .dropdown-item {
    padding: 0.75rem 1.25rem;
  }
  
  /* Hero section tablet */
  .hero-section {
    flex-direction: row;
    text-align: left;
    padding: 3rem 2rem;
    gap: 3rem;
    align-items: center;
  }
  
  .hero-text,
  .hero-image {
    width: 50%;
    flex: 1;
  }
  
  .hero-image svg {
    max-width: 400px;
  }
  
  .hero-image img {
    max-width: 400px;
  }
  
  .card-thumbnail-container img,
  .course-image-container img {
    max-height: 240px;
  }
  
  /* Grids tablet */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .curriculum-grid,
  .testimonial-grid,
  .values-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  /* Inclusivity demographics grid - 2 columns on tablet */
  .inclusivity-demographics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 0 2rem;
  }
  
  .section {
    padding: 4rem 2rem;
    margin-bottom: 3rem;
  }
  
  /* Typography tablet */
  h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
  }
  
  h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
  }
}

/* ========================================
   TABLET LANDSCAPE / SMALL DESKTOP (1024px+)
   ======================================== */

@media (min-width: 1024px) {
  .container {
    max-width: 960px;
  }
  
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
  }
  
  .courses-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
  
  /* Inclusivity demographics grid - 4 columns on desktop */
  .inclusivity-demographics-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
  }
  
  .section {
    padding: 5rem 2rem;
  }
  
  .hero-section {
    padding: 4rem 2rem;
  }
  
  .hero-image svg {
    max-width: 450px;
  }
  
  .hero-image img {
    max-width: 450px;
  }
}

/* ========================================
   DESKTOP (1280px+)
   ======================================== */

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
  
  .section {
    padding: 6rem 3rem;
  }
  
  .hero-section {
    padding: 5rem 3rem;
  }
  
  h1 {
    font-size: clamp(3rem, 5vw, 4rem);
  }
  
  h2 {
    font-size: clamp(2.5rem, 4vw, 3rem);
  }
}

/* ========================================
   LARGE DESKTOP (1440px+)
   ======================================== */

@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
  
  .hero-image svg {
    max-width: 500px;
  }
  
  .hero-image img {
    max-width: 500px;
  }
}

/* ========================================
   TOUCH DEVICE OPTIMIZATIONS
   Requirements: 5.1, 5.2, 5.3, 5.4, 5.5
   ======================================== */

@media (hover: none) and (pointer: coarse) {
  /* Ensure all interactive elements are easily tappable on touch devices */
  button,
  a,
  input[type="submit"],
  input[type="button"],
  .btn,
  .cta-button,
  .card-button,
  .nav-link {
    /* Increase touch target size on touch devices */
    min-height: 48px;
    min-width: 48px;
  }
  
  /* Remove hover effects on touch devices */
  .course-card:hover,
  .feature-item:hover,
  .demographic-card:hover,
  .cta-button:hover,
  .card-button:hover,
  .nav-link:hover {
    transform: none;
  }
  
  /* Add active states for touch feedback on cards */
  .course-card:active,
  .feature-item:active,
  .demographic-card:active {
    -webkit-transform: scale(0.98);
    -moz-transform: scale(0.98);
    -ms-transform: scale(0.98);
    transform: scale(0.98);
    -webkit-transition: transform 0.1s ease;
    -moz-transition: transform 0.1s ease;
    transition: transform 0.1s ease;
    opacity: 0.9;
  }
  
  /* Enhanced touch feedback for buttons */
  button:active,
  a:active,
  .btn:active,
  .cta-button:active,
  .card-button:active,
  .plan-button:active,
  .submit-button:active {
    -webkit-transform: scale(0.95);
    -moz-transform: scale(0.95);
    -ms-transform: scale(0.95);
    transform: scale(0.95);
    -webkit-transition: transform 0.1s ease;
    -moz-transition: transform 0.1s ease;
    transition: transform 0.1s ease;
    opacity: 0.85;
  }
  
  /* Touch feedback for navigation */
  .nav-link:active,
  .dropdown-item:active {
    background-color: rgba(168, 85, 247, 0.3);
    opacity: 0.9;
  }
  
  /* Increase spacing between touch targets on mobile */
  .nav-item {
    margin: 10px 0;
  }
  
  button + button,
  a + a {
    margin-left: 10px;
  }
  
  /* Ensure form inputs are touch-friendly */
  input,
  textarea,
  select {
    min-height: 48px;
    font-size: 16px;
  }
}

/* ========================================
   HIGH DPI DISPLAYS
   ======================================== */

@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  /* Optimize images for retina displays */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

/* 
 * Main reduced motion implementation is in style.css
 * Additional responsive-specific reduced motion overrides below
 */

@media (prefers-reduced-motion: reduce) {
  /* Remove mobile-specific animations and transitions */
  .nav-menu {
    -webkit-transform: translateX(0) !important;
    -moz-transform: translateX(0) !important;
    -ms-transform: translateX(0) !important;
    transform: translateX(0) !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    transition: none !important;
  }
  
  .nav-menu.active {
    -webkit-transform: translateX(0) !important;
    -moz-transform: translateX(0) !important;
    -ms-transform: translateX(0) !important;
    transform: translateX(0) !important;
  }
  
  .mobile-menu-btn span {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    transition: none !important;
  }
  
  .mobile-menu-btn.active span:nth-child(1),
  .mobile-menu-btn.active span:nth-child(3) {
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
  }
  
  .dropdown-content {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    transition: none !important;
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  /* Remove touch feedback animations */
  button:active,
  a:active,
  .btn:active,
  .cta-button:active,
  .card-button:active,
  .nav-link:active {
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  
  /* Remove card hover effects */
  .course-card:active,
  .feature-item:active,
  .demographic-card:active {
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .navbar,
  .mobile-menu-btn,
  .cta-button,
  .card-button,
  #background-canvas {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .section,
  .course-card,
  .feature-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ========================================
   ADDITIONAL TOUCH TARGET OPTIMIZATIONS
   ======================================== */

/* Ensure social media links have proper touch targets */
.social-links a,
.social-link,
.whatsapp-sticky-button {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

/* Footer links with proper spacing */
.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0;
}

/* Plan selection buttons */
.plan-button {
  width: 100%;
  min-height: 44px;
  padding: 0.875rem 1.5rem;
  margin-top: 8px;
}

/* Tab navigation with proper spacing */
.tab-wrapper {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-button {
  margin: 4px;
  min-height: 44px;
}

/* Carousel controls */
.carousel-arrow,
.certificate-arrow {
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal close buttons */
.auth-modal-close,
.feedback-close {
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem;
}

/* Login button in navigation */
.login-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1.25rem;
}

/* View more buttons */
.view-more-container {
  margin-top: 1rem;
  padding-top: 8px;
}

.view-more-button {
  min-height: 44px;
  padding: 0.875rem 2rem;
}

/* Card buttons container spacing */
.card-button-container {
  margin-top: 1rem;
  padding-top: 8px;
}

/* Ensure proper spacing in button groups */
.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button-group > * {
  min-height: 44px;
  min-width: 44px;
}

/* Password toggle button */
.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem;
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* 
 * COLOR CONTRAST COMPLIANCE
 * All text colors meet WCAG 2.1 Level AA standards (4.5:1 minimum)
 * Validated against #000002 background
 * See docs/ACCESSIBILITY-CONTRAST.md for full report
 */

/* Ensure text colors maintain proper contrast */
body,
p,
.body-text,
.text-secondary {
  color: var(--text-secondary); /* 14.13:1 contrast ratio */
}

h1, h2, h3, h4, h5, h6,
.heading-primary,
.heading-secondary,
.heading-tertiary,
.text-primary {
  color: var(--text-primary); /* 20.05:1 contrast ratio */
}

.text-muted,
.body-small,
.text-small {
  color: var(--text-muted); /* 8.18:1 contrast ratio */
}

/* Ensure sufficient contrast for links */
a {
  color: var(--text-secondary);
  text-decoration-color: rgba(168, 85, 247, 0.5);
}

a:hover,
a:focus {
  color: var(--text-primary);
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid rgba(168, 85, 247, 0.8);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: rgba(168, 85, 247, 0.95);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 10001;
  transition: top 0.3s ease;
}

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

/* Screen reader only content */
.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;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-center-mobile {
  text-align: center;
}

@media (min-width: 768px) {
  .text-center-mobile {
    text-align: left;
  }
}

.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: block;
  }
}

.show-mobile {
  display: block;
}

@media (min-width: 768px) {
  .show-mobile {
    display: none;
  }
}

/* Responsive spacing utilities */
.p-mobile-sm {
  padding: 1rem;
}

.p-mobile-md {
  padding: 1.5rem;
}

.p-mobile-lg {
  padding: 2rem;
}

@media (min-width: 768px) {
  .p-mobile-sm {
    padding: 1.5rem;
  }
  
  .p-mobile-md {
    padding: 2rem;
  }
  
  .p-mobile-lg {
    padding: 3rem;
  }
}

/* ========================================
   EXTRA SMALL MOBILE (320px and below)
   Fix horizontal scroll issues
   ======================================== */

@media (max-width: 320px) {
  /* Ensure no element causes horizontal scroll on iPhone SE */
  .search-box {
    min-width: 280px;
    max-width: 100%;
  }
  
  .girls-features-grid > * {
    min-width: 280px;
    max-width: 100%;
  }
  
  .features-grid > *,
  .inclusivity-chart > * {
    min-width: 280px;
    max-width: 100%;
  }
  
  /* Ensure containers don't exceed viewport */
  .container {
    max-width: 100%;
    padding: 0 0.75rem;
  }
  
  /* Reduce tab button min-width for very small screens */
  .tab-button {
    min-width: 100px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
  
  /* Ensure course cards fit */
  .course-card {
    min-width: 280px;
    max-width: 100%;
  }
  
  /* Reduce logo size if needed */
  .logo-img {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    min-width: 32px;
    min-height: 32px;
  }
}  /* Fi
x empowerment circle for very small screens */
  .empowerment-circle {
    width: 280px;
    height: 280px;
    max-width: 90vw;
    max-height: 90vw;
  }
}