/* styles.css */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-light: #475569;
    --shadow: rgba(0, 0, 0, 0.25);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0 2rem;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    height: 4rem;
}

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

.nav-logo {
    height: 2rem;
    width: auto;
}

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

.nav-center {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.api-link {
    padding: 0.5rem 1rem;
    background: var(--primary);
    border-radius: var(--radius);
    color: white !important;
}

.api-link:hover {
    background: var(--primary-dark);
}

.external-icon {
    width: 1rem;
    height: 1rem;
}

/* Search Dialog */
.search-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    padding: 2rem;
}

.search-dialog.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8rem;
}

.search-dialog-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px var(--shadow);
}

.search-dialog-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.search-dialog-input {
    flex: 1;
    padding: 1rem 0;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.125rem;
    outline: none;
}

.search-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.search-close:hover {
    background: var(--surface-light);
    color: var(--text);
}

.search-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Search Stats */
.search-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.search-time {
    color: var(--text-muted);
}

/* Search Placeholder */
.search-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.search-placeholder svg {
    width: 2.5rem;
    height: 2.5rem;
    opacity: 0.5;
}

.search-results {
    max-height: 500px;
    overflow-y: auto;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
}

.loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
}

.search-empty svg {
    width: 2rem;
    height: 2rem;
    opacity: 0.5;
}

.search-results-list {
    padding: 0.5rem;
}

.search-result {
    display: block;
    padding: 1rem;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin-bottom: 0.5rem;
}

.search-result:hover {
    background: var(--surface-light);
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.search-result-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.search-result-category {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    border-radius: 9999px;
    margin-top: 0.5rem;
}

.search-result-content {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    background: var(--background);
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin: 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.search-result-category {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    border-radius: 9999px;
}

.search-result-path {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* Responsive per search dialog */
@media (max-width: 768px) {
    .search-dialog {
        padding: 1rem;
    }
    
    .search-dialog-content {
        max-width: 100%;
        max-height: 90vh;
    }
    
    .search-results {
        max-height: 400px;
    }
}

/* Main Layout */
.main-container {
    display: flex;
    margin-top: 4rem;
    min-height: calc(100vh - 4rem);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 4rem;
    height: calc(100vh - 4rem);
    overflow-y: auto;
}

.sidebar-content {
    padding: 2rem 1rem;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--surface-light);
    color: var(--text);
}

/* Content */
.content {
    flex: 1;
    padding: 2rem;
    max-width: none;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sections */
.section {
    margin-bottom: 4rem;
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    scroll-margin-top: 5rem;
}

.section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    scroll-margin-top: 5rem;
}

.section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-secondary);
}

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

/* Endpoints */
.endpoint {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    overflow: hidden;
}

.endpoint-header {
    background: var(--surface-light);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.method.get {
    background: var(--success);
    color: white;
}

.method.post {
    background: var(--primary);
    color: white;
}

.endpoint-path {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-weight: 500;
    color: var(--text);
}

.endpoint-content {
    padding: 1.5rem;
}

/* Parameters Table */
.params-table {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.param {
    display: grid;
    grid-template-columns: 1fr auto 2fr;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

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

.param-name {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-weight: 500;
    color: var(--primary);
}

.param-type {
    padding: 0.125rem 0.5rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

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

/* Code Blocks */
.code-block {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-radius: .5em;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.875rem;
    box-shadow: 1px 1px .5em #000 inset;
}

.code-block code {
    color: var(--text);
}

pre.code-block {
    background: var(--background);
    color: var(--text);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .nav-center {
        display: none;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link span {
        display: none;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .param {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .param-type {
        width: fit-content;
    }
}

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

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

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

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