/**
 * PowerForecast Documentation Styles
 * Matches the forecast-wizard UI look & feel
 * Version: 1.0.0
 */

/* =============================================================================
   CSS Variables - Matching Wizard Theme
   ============================================================================= */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --dark-bg: #05050a;
    --darker-bg: #0d0d16;
    --card-bg: rgba(17, 17, 27, 0.92);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #c7c9d9;
    --text-muted: #8b8fa3;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --sidebar-width: 280px;
    --header-height: 60px;
    --content-max-width: 900px;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* =============================================================================
   Reset & Base Styles
   ============================================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background: radial-gradient(circle at top, rgba(99, 102, 241, 0.12), transparent 50%),
                radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.08), transparent 50%),
                var(--dark-bg);
    min-height: 100vh;
}

/* =============================================================================
   Layout Structure
   ============================================================================= */

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

/* =============================================================================
   Top Header / Cross-Document Navigation
   ============================================================================= */

.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(13, 13, 22, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
}

.docs-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 2rem;
}

.docs-header-brand img {
    height: 36px;
    width: auto;
}

.docs-header-nav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
}

.docs-header-nav::-webkit-scrollbar {
    display: none;
}

.docs-nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    white-space: nowrap;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.docs-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.docs-nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.docs-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.docs-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.docs-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
}

/* =============================================================================
   Left Sidebar - Table of Contents
   ============================================================================= */

.docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: rgba(20, 20, 32, 0.95);
    border-right: 1px solid var(--card-border);
    overflow-y: auto;
    padding: 1.5rem 0;
    z-index: 100;
}

.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.toc-title {
    padding: 0 1.25rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 0.75rem;
}

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

.toc-nav li {
    margin: 0;
}

.toc-link {
    display: block;
    padding: 0.5rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

.toc-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-left-color: rgba(99, 102, 241, 0.5);
}

.toc-link.active {
    color: var(--accent-color);
    background: rgba(6, 182, 212, 0.08);
    border-left-color: var(--accent-color);
    font-weight: 500;
}

/* Nested TOC items */
.toc-link.toc-h3 {
    padding-left: 2rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.toc-link.toc-h3:hover {
    color: var(--text-secondary);
}

.toc-link.toc-h3.active {
    color: var(--accent-color);
}

/* =============================================================================
   Main Content Area
   ============================================================================= */

.docs-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2.5rem 3rem;
    min-height: calc(100vh - var(--header-height));
}

.docs-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* =============================================================================
   Typography
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.25rem;
    margin-top: 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--card-border);
    background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 1.5rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-primary);
}

h2:first-of-type {
    margin-top: 2rem;
    padding-top: 0;
    border-top: none;
}

h3 {
    font-size: 1.25rem;
    color: var(--accent-color);
}

h4 {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

em {
    color: var(--text-secondary);
    font-style: italic;
}

/* =============================================================================
   Lists
   ============================================================================= */

ul, ol {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.5rem;
}

li::marker {
    color: var(--accent-color);
}

/* =============================================================================
   Tables
   ============================================================================= */

.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--card-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(6, 182, 212, 0.25));
}

th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

td {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
}

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

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Striped tables */
tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.015);
}

tbody tr:nth-child(odd):hover {
    background: rgba(255, 255, 255, 0.035);
}

/* =============================================================================
   Code Blocks
   ============================================================================= */

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: rgba(99, 102, 241, 0.15);
    color: #f59e0b;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

pre {
    background: rgba(5, 5, 12, 0.9);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.25rem 0;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* =============================================================================
   Blockquotes & Callouts
   ============================================================================= */

blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.08);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

blockquote p {
    margin: 0;
    color: var(--text-secondary);
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Warning/Tip/Note callouts */
.callout {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-md);
    border-left: 4px solid;
}

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

.callout-warning .callout-title {
    color: var(--warning-color);
}

.callout-tip {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
}

.callout-tip .callout-title {
    color: var(--success-color);
}

.callout-note {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info-color);
}

.callout-note .callout-title {
    color: var(--info-color);
}

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

.callout-danger .callout-title {
    color: var(--danger-color);
}

.callout-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callout p:last-child {
    margin-bottom: 0;
}

/* =============================================================================
   Horizontal Rules
   ============================================================================= */

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border), transparent);
    margin: 2.5rem 0;
}

/* =============================================================================
   Images & Screenshots
   ============================================================================= */

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--card-border);
}

.screenshot-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.08);
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 1rem 0;
}

/* =============================================================================
   Badges & Pills
   ============================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.3);
}

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

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

/* =============================================================================
   Footer
   ============================================================================= */

.docs-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.docs-footer a {
    color: var(--text-secondary);
}

.docs-footer a:hover {
    color: var(--accent-color);
}

/* =============================================================================
   Navigation Buttons (Prev/Next)
   ============================================================================= */

.docs-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.docs-nav-btn {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    max-width: 45%;
}

.docs-nav-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    text-decoration: none;
}

.docs-nav-btn-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.docs-nav-btn-title {
    color: var(--accent-color);
    font-weight: 500;
}

.docs-nav-btn.prev {
    align-items: flex-start;
}

.docs-nav-btn.next {
    align-items: flex-end;
    margin-left: auto;
}

/* =============================================================================
   Mobile Responsive
   ============================================================================= */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .docs-main {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .docs-sidebar {
        display: none;
    }
    
    .docs-main {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .docs-header-nav {
        display: none;
    }
    
    .docs-header {
        justify-content: space-between;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.35rem;
    }
    
    .docs-nav-buttons {
        flex-direction: column;
    }
    
    .docs-nav-btn {
        max-width: 100%;
    }
    
    .docs-nav-btn.next {
        align-items: flex-start;
    }
}

/* Mobile menu toggle (for JS enhancement) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* =============================================================================
   Scroll Progress Indicator
   ============================================================================= */

.scroll-progress {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    z-index: 1001;
    transition: width 0.1s ease;
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
    .docs-header,
    .docs-sidebar,
    .docs-nav-buttons,
    .docs-back-btn {
        display: none !important;
    }
    
    .docs-main {
        margin: 0;
        padding: 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: black;
        -webkit-text-fill-color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    code {
        background: #f3f4f6;
        border-color: #e5e7eb;
    }
    
    pre {
        background: #f9fafb;
        border-color: #e5e7eb;
    }
}
