/* Fula API Documentation Styles */

/* Dark Theme (default) */
:root, [data-theme="dark"] {
    --bg-dark: #0d1117;
    --bg-sidebar: #161b22;
    --bg-code: #1e2430;
    --bg-example: #0d1117;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-heading: #ffffff;
    --border-color: #30363d;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-yellow: #d29922;
    --accent-purple: #a371f7;
    --method-get: #61affe;
    --method-post: #49cc90;
    --method-put: #fca130;
    --method-delete: #f93e3e;
    --method-head: #9012fe;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --code-text: #e6e6e6;
}

/* Light Theme */
[data-theme="light"] {
    --bg-dark: #ffffff;
    --bg-sidebar: #f6f8fa;
    --bg-code: #f0f3f6;
    --bg-example: #f6f8fa;
    --text-primary: #24292f;
    --text-secondary: #57606a;
    --text-heading: #1f2328;
    --border-color: #d0d7de;
    --accent-blue: #0969da;
    --accent-green: #1a7f37;
    --accent-red: #cf222e;
    --accent-yellow: #9a6700;
    --accent-purple: #8250df;
    --method-get: #0969da;
    --method-post: #1a7f37;
    --method-put: #9a6700;
    --method-delete: #cf222e;
    --method-head: #8250df;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --code-text: #24292f;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 100;
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo h1 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 600;
}

.logo .version {
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--bg-code);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

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

.nav-section h3 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px;
    margin-bottom: 8px;
}

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

.nav-section li a {
    display: block;
    padding: 8px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-section li a:hover {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

/* Main Content */
.content {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
}

/* Section Headers */
.section-header {
    background: linear-gradient(135deg, #1a1f2e 0%, #0d1117 100%);
    padding: 40px 60px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h1 {
    color: var(--text-heading);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Endpoint Sections */
.endpoint {
    border-bottom: 1px solid var(--border-color);
}

.endpoint-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}

/* Left Column - Description */
.description {
    padding: 40px;
    border-right: 1px solid var(--border-color);
}

.description h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.description h3 {
    color: var(--text-heading);
    font-size: 1rem;
    font-weight: 600;
    margin: 24px 0 12px;
}

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

.description ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

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

.description code {
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.85em;
    color: var(--accent-blue);
}

/* Method Badges */
.method-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.method-badge.get { background: var(--method-get); color: #fff; }
.method-badge.post { background: var(--method-post); color: #fff; }
.method-badge.put { background: var(--method-put); color: #fff; }
.method-badge.delete { background: var(--method-delete); color: #fff; }
.method-badge.head { background: var(--method-head); color: #fff; }

/* Endpoint URL */
.endpoint-url {
    display: block;
    background: var(--bg-code);
    padding: 12px 16px;
    border-radius: 6px;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.95rem;
    color: var(--accent-green);
    margin: 8px 0 16px;
    border: 1px solid var(--border-color);
}

/* Parameters Table */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.9rem;
}

.params-table th {
    text-align: left;
    padding: 12px;
    background: var(--bg-code);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.params-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.params-table code {
    background: transparent;
    padding: 0;
    color: var(--accent-blue);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.required {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

/* Right Column - Examples */
.example {
    background: var(--bg-example);
    padding: 40px;
    overflow-x: auto;
}

.example-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    margin-top: 24px;
}

.example-header:first-child {
    margin-top: 0;
}

.lang-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.status-badge.error {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

/* Code Blocks */
.example pre {
    background: var(--bg-code);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.example pre code {
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Copy Button */
.copy-btn {
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.copy-btn.copied {
    background: rgba(63, 185, 80, 0.2);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

/* Inline Code */
.inline-code {
    display: inline-block;
    background: var(--bg-code);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.9rem;
    color: var(--accent-blue);
    border: 1px solid var(--border-color);
}

/* Footer */
footer {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 1200px) {
    .endpoint-content {
        grid-template-columns: 1fr;
    }
    
    .description {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    z-index: 200;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}

.mobile-header .logo-text {
    color: var(--text-heading);
    font-size: 1.2rem;
    font-weight: 600;
}

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

/* Hamburger Menu Button */
.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.hamburger:hover {
    background: var(--bg-code);
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-moon,
:root:not([data-theme]) .theme-toggle .icon-sun {
    display: block;
}

/* Desktop Theme Toggle in Sidebar */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.sidebar-header .logo {
    padding: 0;
    border: none;
    margin: 0;
}

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

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

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        top: 0;
        padding-top: 20px;
        width: 280px;
        max-width: 85vw;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .hamburger {
        display: block;
    }
    
    .content {
        margin-left: 0;
        padding-top: 60px;
        width: 100%;
        max-width: 100vw;
    }
    
    .description,
    .example {
        padding: 24px 16px;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .endpoint-row {
        flex-direction: column;
    }
    
    .description,
    .example {
        width: 100%;
        border-right: none;
    }
    
    .example {
        border-top: 1px solid var(--border-color);
    }
    
    .endpoint-header h3 {
        font-size: 1.1rem;
        word-break: break-word;
    }
    
    .method-badge {
        font-size: 0.7rem;
    }
    
    table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
    }
    
    pre {
        font-size: 0.75rem;
        max-width: 100%;
        overflow-x: auto;
    }
    
    code {
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .description,
    .example {
        padding: 16px 12px;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1rem;
    }
}

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

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

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

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

/* Highlight.js Overrides */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* Light Theme Specific Adjustments */
[data-theme="light"] .sidebar {
    box-shadow: 2px 0 8px var(--shadow-color);
}

[data-theme="light"] .mobile-header {
    box-shadow: 0 2px 8px var(--shadow-color);
}

[data-theme="light"] .method-badge {
    font-weight: 600;
}

[data-theme="light"] pre {
    color: var(--code-text);
}

[data-theme="light"] code {
    background: var(--bg-code);
}

[data-theme="light"] .example {
    background: var(--bg-example);
}

[data-theme="light"] .copy-btn {
    background: var(--bg-code);
    border-color: var(--border-color);
}

[data-theme="light"] .copy-btn:hover {
    background: var(--border-color);
}

/* Active nav link for both themes */
[data-theme="light"] .nav-section li a.active {
    background: rgba(9, 105, 218, 0.1);
    color: #0969da;
    border-left-color: #0969da;
}
