/* ===================================
   Modern Minimal Responsive Styles
   Mobile-first approach with generous spacing
   =================================== */

/* ===================================
   Tablet: 768px ~ 1023px
   =================================== */

@media (max-width: 1023px) {
  :root {
    --space-20: 3rem;
    --space-32: 4rem;
  }

  .container {
    padding: 0 var(--space-4);
  }

  /* Typography adjustments */
  .section-title {
    font-size: var(--text-4xl);
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

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

  /* Timeline - Stack on tablet */
  .timeline-item {
    flex-direction: column;
    gap: var(--space-4);
  }

  .timeline-item::before {
    display: none;
  }

  .timeline-time {
    width: 100%;
  }

  /* Form - Single column */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Booking page */
  .booking-card {
    padding: var(--space-8);
  }

  .slot-selection {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  /* Instructor detail modal */
  .instructor-detail {
    grid-template-columns: 1fr;
  }

  .instructor-detail-photo {
    max-width: 400px;
    margin: 0 auto;
  }

  /* Swiper - Tablet optimized */
  .instructors-swiper-button-prev,
  .instructors-swiper-button-next {
    width: 44px;
    height: 44px;
  }

  .instructors-swiper-button-prev::after,
  .instructors-swiper-button-next::after {
    font-size: 18px;
  }
}

/* ===================================
   Mobile: ~ 767px
   =================================== */

@media (max-width: 767px) {
  :root {
    --space-12: 2rem;
    --space-16: 2.5rem;
    --space-20: 2rem;
    --space-32: 3rem;
  }

  /* Typography - Scale down gracefully */
  html {
    font-size: 15px;
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .section-title::after {
    width: 60px;
    height: 3px;
    margin: var(--space-4) auto 0;
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  .hero-description {
    font-size: var(--text-base);
  }

  /* Layout - Tighter spacing */
  section {
    padding: var(--space-12) 0;
  }

  section.section-sm {
    padding: var(--space-8) 0;
  }

  section.section-lg {
    padding: var(--space-16) 0;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .section-header {
    margin-bottom: var(--space-10);
  }

  /* Grid - All single column */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-auto-fit,
  .grid-auto-fill {
    grid-template-columns: 1fr;
  }

  .grid {
    gap: var(--space-6);
  }

  /* Buttons - Full width on mobile */
  .btn {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
  }

  .btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .hero-cta .btn {
    width: 100%;
  }

  /* Hero adjustments */
  .hero-section,
  .hero {
    padding: var(--space-20) 0;
  }

  .hero-info {
    gap: var(--space-4);
  }

  .hero-info-item {
    font-size: var(--text-base);
    padding: var(--space-2) var(--space-4);
  }

  /* Cards - Smaller images */
  .card-image {
    height: 200px;
  }

  .instructor-photo {
    height: 280px;
  }

  .info-icon {
    width: 52px;
    height: 52px;
    font-size: var(--text-2xl);
  }

  /* Info Cards - Tighter spacing */
  .info-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .info-card {
    padding: var(--space-6);
  }

  /* Instructors grid */
  .instructors-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .instructor-info {
    padding: var(--space-6);
  }

  /* Swiper - Mobile optimized */
  .instructors-swiper-container {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    padding: 0 var(--space-4);
  }

  .instructors-swiper {
    padding: var(--space-2) 0 var(--space-12) 0;
  }

  .instructors-swiper-button-prev,
  .instructors-swiper-button-next {
    width: 40px;
    height: 40px;
  }

  .instructors-swiper-button-prev::after,
  .instructors-swiper-button-next::after {
    font-size: 16px;
  }

  .instructors-view-all {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
  }

  /* Timeline - Mobile optimized */
  .timeline-time {
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-4);
    width: 100%;
  }

  .timeline-content {
    padding: var(--space-5);
  }

  .timeline-title {
    font-size: var(--text-lg);
  }

  .timeline-description {
    font-size: var(--text-sm);
  }

  .timeline-item {
    margin-bottom: var(--space-8);
  }

  /* Notice section */
  .notice-card {
    padding: var(--space-6);
  }

  .notice-title {
    font-size: var(--text-2xl);
  }

  .notice-item {
    padding: var(--space-4) 0;
  }

  /* Feature cards */
  .overview-features {
    gap: var(--space-6);
  }

  .feature-card {
    padding: var(--space-6);
  }

  .feature-icon {
    font-size: var(--text-4xl);
  }

  .feature-title {
    font-size: var(--text-xl);
  }

  /* Timetable */
  .timetable-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .timeslot-card {
    padding: var(--space-5);
  }

  /* Reception section */
  .reception-info {
    gap: var(--space-4);
    flex-direction: column;
  }

  .reception-info-item {
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-5);
    width: 100%;
    justify-content: center;
  }

  /* CTA Section */
  .cta-title {
    font-size: var(--text-3xl);
  }

  .cta-description {
    font-size: var(--text-base);
  }

  /* Modal - Full screen on mobile */
  .modal {
    padding: var(--space-4);
  }

  .modal-content {
    max-width: 100%;
    border-radius: var(--radius-xl);
  }

  .modal-header,
  .modal-body {
    padding: var(--space-6);
  }

  .modal-footer {
    padding: var(--space-4) var(--space-6);
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .modal-title {
    font-size: var(--text-xl);
  }

  /* Instructor detail */
  .instructor-detail {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .instructor-detail-name {
    font-size: var(--text-3xl);
  }

  .instructor-detail-title {
    font-size: var(--text-lg);
  }

  /* Form elements */
  .form-group {
    margin-bottom: var(--space-5);
  }

  .form-label {
    font-size: var(--text-xs);
    margin-bottom: var(--space-2);
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: var(--space-3) var(--space-4);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  /* Slot selection - Stack on mobile */
  .slot-selection {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .slot-label {
    padding: var(--space-4);
  }

  /* Booking page */
  .booking-page {
    padding: var(--space-8) 0;
  }

  .booking-card {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }

  .booking-header {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
  }

  .booking-title {
    font-size: var(--text-2xl);
  }

  .booking-subtitle {
    font-size: var(--text-base);
  }

  .form-section {
    margin-bottom: var(--space-8);
  }

  .form-section-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-5);
  }

  .booking-summary {
    padding: var(--space-6);
  }

  .summary-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-5);
  }

  .summary-item {
    flex-direction: column;
    gap: var(--space-1);
    align-items: flex-start;
    padding: var(--space-3) 0;
  }

  .summary-item:last-child {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-lg);
    padding-top: var(--space-5);
  }

  /* Confirmation page */
  .confirmation-page {
    padding: var(--space-6);
  }

  .confirmation-card {
    padding: var(--space-10);
  }

  .confirmation-icon {
    width: 80px;
    height: 80px;
    font-size: var(--text-4xl);
    margin-bottom: var(--space-6);
  }

  .confirmation-title {
    font-size: var(--text-2xl);
  }

  .confirmation-message {
    font-size: var(--text-base);
    margin-bottom: var(--space-8);
  }

  .confirmation-details {
    padding: var(--space-6);
  }

  .detail-item {
    flex-direction: column;
    gap: var(--space-1);
    align-items: flex-start;
    padding: var(--space-3) 0;
  }

  /* Utilities */
  .text-center-mobile {
    text-align: center;
  }

  .flex-col-mobile {
    flex-direction: column;
  }

  .gap-2-mobile {
    gap: var(--space-2);
  }
}

/* ===================================
   Navigation Responsive
   =================================== */

@media (max-width: 767px) {
  /* Sticky nav adjustments */
  .nav-wrapper {
    padding: var(--space-3) 0;
  }

  .nav-brand a {
    font-size: var(--text-lg);
  }

  /* Hamburger Menu */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-2xl);
    transition: right var(--transition-normal);
    z-index: calc(var(--z-sticky) + 2);
    padding: var(--space-8) var(--space-6);
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-8);
  }

  .nav-link {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
    width: 100%;
  }

  /* Mobile nav overlay */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: calc(var(--z-sticky) + 1);
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* ===================================
   Large Desktop: 1024px and up
   =================================== */

