﻿/* ==================== RESPONSIVE STYLES ==================== */
/* Mobile-First, Tablet, and Desktop Optimization */

/* ===== MOBILE FIRST (320px and up) ===== */

/* Header Mobile Optimization */
.nav-links {
  display: none;
}

.nav-buttons {
  display: none;
}

.mobile-menu-btn {
  display: block;
}

/* Hero Mobile */
.hero {
  padding: var(--space-12) 0;
}

.hero h1 {
  font-size: var(--font-size-3xl);
}

.hero p {
  font-size: var(--font-size-base);
}

.hero-buttons {
  flex-direction: column;
  gap: var(--space-3);
}

.hero-buttons .btn {
  width: 100%;
}

.trust-points {
  grid-template-columns: 1fr;
}

/* Grid Mobile */
.grid-2,
.grid-3,
.grid-4 {
  grid-template-columns: 1fr;
}

/* Section Mobile */
section {
  padding: var(--space-10) 0;
}

.section-header {
  margin-bottom: var(--space-10);
}

.section-header h2 {
  font-size: var(--font-size-2xl);
}

/* Course Card Mobile */
.course-card {
  padding: var(--space-4);
}

.course-actions {
  grid-template-columns: 1fr;
}

/* Form Mobile */
.modal-content {
  max-width: 95%;
}

.modal-footer {
  flex-direction: column;
}

.modal-footer .btn {
  width: 100%;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: var(--space-3) var(--space-3);
  font-size: 16px; /* Prevent zoom on iOS */
}

