/* ============================================
   Cohort RWD Documentation - Styles
   ============================================ */

:root {
    /* Color Palette - Deep Indigo Theme */
    --color-primary: #6366F1;
    --color-primary-dark: #4F46E5;
    --color-primary-light: #818CF8;
    --color-accent: #F59E0B;
    --color-accent-light: #FCD34D;
    
    /* Backgrounds */
    --bg-body: #0F0F1A;
    --bg-sidebar: #14141F;
    --bg-content: #1A1A2E;
    --bg-card: #1F1F35;
    --bg-card-hover: #252542;
    --bg-input: #0D0D14;
    
    /* Text Colors */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-accent: #A5B4FC;
    
    /* Borders */
    --border-color: #2D2D44;
    --border-focus: #6366F1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    
    /* Sizing */
    --sidebar-width: 280px;
    --header-height: 60px;
    --content-max-width: 900px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar Styles
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-weight: 700;
    font-size: 1.125rem;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.version-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Search Box */
.search-box {
    padding: 1rem 1.5rem;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

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

.search-box input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.search-icon {
    position: absolute;
    left: 2.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

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

.nav-section {
    padding: 0.5rem 0;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.75rem 1.5rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-section-title.expandable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.nav-section-title.expandable:hover {
    color: var(--text-secondary);
}

.expand-icon {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.nav-section-title[data-expanded="false"] .expand-icon {
    transform: rotate(-90deg);
}

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

.nav-list.collapsible.collapsed {
    display: none;
}

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

.nav-item a:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.08);
}

.nav-item.active > a {
    color: var(--color-primary-light);
    background: rgba(99, 102, 241, 0.12);
    border-left-color: var(--color-primary);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Sub-navigation */
.nav-sublist {
    list-style: none;
    margin-left: 2.5rem;
    border-left: 1px solid var(--border-color);
    padding-left: 0;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.nav-sublist .nav-item a {
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
    border-left: none;
}

.nav-sublist .nav-item a:hover {
    background: rgba(99, 102, 241, 0.06);
}

.nav-sublist .nav-item.active > a {
    color: var(--color-primary-light);
    background: rgba(99, 102, 241, 0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.back-to-app {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.back-to-app:hover {
    background: var(--bg-card-hover);
    border-color: var(--color-primary);
    color: var(--text-primary);
}

.back-to-app svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Main Content Styles
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-content);
}

.content-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Content Body */
.content-body {
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

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

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

/* Typography */
h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

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);
}

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

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

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

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

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

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

/* Lists */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.5rem;
}

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

/* Code */
code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    background: var(--bg-card);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    color: var(--color-accent-light);
}

pre {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Info Card */
.info-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.info-card-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--color-primary-light);
}

.info-card-icon svg {
    width: 100%;
    height: 100%;
}

.info-card-content {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.info-card-content strong {
    color: var(--text-primary);
}

/* Warning Card */
.warning-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    margin-bottom: 2rem;
}

.warning-card .info-card-icon {
    color: var(--color-accent);
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

.quick-link-card {
    display: block;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.quick-link-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.quick-link-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.quick-link-icon svg {
    width: 22px;
    height: 22px;
    color: var(--color-primary-light);
}

.quick-link-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.quick-link-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

.feature-item {
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.feature-item h4 {
    font-size: 0.9375rem;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

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

/* Page Footer */
.page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.last-updated {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.page-nav {
    display: flex;
    gap: 1rem;
}

.page-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

.page-nav svg {
    width: 16px;
    height: 16px;
}

.prev-page svg {
    transform: rotate(180deg);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

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

th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--text-primary);
}

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

tr:hover td {
    background: rgba(99, 102, 241, 0.04);
}

/* Images */
.content-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

/* Step-by-Step */
.steps {
    counter-reset: step-counter;
    margin: 1.5rem 0;
}

.step {
    position: relative;
    padding-left: 3.5rem;
    padding-bottom: 2rem;
    border-left: 2px solid var(--border-color);
    margin-left: 1rem;
}

.step:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.step::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: -1rem;
    width: 2rem;
    height: 2rem;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.step h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.step p {
    margin-bottom: 0.5rem;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .content-body {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .quick-links {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .page-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .content-header {
        padding: 0 1rem;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.sidebar-overlay.visible {
    display: block;
}

/* Print Styles */
@media print {
    .sidebar,
    .content-header,
    .page-nav {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        color: inherit;
    }
}