@media (min-width: 1024px) {
  .hero-title {
    font-size: var(--text-6xl);
  }

  .section-title {
    font-size: var(--text-5xl);
  }

  .container {
    padding: 0 var(--space-8);
  }

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

  /* Larger spacing on big screens */
  section {
    padding: var(--space-24) 0;
  }

  .section-header {
    margin-bottom: var(--space-20);
  }

  /* Navigation */
  .nav-link {
    padding: var(--space-3) var(--space-6);
  }
}

/* ===================================
   Extra Large Desktop: 1440px and up
   =================================== */

@media (min-width: 1440px) {
  .hero-title {
    font-size: 4.5rem;
  }

  .container {
    padding: 0 var(--space-12);
  }
}

/* ===================================
   Print Styles
   =================================== */

@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  a,
  a:visited {
    text-decoration: underline;
    color: #000;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  /* Hide navigation and interactive elements */
  .no-print,
  .nav-toggle,
  .site-nav,
  .modal-overlay,
  .modal,
  .btn,
  button {
    display: none !important;
  }

  /* Optimize page breaks */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  img {
    page-break-inside: avoid;
    max-width: 100% !important;
  }

  p,
  blockquote {
    orphans: 3;
    widows: 3;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  /* Print-specific layout */
  section {
    padding: 1rem 0;
  }

  .hero-section,
  .hero {
    background: none !important;
    color: black !important;
    padding: 1rem 0;
  }

  .hero-title,
  .section-title {
    color: black !important;
  }
}

/* ===================================
   Reduced Motion
   =================================== */

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

  .animate-fade-in,
  .animate-fade-in-delay-1,
  .animate-fade-in-delay-2 {
    animation: none !important;
  }
}

/* ===================================
   Dark Mode Support (Optional)
   =================================== */

@media (prefers-color-scheme: dark) {
  /* Currently not implemented, but prepared for future */
  /* Add dark mode styles here if needed */
}