/* Footer Mobile */
.footer-content {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.footer-section {
  text-align: center;
}

.footer-links {
  text-align: center;
}

/* Testimonials Mobile */
.testimonial-slider-controls {
  gap: var(--space-3);
}

.slider-btn {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

/* FAQ Mobile */
.faq-header {
  padding: var(--space-3);
  font-size: var(--font-size-base);
}

/* Subject years column on mobile */
.subject-year ul {
  column-count: 1;
}

/* Step Mobile */
.step {
  align-items: flex-start;
}

.step-number {
  width: 50px;
  height: 50px;
  font-size: var(--font-size-lg);
  min-width: 50px;
}

/* Floating CTA Mobile */
.floating-cta {
  bottom: var(--space-2);
  right: var(--space-2);
  left: var(--space-2);
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
}

.floating-cta .btn {
  flex: 1;
  min-width: 150px;
}

/* Sticky header adjustment for mobile */
header.sticky {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.navbar {
  padding: var(--space-2) 0;
}

/* ===== TABLET (768px and up) ===== */
@media (min-width: 768px) {
  /* Header Tablet */
  .nav-links {
    display: flex;
  }

  .mobile-menu-btn {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }

  /* Hero Tablet */
  .hero {
    padding: var(--space-16) 0;
  }

  .hero h1 {
    font-size: var(--font-size-4xl);
  }

  .hero p {
    font-size: var(--font-size-lg);
  }

  .hero-buttons {
    flex-direction: row;
    gap: var(--space-4);
  }

  .hero-buttons .btn {
    width: auto;
  }

  .trust-points {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Grid Tablet */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: 2fr 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Course Card Tablet */
  .course-card {
    padding: var(--space-5);
  }

  .course-actions {
    grid-template-columns: 1fr 1fr;
  }

  /* Form Tablet */
  .modal-content {
    max-width: 500px;
  }

  .modal-footer {
    flex-direction: row;
  }

  .modal-footer .btn {
    width: auto;
  }

  /* Footer Tablet */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .footer-section {
    text-align: left;
  }

  .footer-links {
    text-align: left;
  }

  /* Feature Cards Tablet */
  .feature-card {
    padding: var(--space-6);
  }

  /* Testimonials Tablet */
  .testimonial-slider-controls {
    gap: var(--space-4);
  }

  /* Subject years column on tablet */
  .subject-year ul {
    column-count: 2;
  }

  /* Step Tablet */
  .step {
    align-items: center;
  }

  /* Floating CTA Tablet */
  .floating-cta {
    flex-direction: column;
    bottom: var(--space-6);
    right: var(--space-6);
    left: auto;
  }

  .floating-cta .btn {
    flex: none;
    min-width: auto;
  }
}

/* ===== DESKTOP (1024px and up) ===== */
@media (min-width: 1024px) {
  /* Header Desktop */
  .nav-buttons {
    display: flex;
  }

  /* Hero Desktop */
  .hero {
    padding: var(--space-20) 0;
  }

  .hero h1 {
    font-size: var(--font-size-5xl);
  }

  .trust-points {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Grid Desktop */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Course Grid Desktop */
  .grid-courses {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Footer Desktop */
  .footer-content {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
  }

  /* Subject years 2 column on desktop */
  .subject-year ul {
    column-count: 2;
  }

  /* Testimonials Desktop */
  .testimonial-slider {
    max-width: 800px;
    margin: 0 auto;
  }
}

/* ===== LARGE DESKTOP (1440px and up) ===== */
@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  .container-small {
    max-width: 1000px;
  }

  .grid-courses {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero h1 {
    font-size: var(--font-size-5xl);
  }

  section {
    padding: var(--space-20) 0;
  }

  /* Large Feature Cards */
  .feature-card {
    padding: var(--space-8);
  }
}

/* ===== LANDSCAPE MOBILE (568px and up height) ===== */
@media (min-height: 568px) {
  body {
    min-height: 100vh;
  }
}

/* ===== HIGH DPI SCREENS ===== */
@media (min-resolution: 2dppx) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  header,
  footer,
  .floating-cta,
  .modal,
  #scrollToTopBtn {
    display: none !important;
  }

  body {
    background-color: white;
  }

  .container {
    max-width: 100%;
  }

  .course-card {
    page-break-inside: avoid;
  }

  a {
    color: var(--primary);
    text-decoration: underline;
  }
}

/* ===== ACCESSIBILITY - FOCUS VISIBLE ===== */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Remove outline for mouse users (not keyboard) */
.js *:focus:not(:focus-visible) {
  outline: none;
}

/* ===== DARK MODE SUPPORT (Optional) ===== */
@media (prefers-color-scheme: dark) {
  /* Uncomment if implementing dark mode
  :root {
    --bg-light: #1e293b;
    --bg-light-secondary: #334155;
    --text-dark: #f1f5f9;
    --text-light: #cbd5e1;
    --border-light: #475569;
  }

  .card {
    background-color: #334155;
    border-color: #475569;
  }

  .modal-content {
    background-color: #1e293b;
  }
  */
}

/* ===== TOUCH DEVICE OPTIMIZATION ===== */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .card:hover {
    transform: none;
  }

  .course-card:hover {
    transform: none;
  }

  .feature-card:hover {
    transform: none;
  }

  .nav-link {
    padding: var(--space-4) var(--space-3);
  }
}

/* ===== SPECIFIC RESPONSIVE BREAKPOINTS ===== */

/* 375px phones (iPhone) */
@media (max-width: 374px) {
  .hero h1 {
    font-size: var(--font-size-2xl);
  }

  .section-header h2 {
    font-size: var(--font-size-xl);
  }

  .course-actions {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
  }

  .navbar {
    padding: var(--space-2) 0;
  }

  .logo {
    font-size: var(--font-size-base);
  }

  h1 {
    font-size: var(--font-size-2xl);
  }

  h2 {
    font-size: var(--font-size-xl);
  }

  h3 {
    font-size: var(--font-size-lg);
  }
}

/* 425px phones */
@media (max-width: 425px) {
  .course-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-content {
    max-width: 90%;
    max-height: 95vh;
  }
}

/* 600px tablets */
@media (min-width: 600px) and (max-width: 767px) {
  .grid-2,
  .grid-3,
  .grid-courses {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-points {
    grid-template-columns: repeat(2, 1fr);
  }

  .course-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Between tablet and desktop */
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-courses {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }

  .course-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1920px screens and above */
@media (min-width: 1920px) {
  .container {
    max-width: 1400px;
  }

  .hero {
    padding: var(--space-24) 0;
  }

  .hero h1 {
    font-size: clamp(3rem, 5vw, 4rem);
  }

  .section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  .grid-courses {
    grid-template-columns: repeat(5, 1fr);
  }

  .subject-year ul {
    column-count: 3;
  }
}

/* ===== ORIENTATION-SPECIFIC ===== */
@media (orientation: landscape) and (max-height: 600px) {
  section {
    padding: var(--space-8) 0;
  }

  .hero {
    padding: var(--space-6) 0;
  }

  .hero h1 {
    font-size: var(--font-size-2xl);
  }

  .navbar {
    padding: var(--space-2) 0;
  }
}

@media (orientation: portrait) {
  .mobile-menu {
    width: 100%;
  }
}

/* ===== RESPONSIVE IMAGES & MEDIA ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

video,
iframe {
  max-width: 100%;
  height: auto;
}

/* ===== CONTAINER QUERIES SIMULATION ===== */
/* Use data attributes for container-based styling */
[data-container-size="sm"] {
  grid-template-columns: 1fr;
}

[data-container-size="md"] {
  grid-template-columns: repeat(2, 1fr);
}

[data-container-size="lg"] {
  grid-template-columns: repeat(3, 1fr);
}

/* ===== SCROLLBAR CUSTOMIZATION ===== */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Firefox Scrollbar */
* {
  scrollbar-color: var(--primary-light) var(--bg-light-secondary);
  scrollbar-width: thin;
}

/* ===== TRANSITIONS FOR SMOOTH RESPONSIVENESS ===== */
@media (prefers-reduced-motion: no-preference) {
  * {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  }
}

/* ===== FINAL MEDIA QUERY ADJUSTMENTS ===== */
/* Ensure proper stacking on all devices */
@media (max-width: 1199px) {
  .navbar {
    flex-wrap: wrap;
  }

  .nav-buttons {
    gap: var(--space-2);
  }

  .nav-buttons .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
  }
}

/* Additional micro-breakpoint adjustments */
@media (max-width: 480px) {
  .hero-buttons {
    gap: var(--space-2);
  }

  .trust-points {
    gap: var(--space-4);
  }

  .course-card {
    margin: 0;
  }
}

/* Ensure modal works on all screen sizes */
@media (max-height: 600px) {
  .modal-content {
    max-height: 95vh;
    border-radius: var(--radius-lg);
  }

  .modal-body {
    padding: var(--space-4);
  }
}

/* ===== REDUCED MOTION ADJUSTMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  .btn:hover {
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  .course-card:hover {
    transform: none;
  }

  .feature-card:hover {
    transform: none;
  }

  #scrollToTopBtn:hover {
    transform: none;
  }

  .fade-up {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 768px) {
  .whatsapp-float {
    right: 16px;
    bottom: 90px;
    width: 52px;
    height: 52px;
  }
}
