/* ═══════════════════════════════════════════════════════════
   Cookbook — Premium Dark Theme
   ═══════════════════════════════════════════════════════════ */

:root {
    --cb-bg: #0f172a;
    --cb-sidebar-bg: #1e293b;
    --cb-card-bg: #1e293b;
    --cb-text: #f1f5f9;
    --cb-text-muted: #94a3b8;
    --cb-accent: #3b82f6;
    --cb-border: #334155;
    --cb-code-bg: #1a1a1a;
}

body.light-theme {
    --cb-bg: #f8fafc;
    --cb-sidebar-bg: #ffffff;
    --cb-card-bg: #ffffff;
    --cb-text: #1e293b;
    --cb-text-muted: #64748b;
    --cb-accent: #2563eb;
    --cb-border: #e2e8f0;
    --cb-code-bg: #f1f5f9;
}

body {
    background: var(--cb-bg);
    color: var(--cb-text);
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: background 0.3s, color 0.3s;
}

.cookbook-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.cookbook-sidebar {
    width: 300px;
    background: var(--cb-sidebar-bg);
    border-left: 1px solid var(--cb-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--cb-border);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

#recipeSearch {
    width: 100%;
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    color: var(--cb-text);
    font-size: 14px;
}

.search-icon {
    position: absolute;
    right: 10px;
    color: var(--cb-text-muted);
}

.recipe-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.nav-group {
    margin-bottom: 10px;
}

.nav-group-title {
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--cb-text-muted);
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-group-title:hover {
    color: var(--cb-text);
}

.recipe-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recipe-item {
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--cb-text-muted);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.recipe-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--cb-text);
}

body.light-theme .recipe-item:hover {
    background: rgba(0,0,0,0.03);
}

.recipe-item.active {
    color: var(--cb-accent);
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--cb-accent);
}

/* Main Content */
.cookbook-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--cb-bg);
}

.content-header {
    height: 60px;
    padding: 0 30px;
    border-bottom: 1px solid var(--cb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    color: var(--cb-text);
    font-size: 24px;
    cursor: pointer;
}

.breadcrumb {
    font-size: 13px;
    color: var(--cb-text-muted);
}

.breadcrumb span::after {
    content: "/";
    margin: 0 8px;
    color: var(--cb-border);
}

.breadcrumb span:last-child::after {
    display: none;
}

.recipe-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 60px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.welcome-screen {
    text-align: center;
    padding-top: 60px;
}

.welcome-screen h1 {
    font-size: 32px;
    margin-bottom: 16px;
}

.welcome-screen p {
    color: var(--cb-text-muted);
    font-size: 18px;
}

.stats-overview {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
}

.stat-card {
    background: var(--cb-card-bg);
    border: 1px solid var(--cb-border);
    padding: 24px;
    border-radius: 12px;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--cb-accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--cb-text-muted);
    text-transform: uppercase;
}

/* Recipe Styles */
.recipe-title {
    font-size: 36px;
    margin-bottom: 10px;
}

.recipe-desc {
    font-size: 18px;
    color: var(--cb-text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

.diagram-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 40px;
    cursor: zoom-in;
    text-align: center;
    border: 1px solid var(--cb-border);
}

.diagram-container img {
    max-width: 100%;
    height: auto;
}

.section-title {
    font-size: 24px;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cb-border);
}

.text-block {
    line-height: 1.7;
    font-size: 16px;
    color: var(--cb-text);
}

.api-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.api-table th {
    text-align: left;
    padding: 12px;
    background: var(--cb-card-bg);
    border-bottom: 2px solid var(--cb-border);
    font-size: 13px;
    color: var(--cb-text-muted);
}

.api-table td {
    padding: 12px;
    border-bottom: 1px solid var(--cb-border);
    font-size: 14px;
}

.method-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
}

.method-get { background: #0ea5e9; color: white; }
.method-post { background: #10b981; color: white; }
.method-put { background: #f59e0b; color: white; }
.method-delete { background: #ef4444; color: white; }

.code-container {
    margin-bottom: 30px;
}

.code-header {
    background: #333;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #ccc;
}

.btn-copy {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-copy:hover {
    background: #444;
}

pre {
    margin-top: 0 !important;
    border-radius: 0 0 8px 8px !important;
}

/* Floating Elements */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: var(--cb-accent);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.2s;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* Zoom Overlay */
.zoom-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
}

.zoom-overlay img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.close-zoom {
    position: absolute;
    top: 20px; right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .cookbook-sidebar {
        position: fixed;
        right: 0; top: 0; bottom: 0;
        left: auto;
        transform: translateX(100%);
    }
    .cookbook-sidebar.open {
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
    .recipe-content {
        padding: 20px;
    }
    .stats-overview {
        flex-direction: column;
        align-items: center;
    }
    .stat-card { width: 100%; max-width: 200px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cb-bg); }
::-webkit-scrollbar-thumb { background: var(--cb-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--cb-text-muted); }

.btn-icon {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    color: var(--cb-text);
}

.btn-icon:hover {
    opacity: 1;
}
