/**
 * Documentation Page Styles
 * Modular stylesheet for API documentation page
 * Supports light and dark modes
 */

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

/* Light Mode (Default) */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #ffffff;
    --surface-color: #f8fafc;
    --surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --code-bg: #f1f5f9;
    --code-border: #e2e8f0;
    --code-text: #1e293b;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --code-bg: #0f172a;
    --code-border: #1e293b;
    --code-text: #a78bfa;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--surface-hover);
}

.theme-toggle span {
    font-size: 1.25rem;
}

.theme-toggle .toggle-slider {
    width: 50px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s ease;
}

.theme-toggle .toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle .toggle-slider {
    background: var(--primary-color);
}

[data-theme="dark"] .theme-toggle .toggle-slider::before {
    transform: translateX(26px);
    background: var(--surface-color);
}

.header {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    margin: -2rem -2rem 3rem -2rem;
    border-radius: 0 0 2rem 2rem;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0.25rem;
}

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

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

.section {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s ease, border-color 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section h2::before {
    content: '';
    width: 4px;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
}

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

.section ul, .section ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.section li {
    margin-bottom: 0.5rem;
}

.code-block {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.code-block code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--code-text);
    line-height: 1.8;
    white-space: pre;
    display: block;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--code-border);
}

.code-block-header span {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

.copy-btn.copied {
    background: var(--success-color);
}

.info-box {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.25rem;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.25rem;
}

.success-box {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.25rem;
}

.endpoint-card {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.endpoint-method {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

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

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

.endpoint-url {
    font-family: 'Courier New', Courier, monospace;
    color: var(--text-primary);
    font-size: 1rem;
}

.toc {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.toc h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.toc ul {
    list-style: none;
    margin-left: 0;
}

.toc li {
    margin: 0.5rem 0;
}

.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
    display: block;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.toc a:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.example-card {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.example-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    transition: border-color 0.3s ease, color 0.3s ease;
}

.highlight {
    background: rgba(139, 92, 246, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .container {
        padding: 1rem;
    }

    .section {
        padding: 1.5rem;
    }

    .theme-toggle {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }

    .theme-toggle .toggle-slider {
        width: 40px;
        height: 20px;
    }

    .theme-toggle .toggle-slider::before {
        width: 16px;
        height: 16px;
    }

    [data-theme="dark"] .theme-toggle .toggle-slider::before {
        transform: translateX(20px);
    }

    .code-block {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .code-block code {
        font-size: 0.8rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .section h3 {
        font-size: 1.25rem;
    }

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

    .header {
        margin: -1rem -1rem 2rem -1rem;
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 1rem;
    }

    .theme-toggle {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .theme-toggle span {
        font-size: 1rem;
    }
}

