/* COOKING Developer Documentation - Styles */
/* Inspired by COOKING app design system */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables - Light Theme (default) */
:root {
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Background Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-hover: #e2e8f0;
    --bg-sidebar: #ffffff;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Border Colors */
    --border-color: #e2e8f0;
    
    /* Accent Colors */
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-primary-light: rgba(59, 130, 246, 0.1);
    
    /* Code Colors */
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --code-keyword: #c084fc;
    --code-string: #4ade80;
    --code-comment: #64748b;
    --code-function: #60a5fa;
    --code-property: #fbbf24;
    
    /* Status Colors */
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    /* Sidebar */
    --sidebar-width: 280px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-header: #1e293b;
    --bg-hover: #334155;
    --bg-sidebar: #1e293b;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-color: #334155;
    
    --accent-primary: #60a5fa;
    --accent-primary-hover: #3b82f6;
    --accent-primary-light: rgba(96, 165, 250, 0.15);
    
    --code-bg: #0f172a;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* Global Utility */
.hidden {
    display: none !important;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==================== LAYOUT ==================== */

.docs-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.docs-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.nav-list {
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-item a:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item a.active {
    background-color: var(--accent-primary-light);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 500;
}

.nav-item a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Nested navigation */
.nav-item .nav-list {
    padding-left: 1rem;
}

.nav-item .nav-list .nav-item a {
    padding-left: 2.5rem;
    font-size: 0.8125rem;
}

/* Main Content */
.docs-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

/* Header */
.docs-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    flex: 1;
    max-width: 400px;
    transition: all 0.2s ease;
}

.header-search:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.header-search svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
}

.header-search input::placeholder {
    color: var(--text-muted);
}

/* Search Results Dropdown */
.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bg-hover);
}

.search-result-title {
    font-weight: 500;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

.header-search {
    position: relative;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

/* Theme Toggle Icons */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* Content Area */
.docs-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* ==================== TYPOGRAPHY ==================== */

.docs-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.docs-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.docs-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.docs-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.docs-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.docs-content a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.docs-content a:hover {
    text-decoration: underline;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Lists */
.docs-content ul,
.docs-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.docs-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.docs-content li strong {
    color: var(--text-primary);
}

/* ==================== CODE BLOCKS ==================== */

.docs-content code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
    background-color: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
}

.docs-content pre {
    background-color: var(--code-bg);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.docs-content pre code {
    background: transparent;
    padding: 0;
    color: var(--code-text);
    font-size: 0.8125rem;
    line-height: 1.7;
}

/* Syntax Highlighting */
.token.keyword { color: var(--code-keyword); }
.token.string { color: var(--code-string); }
.token.comment { color: var(--code-comment); font-style: italic; }
.token.function { color: var(--code-function); }
.token.property { color: var(--code-property); }
.token.number { color: #f472b6; }
.token.operator { color: #94a3b8; }
.token.punctuation { color: #94a3b8; }

/* Code Block Header */
.code-block {
    position: relative;
    margin-bottom: 1.5rem;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #334155;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.code-block-lang {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
}

.code-block-copy {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.code-block-copy:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.code-block-copy svg {
    width: 14px;
    height: 14px;
}

.code-block pre {
    margin: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-top: none;
}

/* ==================== TABLES ==================== */

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.docs-content th,
.docs-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.docs-content th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.docs-content td {
    color: var(--text-secondary);
}

.docs-content tr:hover td {
    background-color: var(--bg-hover);
}

/* ==================== CARDS & BOXES ==================== */

.info-box {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.info-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.info-box-content {
    flex: 1;
}

.info-box-content p {
    margin: 0;
}

.info-box.info {
    background-color: var(--accent-primary-light);
    border: 1px solid var(--accent-primary);
}

.info-box.info svg {
    color: var(--accent-primary);
}

.info-box.warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--color-warning);
}

.info-box.warning svg {
    color: var(--color-warning);
}

.info-box.success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--color-success);
}

.info-box.success svg {
    color: var(--color-success);
}

.info-box.danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-danger);
}

.info-box.danger svg {
    color: var(--color-danger);
}

/* Feature Cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.feature-card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--accent-primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.feature-card a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.feature-card a svg {
    width: 16px;
    height: 16px;
}

/* ==================== BADGES ==================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.badge-primary {
    background-color: var(--accent-primary-light);
    color: var(--accent-primary);
}

.badge-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

/* ==================== BUTTONS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* ==================== BREADCRUMB ==================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-secondary);
}

/* ==================== TABLE OF CONTENTS ==================== */

.toc {
    position: sticky;
    top: 5rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
}

.toc-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--accent-primary);
}

/* ==================== MOBILE MENU ==================== */

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
    .docs-content {
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 768px) {
    .docs-sidebar {
        transform: translateX(-100%);
    }
    
    .docs-sidebar.open {
        transform: translateX(0);
    }
    
    .docs-main {
        margin-left: 0;
    }
    
    .docs-header {
        padding: 0.75rem 1rem;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .header-search {
        display: none;
    }
    
    .docs-content {
        padding: 1rem;
    }
    
    .docs-content h1 {
        font-size: 1.75rem;
    }
    
    .docs-content h2 {
        font-size: 1.25rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.docs-content {
    animation: fadeIn 0.3s ease;
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== HERO SECTION ==================== */

.hero {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background-color: var(--accent-primary-light);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-icon svg {
    width: 40px;
    height: 40px;
    color: var(--accent-primary);
}

.hero h1 {
    margin-bottom: 0.75rem;
}

.hero .lead {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==================== VERSION BADGE ==================== */

.version-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* ==================== API REFERENCE ==================== */

.api-method {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.api-method-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.api-method-name {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.api-method-badge {
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    background-color: var(--accent-primary-light);
    color: var(--accent-primary);
}

.api-method-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.api-params {
    margin-top: 1rem;
}

.api-params-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.api-param {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.api-param:last-child {
    border-bottom: none;
}

.api-param-name {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    color: var(--code-property);
    min-width: 120px;
}

.api-param-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 80px;
}

.api-param-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}
