/* ==========================================================================
   STUDIO BRANDBOOK SPECIFIC STYLESHEET (brandbook.css)
   ========================================================================== */

.brandbook-wrapper {
    max-width: 1440px;
    margin: 30px auto 80px auto;
    padding: 0 25px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 35px;
    align-items: start;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .brandbook-wrapper {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
}

/* --- BRANDBOOK SIDEBAR NAVIGATION --- */
.brandbook-sidebar {
    position: sticky;
    top: 20px;
    background: var(--studio-card-bg, #ffffff);
    border: 1px solid var(--studio-border, #e2e8f0);
    border-radius: var(--studio-radius-md, 10px);
    padding: 20px;
    box-shadow: var(--studio-shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-sizing: border-box;
}

.brandbook-sidebar-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--studio-muted, #64748b);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brandbook-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brandbook-nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--studio-radius-sm, 6px);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--studio-dark, #0f172a);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.brandbook-nav-item a:hover {
    background: var(--studio-bg, #f8fafc);
    color: var(--studio-org-primary, #0070f3);
    transform: translateX(3px);
}

.brandbook-nav-item.active a {
    background: rgba(0, 112, 243, 0.1);
    color: var(--studio-org-primary, #0070f3);
    font-weight: 700;
}

.brandbook-nav-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--studio-muted, #64748b);
    margin: 16px 0 6px 10px;
    letter-spacing: 0.5px;
}

/* --- SECTION & HEADINGS --- */
.brandbook-section {
    scroll-margin-top: 30px;
    margin-bottom: 50px;
}

.brandbook-section-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--studio-dark, #0f172a);
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.brandbook-section-desc {
    font-size: 15px;
    color: var(--studio-muted, #64748b);
    line-height: 1.6;
    margin: 0 0 25px 0;
}

/* --- SHOWCASE CARD (LIVE PREVIEW + CODE) --- */
.showcase-block {
    background: var(--studio-card-bg, #ffffff);
    border: 1px solid var(--studio-border, #e2e8f0);
    border-radius: var(--studio-radius-md, 10px);
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: var(--studio-shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.showcase-block:hover {
    border-color: rgba(0, 112, 243, 0.4);
    box-shadow: var(--studio-shadow-md, 0 4px 6px -1px rgba(0,0,0,0.08));
}

.showcase-header {
    padding: 16px 20px;
    background: var(--studio-bg, #f8fafc);
    border-bottom: 1px solid var(--studio-border, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.showcase-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--studio-dark, #0f172a);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.showcase-classes {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    background: var(--studio-card-bg, #ffffff);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--studio-border, #e2e8f0);
    color: var(--studio-org-primary, #0070f3);
    font-weight: 600;
}

.showcase-live {
    padding: 24px;
    background: var(--studio-card-bg, #ffffff);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.showcase-code-wrapper {
    position: relative;
    border-top: 1px solid var(--studio-border, #e2e8f0);
    background: #0f172a;
    color: #f8fafc;
}

.showcase-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #94a3b8;
}

.copy-btn {
    background: #334155;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background: var(--studio-org-primary, #0070f3);
    border-color: var(--studio-org-primary, #0070f3);
    color: #ffffff;
}

.copy-btn.copied {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.showcase-code {
    margin: 0;
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    color: #e2e8f0;
}

/* --- DIRECTORY TREE & TABLE STYLES --- */
.dir-tree-box {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--studio-radius-md, 10px);
    padding: 20px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid #334155;
    margin-bottom: 25px;
}

.dir-tree-box .folder {
    color: #38bdf8;
    font-weight: bold;
}

.dir-tree-box .file {
    color: #a7f3d0;
}

.dir-tree-box .comment {
    color: #64748b;
    font-style: italic;
}

/* --- THEME SIMULATOR BAR --- */
.theme-simulator-bar {
    background: var(--studio-card-bg, #ffffff);
    border: 1px solid var(--studio-border, #e2e8f0);
    border-radius: var(--studio-radius-md, 10px);
    padding: 16px 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: var(--studio-shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.theme-pill-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.theme-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid var(--studio-border, #e2e8f0);
    background: var(--studio-bg, #f8fafc);
    color: var(--studio-dark, #0f172a);
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-pill:hover, .theme-pill.active {
    border-color: var(--studio-org-primary, #0070f3);
    background: var(--studio-org-primary, #0070f3);
    color: #ffffff;
    transform: translateY(-1px);
}

/* --- STEP WIZARD BOXES --- */
.guide-step-card {
    background: var(--studio-card-bg, #ffffff);
    border: 1px solid var(--studio-border, #e2e8f0);
    border-left: 5px solid var(--studio-org-primary, #0070f3);
    border-radius: var(--studio-radius-md, 10px);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--studio-shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.guide-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--studio-org-primary, #0070f3);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    margin-right: 10px;
}

.guide-step-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--studio-dark, #0f172a);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
}

/* --- TOKEN TABLE --- */
.token-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--studio-card-bg, #ffffff);
    border: 1px solid var(--studio-border, #e2e8f0);
    border-radius: var(--studio-radius-md, 10px);
    overflow: hidden;
    font-size: 13px;
    margin-bottom: 25px;
}

.token-table th {
    background: var(--studio-bg, #f8fafc);
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--studio-dark, #0f172a);
    border-bottom: 1px solid var(--studio-border, #e2e8f0);
}

.token-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--studio-border, #e2e8f0);
    color: var(--studio-dark, #0f172a);
    vertical-align: top;
}

.token-table tr:last-child td {
    border-bottom: none;
}

.token-table code {
    background: var(--studio-bg, #f8fafc);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--studio-org-primary, #0070f3);
    border: 1px solid var(--studio-border, #e2e8f0);
}

.color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.15);
    vertical-align: middle;
    margin-right: 6px;
}
