/* =============================================
   Wally Academy – Responsive & Accessibility
   Mobile-first, breakpoints at 480, 768, 1024px
   ============================================= */

/* ── Accessibility Helpers ── */
.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;
}

/* Visible focus outline for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--wa-primary);
  outline-offset: 2px;
}

/* Remove animations for users who prefer 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;
  }
}

/* ── Auth pages ── */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px !important;
        margin: 20px auto;
        border-radius: 16px;
    }

    .auth-card h1 {
        font-size: 1.6rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .auth-form .form-group {
        margin-bottom: 15px;
    }

    .auth-form input,
    .auth-form select,
    .auth-form textarea {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .btn-auth {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .auth-logo img {
        height: 50px;
    }

    /* Country selector on mobile */
    .wa-custom-select .options-list {
        max-height: 180px;
        width: 100%;
    }
}

/* ── Dashboard ── */
@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 15px 0;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dash-nav {
        display: flex;
        gap: 0;
        flex-direction: row;
        padding: 0 10px;
    }

    .dash-nav li {
        flex-shrink: 0;
        padding: 10px 15px;
        border-right: none;
        white-space: nowrap;
    }

    .dash-nav li.active {
        border-bottom: 2px solid var(--wa-primary);
        border-right: none;
    }

    .user-avatar {
        display: none;
    }

    .dashboard-content {
        padding: 25px 15px;
    }

    .course-cards-grid {
        grid-template-columns: 1fr;
    }

    .installment-table {
        font-size: 0.8rem;
    }

    .notif-dropdown {
        width: 260px;
        right: -10px;
    }
}

/* ── Single Course & Training ── */
@media (max-width: 1024px) {
    .course-layout,
    .training-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .course-sidebar,
    .training-sidebar {
        position: static;
        order: -1;
    }

    .sticky-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .course-hero,
    .training-hero {
        padding: 60px 0 50px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-image img {
        max-width: 250px;
        margin-top: 20px;
    }

    .hero-content .meta {
        flex-direction: column;
        gap: 8px;
    }

    .countdown {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .countdown-item {
        padding: 10px 15px;
        min-width: 60px;
    }

    .countdown-item span {
        font-size: 1.5rem;
    }

    .card {
        padding: 20px;
    }

    .accordion-header h3 {
        font-size: 1rem;
    }

    .price-block {
        font-size: 2rem;
    }
}

/* ── Checkout ── */
@media (max-width: 600px) {
    .checkout-page .container {
        padding: 20px 15px;
    }

    .order-summary {
        padding: 20px;
    }

    .order-summary h2 {
        font-size: 1.4rem;
    }

    .payment-options label,
    .gateway-selection label {
        display: block;
        margin-bottom: 10px;
    }

    .coupon-input-row {
        flex-direction: column;
    }
}

/* ── Popup (Phase 12) ── */
@media (max-width: 480px) {
    .wa-popup-card {
        padding: 25px 20px;
    }

    .wa-popup-card h2 {
        font-size: 1.3rem;
    }
}

/* ── WhatsApp & Social Proof (Phase 12) ── */
@media (max-width: 480px) {
    .wa-whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .wa-social-toast-container {
        bottom: 80px;
        right: 10px;
    }

    .wa-social-toast {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
}

/* ── Legal pages & Blog ── */
@media (max-width: 600px) {
    .legal-page h1 {
        font-size: 1.8rem;
    }

    .legal-content {
        padding: 20px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* ── General helpers ── */
@media (max-width: 480px) {
    .btn-block {
        width: 100%;
        box-sizing: border-box;
    }
}