/* ===================================
   Bulku Documentation Styles
   Hybrid approach: Brand identity + Documentation-specific layout
   =================================== */

/* ===================================
   CSS Variables (Brand Colors)
   =================================== */
:root {
    /* Brand Colors */
    --primary-blue-start: #1E7BB8;
    --primary-blue-end: #3DBBEB;
    --primary-orange-start: #FF9A56;
    --primary-orange-end: #FFC857;
    
    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    /* Code Block Colors */
    --code-bg: #f8f9fa;
    --code-border: #e9ecef;
    --code-text: #e83e8c;
    
    /* Callout Colors */
    --callout-info-bg: #e7f5ff;
    --callout-info-border: #339af0;
    --callout-warning-bg: #fff3bf;
    --callout-warning-border: #ffd43b;
    --callout-success-bg: #d3f9d8;
    --callout-success-border: #51cf66;
    --callout-danger-bg: #ffe3e3;
    --callout-danger-border: #ff6b6b;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #1a1b1e;
    --bg-secondary: #25262b;
    --bg-tertiary: #2c2e33;
    --text-primary: #e9ecef;
    --text-secondary: #ced4da;
    --text-muted: #adb5bd;
    --border-color: #373a40;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
    
    --code-bg: #2c2e33;
    --code-border: #373a40;
    --code-text: #ff6b9d;
    
    --callout-info-bg: #1c3d5a;
    --callout-info-border: #339af0;
    --callout-warning-bg: #4a3f1f;
    --callout-warning-border: #ffd43b;
    --callout-success-bg: #1f4a2c;
    --callout-success-border: #51cf66;
    --callout-danger-bg: #4a1f1f;
    --callout-danger-border: #ff6b6b;
}

/* ===================================
   Base Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===================================
   Layout Structure
   =================================== */
.docs-container {
    display: flex;
    min-height: 100vh;
}

/* ===================================
   Header
   =================================== */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.docs-header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.docs-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue-start), var(--primary-blue-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.docs-logo img {
    width: 32px;
    height: 32px;
}

.docs-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-theme-toggle {
    display: none; /* Hidden by default */
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    transform: scale(1.05);
}

.back-to-main {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-blue-start), var(--primary-blue-end));
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-to-main:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===================================
   Sidebar Navigation
   =================================== */
.docs-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 280px;
    height: calc(100vh - 60px);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem 0;
    z-index: 100;
}

.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.search-container {
    padding: 0 1.5rem 1.5rem;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue-end);
    box-shadow: 0 0 0 3px rgba(61, 187, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.search-shortcut {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.nav-links {
    list-style: none;
}

.nav-link {
    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.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--bg-tertiary);
    color: var(--primary-blue-end);
    border-left-color: var(--primary-blue-end);
    font-weight: 600;
}

.nav-link-icon {
    font-size: 1.125rem;
}

/* ===================================
   Main Content Area
   =================================== */
.docs-main {
    margin-left: 280px;
    margin-top: 60px;
    flex: 1;
    display: flex;
}

.docs-content {
    flex: 1;
    max-width: 900px;
    padding: 3rem;
}

/* ===================================
   Table of Contents (Right Sidebar)
   =================================== */
.docs-toc {
    position: sticky;
    top: 80px;
    width: 240px;
    height: calc(100vh - 100px);
    padding: 1.5rem;
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
}

.docs-toc::-webkit-scrollbar {
    width: 4px;
}

.docs-toc::-webkit-scrollbar-track {
    background: transparent;
}

.docs-toc::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.toc-links {
    list-style: none;
}

.toc-link {
    display: block;
    padding: 0.375rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
}

.toc-link:hover {
    color: var(--text-primary);
}

.toc-link.active {
    color: var(--primary-blue-end);
    border-left-color: var(--primary-blue-end);
    font-weight: 500;
}

.toc-link.toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.8125rem;
}

/* ===================================
   Typography
   =================================== */
.docs-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.docs-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.docs-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.docs-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.docs-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.docs-content a {
    color: var(--primary-blue-end);
    text-decoration: none;
    transition: color 0.2s ease;
}

.docs-content a:hover {
    color: var(--primary-blue-start);
    text-decoration: underline;
}

.docs-content ul,
.docs-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.docs-content li {
    margin-bottom: 0.5rem;
}

.docs-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===================================
   Code Blocks
   =================================== */
.docs-content code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    border: 1px solid var(--code-border);
}

.docs-content pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.docs-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-primary);
}

/* ===================================
   Callout Boxes
   =================================== */
.callout {
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    position: relative;
    border-left: 4px solid;
}

.callout::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-size: 1.25rem;
}

.callout-info {
    background: var(--callout-info-bg);
    border-left-color: var(--callout-info-border);
}

.callout-info::before {
    content: 'ℹ️';
}

.callout-warning {
    background: var(--callout-warning-bg);
    border-left-color: var(--callout-warning-border);
}

.callout-warning::before {
    content: '⚠️';
}

.callout-success {
    background: var(--callout-success-bg);
    border-left-color: var(--callout-success-border);
}

.callout-success::before {
    content: '✅';
}

.callout-danger {
    background: var(--callout-danger-bg);
    border-left-color: var(--callout-danger-border);
}

.callout-danger::before {
    content: '❌';
}

.callout p:last-child {
    margin-bottom: 0;
}

/* ===================================
   Numbered Steps
   =================================== */
.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary-blue-start), var(--primary-blue-end));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.step-content h3 {
    margin-top: 0;
}

/* ===================================
   Cards
   =================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue-end);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===================================
   Image Placeholders
   =================================== */
.screenshot-placeholder {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.screenshot-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.screenshot-placeholder-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

.screenshot-placeholder-dimensions {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Hide placeholders in production builds */
.hide-placeholders .screenshot-placeholder {
    display: none;
}

/* ===================================
   Navigation (Prev/Next)
   =================================== */
.page-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.page-nav-link {
    flex: 1;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-nav-link:hover {
    border-color: var(--primary-blue-end);
    box-shadow: var(--shadow-sm);
}

.page-nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.page-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.page-nav-link.prev {
    text-align: left;
}

.page-nav-link.next {
    text-align: right;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1200px) {
    .docs-toc {
        display: none;
    }
    
    .docs-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .docs-header .theme-toggle {
        display: none; /* Hide header toggle on mobile */
    }

    .sidebar-theme-toggle {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1.5rem;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.875rem;
        background: none;
        border: none;
        width: 100%;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .sidebar-theme-toggle:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .docs-sidebar.open {
        transform: translateX(0);
    }
    
    .docs-main {
        margin-left: 0;
    }
    
    .docs-content {
        padding: 2rem 1.5rem;
    }
    
    .docs-header {
        padding: 0 1rem;
    }
    
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .page-navigation {
        flex-direction: column;
    }
}

/* ===================================
   Search Modal
   =================================== */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    z-index: 2000;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-modal-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1.125rem;
}

.search-modal-input:focus {
    outline: none;
}

.search-results {
    overflow-y: auto;
    padding: 0.5rem;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.search-result-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}
