:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --accent-color: #4dabf7;
    --success-color: #51cf66;
    --warning-color: #ffd43b;
    --danger-color: #ff6b6b;
    --info-color: #22d3ee;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* Header */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-placeholder {
    width: 50px;
    height: 50px;
    position: relative;
}

.logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.logo-fallback {
    width: 50px;
    height: 50px;
    background-color: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* Layout */
.container {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 80px);
}

.sidebar {
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.main-content {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

/* Sidebar */
.endpoint-group {
    margin-bottom: 2rem;
}

.endpoint-group h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.endpoint-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.endpoint-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.endpoint-item.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg);
}

.method-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 50px;
    text-align: center;
}

.method-post { background: var(--success-color); color: white; }
.method-get { background: var(--info-color); color: white; }
.method-delete { background: var(--danger-color); color: white; }
.method-put { background: var(--warning-color); color: black; }

/* Main Content */
.docs-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.docs-section h1 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.docs-section h3 {
    color: var(--accent-color);
    margin: 2rem 0 1rem 0;
    font-size: 1.3rem;
}

.lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Info Cards */
.info-card, .auth-section, .session-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-card li:last-child {
    border-bottom: none;
}

/* Endpoint Documentation */
.endpoint-header {
    margin-bottom: 2rem;
}

.endpoint-header h1 {
    margin-bottom: 0.5rem;
}

.endpoint-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.endpoint-url {
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.endpoint-description {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Parameters Table */
.parameters-section {
    margin-bottom: 2rem;
}

.parameters-table {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.parameters-table table {
    width: 100%;
    border-collapse: collapse;
}

.parameters-table th,
.parameters-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.parameters-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.parameters-table tr:last-child td {
    border-bottom: none;
}

.type-badge {
    background: var(--info-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.required-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.required-badge.required {
    background: var(--danger-color);
    color: white;
}

.required-badge.optional {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Code Blocks */
.code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    overflow: hidden;
}

.code-header {
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.code-block pre {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
}

.code-block code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Examples and Response Sections */
.examples-section, .curl-section, .response-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 250px 1fr;
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .header {
        padding: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .endpoint-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .parameters-table {
        overflow-x: auto;
    }
    
    .parameters-table table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .docs-section {
        padding: 1rem;
    }
    
    .docs-section h1 {
        font-size: 1.5rem;
    }
    
    .endpoint-header h1 {
        font-size: 1.3rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus styles for accessibility */
button:focus,
.endpoint-item:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .sidebar,
    .theme-toggle {
        display: none;
    }
    
    .container {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 0;
    }
    
    .docs-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}