/* ==========================================
   MediaSqueezer Guide Page Styles
   Extends style.css tokens
   ========================================== */

/* ── Guide Layout ── */
.guide-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 48px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 100px 24px 80px;
    min-height: 100vh;
}

/* ── Sidebar ── */
.guide-sidebar {
    position: sticky;
    top: 88px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 8px;
}

.guide-sidebar::-webkit-scrollbar {
    width: 3px;
}

.guide-sidebar::-webkit-scrollbar-thumb {
    background: rgba(59, 102, 245, 0.2);
    border-radius: 4px;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    line-height: 1.4;
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    background: #f0f1f5;
}

.sidebar-nav a.active {
    color: var(--primary);
    background: rgba(59, 102, 245, 0.08);
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

/* ── Mobile Sidebar Toggle ── */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(59, 102, 245, 0.4);
    transition: all var(--duration) var(--ease);
}

.sidebar-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(59, 102, 245, 0.5);
}

/* ── Guide Content ── */
.guide-content {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.guide-hero {
    margin-bottom: 56px;
}

.guide-hero h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 12px;
}

.guide-hero p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ── Guide Section ── */
.guide-section {
    margin-bottom: 64px;
    scroll-margin-top: 88px;
}

.guide-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(59, 102, 245, 0.1);
}

.guide-section-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.guide-section-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.guide-section-header .section-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(59, 102, 245, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Glass Card ── */
.glass-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: var(--card-radius);
    padding: 28px;
    margin-bottom: 20px;
    transition: all var(--duration-slow) var(--ease);
}

.glass-card:hover {
    background: #f8f9fb;
    border-color: #d1d5db;
}

.glass-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.glass-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 22px 0 8px;
    padding: 6px 0;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(59, 102, 245, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
}

.glass-card h4:first-of-type {
    margin-top: 4px;
}

.glass-card h3 .card-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(59, 102, 245, 0.08);
    color: var(--primary);
}

/* ── Steps ── */
.steps {
    counter-reset: step;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding-left: 40px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}


.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Info Boxes ── */
.info-box {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.7;
    margin: 16px 0;
}

.info-box.tip {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #166534;
}

.info-box.warning {
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
    color: #854d0e;
}

.info-box.require {
    background: rgba(59, 102, 245, 0.06);
    border: 1px solid rgba(59, 102, 245, 0.15);
    color: var(--primary);
}

.info-box .info-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Tags (inline) ── */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 0;
    list-style: none;
}

.tag-list li {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    background: #f0f1f5;
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

/* ── Options Table ── */
.options-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    margin: 12px 0;
}

.options-table th {
    text-align: left;
    padding: 10px 14px;
    background: rgba(59, 102, 245, 0.06);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.options-table th:first-child {
    border-radius: 10px 0 0 0;
}

.options-table th:last-child {
    border-radius: 0 10px 0 0;
}

.options-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    line-height: 1.6;
}

.options-table tr:last-child td {
    border-bottom: none;
}

.options-table tr:hover td {
    background: #f8f9fb;
}

.options-table code {
    font-size: 12px;
    background: rgba(59, 102, 245, 0.06);
    padding: 2px 7px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    color: var(--primary);
    overflow-wrap: break-word;
    word-break: break-all;
}

/* ── FAQ Section ── */
.guide-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide-faq-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--duration-slow) var(--ease);
}

.guide-faq-item:hover {
    border-color: #d1d5db;
}

.guide-faq-item.open {
    border-color: #d1d5db;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.guide-faq-q {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 18px 22px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--duration) var(--ease);
}

.guide-faq-q:hover {
    color: var(--primary);
}

.guide-faq-q .q-chevron {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform var(--duration-slow) var(--ease);
    color: var(--text-secondary);
}

.guide-faq-item.open .q-chevron {
    transform: rotate(180deg);
}

.guide-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease);
}

.guide-faq-item.open .guide-faq-a {
    max-height: 500px;
}

.guide-faq-a p {
    padding: 0 22px 18px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ── Back to Top ── */
.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: #f0f1f5;
    border: 1px solid #e5e7eb;
    transition: all var(--duration) var(--ease);
}

.back-to-top:hover {
    color: var(--primary);
    background: #f8f9fb;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .guide-layout {
        grid-template-columns: 1fr;
        padding: 80px 16px 60px;
        gap: 0;
    }

    .guide-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 998;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        padding: 88px 16px 24px;
        transition: left 0.35s var(--ease);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.08);
        overflow-y: auto;
    }

    .guide-sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 997;
        background: rgba(0, 0, 0, 0.2);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .guide-hero {
        margin-bottom: 40px;
    }

    .guide-hero h1 {
        font-size: 24px;
    }

    .guide-hero p {
        font-size: 14px;
    }

    .guide-section {
        margin-bottom: 48px;
    }

    .guide-section-header {
        gap: 10px;
        margin-bottom: 18px;
        padding-bottom: 12px;
    }

    .guide-section-icon {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    .guide-layout {
        padding: 72px 10px 48px;
    }

    .guide-sidebar {
        width: 260px;
    }

    .guide-section-header {
        flex-wrap: wrap;
    }

    .guide-section-header .section-num {
        margin-left: 0;
    }

    .guide-section-header h2 {
        font-size: 17px;
        line-height: 1.4;
    }

    .guide-hero h1 {
        font-size: 21px;
    }

    .guide-hero p {
        font-size: 13px;
    }

    /* Glass card mobile */
    .glass-card {
        padding: 16px;
        border-radius: 14px;
    }

    .glass-card h3 {
        font-size: 15px;
        gap: 6px;
    }

    .glass-card h4 {
        font-size: 13px;
        margin: 18px 0 6px;
    }

    /* Steps - mobile sizing */
    .steps {
        gap: 12px;
    }

    .steps li {
        padding-left: 34px;
        font-size: 13px;
        line-height: 1.7;
    }

    .steps li::before {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .steps li code {
        word-break: break-all;
        font-size: 11px;
    }

    .steps li a {
        word-break: break-all;
    }

    /* Info box mobile */
    .info-box {
        padding: 12px 14px;
        font-size: 12px;
        gap: 8px;
    }

    .info-box code {
        font-size: 11px;
        word-break: break-all;
    }

    /* Table mobile */
    .options-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .options-table th,
    .options-table td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    /* FAQ mobile */
    .guide-faq-q {
        font-size: 13px;
        padding: 14px 16px;
        gap: 10px;
    }

    .guide-faq-a p {
        padding: 0 16px 14px;
        font-size: 13px;
        line-height: 1.7;
    }

    /* Tag list mobile */
    .tag-list li {
        font-size: 10px;
        padding: 3px 9px;
    }

    /* Back to top */
    .back-to-top {
        width: 100%;
        justify-content: center;
        margin-top: 32px;
    }
}