/* ============================================
   RESPONSIVE - Media Queries
   ============================================ */

/* ---- Large Screens (> 1400px) ---- */
@media (min-width: 1400px) {
    .page-content {
        max-width: 1000px;
    }
}

/* ---- Medium Screens (< 1024px) ---- */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }

    .page-content {
        padding: 1.5rem 2rem 2.5rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .comparison {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* ---- Tablet & Mobile (< 768px) ---- */
@media (max-width: 768px) {
    /* Show sidebar toggle */
    #sidebar-toggle {
        display: flex;
    }

    /* Sidebar becomes slide-out */
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    #main-content {
        margin-left: 0;
    }

    .page-content {
        padding: 1.25rem 1.25rem 2rem;
    }

    .breadcrumb {
        padding: 0.75rem 1.25rem;
    }

    .page-footer {
        padding: 1.5rem 1.25rem;
    }

    /* Header adjustments */
    .header-center {
        margin: 0 0.75rem;
    }

    .search-kbd {
        display: none;
    }

    #search-input {
        padding-right: 1rem;
    }

    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.35rem; margin-top: 2rem; }
    h3 { font-size: 1.15rem; }

    /* Hero */
    .hero-section {
        padding: 1.75rem 1.25rem;
    }

    /* Cards */
    .card-grid {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Page Navigation */
    .page-nav {
        flex-direction: column;
    }

    .page-nav-btn {
        max-width: 100%;
    }

    .page-nav-btn.next {
        text-align: left;
    }

    /* Flow diagram */
    .flow-diagram {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    /* Comparison */
    .comparison {
        grid-template-columns: 1fr;
    }

    /* Tabs */
    .tabs-header {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Table responsive */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Back to top */
    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 38px;
        height: 38px;
    }
}

/* ---- Small Mobile (< 480px) ---- */
@media (max-width: 480px) {
    .page-content {
        padding: 1rem 1rem 2rem;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }

    .hero-section {
        padding: 1.5rem 1rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-badges {
        gap: 0.35rem;
    }

    .hero-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.15rem;
    }

    .code-block pre code {
        font-size: 0.75rem !important;
    }

    .logo-text {
        font-size: 1rem;
    }
}

/* ---- Print Styles ---- */
@media print {
    #app-header,
    #sidebar,
    .sidebar-overlay,
    .back-to-top,
    .page-nav,
    .code-copy-btn {
        display: none !important;
    }

    #main-content {
        margin-left: 0 !important;
    }

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

    body {
        color: #000;
        background: #fff;
    }

    .card, .code-block, .alert, .concept-def {
        break-inside: avoid;
    }
}
