/* StarWhisper Documentation - Modern Clean Design */

:root {
    --primary: #743df5;
    --primary-light: #8b5cf6;
    --primary-dark: #5b2ac2;
    --accent: #8b5cf6;
    --background: #ffffff;
    --surface: #f8f9fa;
    --surface-hover: #f1f3f4;
    --border: #e5e7eb;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --pro-badge: linear-gradient(135deg, #743df5 0%, #8b5cf6 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    --sidebar-width: 280px;
    --header-height: 64px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.doc-layout {
    display: flex;
    min-height: 100vh;
}

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

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(168, 85, 247, 1) 0%,
        rgba(139, 92, 246, 1) 40%,
        rgba(116, 61, 245, 1) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-mic-icon {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.sidebar-logo span {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-logo span strong {
    color: var(--primary);
}

.sidebar-nav {
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

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

.nav-link .pro-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    background: var(--pro-badge);
    color: white;
    border-radius: 4px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 50;
}

.header-search {
    position: relative;
    width: 400px;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--surface);
    transition: all 0.2s ease;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(116, 61, 245, 0.1);
}

.header-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-secondary);
}

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

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

.header-btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

/* Content */
.content {
    padding: 40px 48px;
    max-width: 900px;
}

/* Typography */
.content h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.content h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 12px;
}

.content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

/* Remove underline on card links */
.card a,
.card a:hover,
a.card,
a.card:hover,
.card h4,
.card p {
    text-decoration: none !important;
}

/* Lead paragraph */
.content > p:first-of-type {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card:hover h4,
.card:hover p {
    text-decoration: none;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.card-icon svg {
    width: 20px;
    height: 20px;
}

.card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Info boxes */
.info-box {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin: 24px 0;
    display: flex;
    gap: 12px;
}

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

.info-box-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-box-content p {
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.info-box-tip {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.info-box-tip svg {
    color: #22c55e;
}

.info-box-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #b45309;
}

.info-box-warning svg {
    color: #f59e0b;
}

.info-box-danger {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.info-box-danger svg {
    color: #ef4444;
}

/* Code blocks */
pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 24px 0;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

code {
    font-family: var(--font-mono);
    font-size: 14px;
}

p code,
li code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
}

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

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

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

tr:hover td {
    background: var(--surface);
}

/* Lists */
.content ul,
.content ol {
    margin: 16px 0;
    padding-left: 24px;
    color: var(--text-secondary);
}

.content li {
    margin-bottom: 8px;
}

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

/* Pro badge */
.pro-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--pro-badge);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 8px;
}

/* Keyboard keys */
kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--border);
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

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

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

.breadcrumb svg {
    width: 16px;
    height: 16px;
}

/* Table of contents */
.toc {
    position: sticky;
    top: calc(var(--header-height) + 40px);
    max-height: calc(100vh - var(--header-height) - 80px);
    overflow-y: auto;
    padding-left: 24px;
    border-left: 2px solid var(--border);
}

.toc-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.toc-link {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.toc-link:hover,
.toc-link.active {
    color: var(--primary);
}

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content {
        padding: 24px;
    }

    .header-search {
        width: 100%;
        max-width: 300px;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .header-search {
        display: none;
    }

    .content {
        padding: 20px;
    }

    .content h1 {
        font-size: 28px;
    }

    .content h2 {
        font-size: 20px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 8px 12px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* Focus */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

.content {
    animation: fadeIn 0.3s ease;
}
