/* ===== ENHANCED RESPONSIVE DESIGN ===== */

html,
body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
}

body {
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}


/* Small tablets and large phones */
@media (max-width: 900px) {

    /* Reduce padding on sections */
    div[style*="padding:100px"] {
        padding: 50px 15px !important;
    }

    div[style*="padding:80px"] {
        padding: 40px 15px !important;
    }

    .hero-badges {
        gap: 10px !important;
    }

    .cyber-badge {
        padding: 8px 16px !important;
        border-radius: 12px !important;
    }

    .badge-icon {
        font-size: 18px !important;
    }

    .badge-text {
        font-size: 12px !important;
    }

    /* Reduce spacing */
    .hero-description {
        margin-bottom: 32px !important;
    }
}

/* Mobile landscape and tablets */
@media (max-width: 768px) {

    .nav-brand-group {
        gap: 0.75rem !important;
    }

    .site-logo-img {
        height: 55px !important;
        margin: -5px 0 !important;
    }

    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Typography */
    h1,
    .h1 {
        font-size: 1.875rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }

    h3 {
        font-size: 1.375rem !important;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1.5rem;
    }

    /* Stats grid - stack on mobile */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Feature cards */
    div[style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Course cards */
    div[style*="grid-template-columns: repeat(auto-fill, minmax(280px, 1fr))"],
    div[style*="grid-template-columns: repeat(auto-fill, minmax(360px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }


    /* Badges and pills */
    .cyber-badge {
        background: rgba(0, 217, 255, 0.05);
        border: 1px solid rgba(0, 217, 255, 0.2);
        padding: 12px 24px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        backdrop-filter: blur(10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .cyber-badge:hover {
        background: rgba(0, 217, 255, 0.1);
        border-color: var(--accent-primary);
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
    }

    .badge-icon {
        font-size: 24px;
    }

    .badge-text {
        font-size: 16px;
        font-weight: 700;
        color: var(--text-primary);
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    /* Badges and pills */
    div[style*="display: inline-flex"][style*="border-radius: 50px"] {
        font-size: 12px !important;
        padding: 10px 20px !important;
    }

    /* Modal */
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    /* Lesson modal */
    #lessonModal .modal-content {
        max-width: 95% !important;
    }
}

/* Mobile portrait */
@media (max-width: 520px) {

    /* Sections */
    div[style*="padding:100px"],
    div[style*="padding:80px"],
    div[style*="padding:70px"],
    div[style*="padding:60px"] {
        padding: 40px 16px !important;
    }

    /* Move Hero title higher on mobile */
    .hero {
        padding-top: 60px !important;
        padding-bottom: 40px !important;
        min-height: 60vh !important;
    }

    /* Typography */
    h1,
    .h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.375rem !important;
    }

    h3 {
        font-size: 1.125rem !important;
    }

    /* Clamp font sizes */
    div[style*="font-size: clamp"] {
        font-size: 1.5rem !important;
    }

    /* Buttons */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .btn.primary {
        padding: 0.75rem 1.5rem;
    }

    /* Cards */
    .card {
        padding: 1.25rem !important;
    }

    /* Icons */
    div[style*="width: 72px; height: 72px"] {
        width: 56px !important;
        height: 56px !important;
        font-size: 24px !important;
    }

    div[style*="width: 64px; height: 64px"] {
        width: 52px !important;
        height: 52px !important;
        font-size: 22px !important;
    }

    /* Stats numbers */
    div[style*="font-size: 48px"] {
        font-size: 36px !important;
    }

    /* Form inputs */
    .form-input {
        font-size: 16px !important;
        /* Prevents zoom on iOS */
        padding: 0.75rem !important;
    }

    /* Price */
    .price {
        font-size: 1.75rem !important;
    }

    .price-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .qty {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Actions */
    .actions .btn {
        width: 100% !important;
    }

    /* Dock */
    .dock-item {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.125rem !important;
    }

    /* Navbar */
    .nav-logo {
        font-size: 1.25rem !important;
    }

    /* Gaps and spacing */
    div[style*="gap: 32px"] {
        gap: 20px !important;
    }

    div[style*="gap: 28px"] {
        gap: 20px !important;
    }

    div[style*="gap: 24px"] {
        gap: 16px !important;
    }

    /* Margins */
    div[style*="margin-bottom: 4rem"] {
        margin-bottom: 2.5rem !important;
    }

    div[style*="margin-bottom: 3rem"] {
        margin-bottom: 2rem !important;
    }

    /* Padding */
    div[style*="padding: 32px"] {
        padding: 20px !important;
    }

    div[style*="padding: 28px"] {
        padding: 20px !important;
    }

    div[style*="padding: 24px"] {
        padding: 16px !important;
    }

    /* Target Hero Buttons specifically */
    .hero div[style*="display:flex"] a.btn {
        padding: 12px 24px !important;
        font-size: 15px !important;
    }

    /* Target Course Card footer links */
    .course-card div[style*="font-size: 15px"] {
        font-size: 13px !important;
        gap: 4px !important;
    }

    /* Target Hero Description */
    .hero p[style*="font-size:22px"] {
        font-size: 16px !important;
        line-height: 1.5 !important;
        margin-bottom: 32px !important;
    }

    /* Target Section Header Descriptions */
    div[style*="text-align: center"] p[style*="font-size: 18px"],
    div[style*="text-align: center"] p[style*="font-size:20px"] {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    /* Target Stats Numbers */
    div[style*="font-size: 48px"] {
        font-size: 32px !important;
    }

    /* Course Card Title and Description */
    .course-card h3 {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }

    .course-card p {
        font-size: 14px !important;
        line-height: 1.5 !important;
        min-height: auto !important;
        margin-bottom: 16px !important;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .container {
        padding: 0 0.75rem;
    }

    .card {
        padding: 1rem !important;
    }

    h1,
    .h1 {
        font-size: 1.375rem !important;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    div[style*="padding: 20px"] {
        padding: 16px !important;
    }
}

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-menu {
        padding: 3rem 2rem 2rem;
        overflow-y: auto;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }

    #lessonModal {
        padding: 0.5rem;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        /* iOS touch target */
    }

    .nav-link {
        padding: 0.75rem 0;
    }

    .lesson-chip {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 217, 255, 0.2);
    }
}

/* Print styles */
@media print {

    .navbar,
    .nav-toggle,
    .btn,
    #regModal,
    #lessonModal,
    .dock {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    * {
        background: transparent !important;
        color: black !important;
    }
}