/* DARKSHAN API Style - Matching home.html */
:root {
    --bg: #09090b;
    --card: #111113;
    --card-border: #1c1c20;
    --input-bg: #18181b;
    --input-border: #27272a;
    --text: #fafafa;
    --text-dim: #a1a1aa;
    --text-muted: #52525b;
    --border: #27272a;
    --primary: #22c55e;
    --primary-glow: rgba(34, 197, 94, 0.15);
    --blue: #3b82f6;
    --blue-glow: rgba(59, 130, 246, 0.15);
    --error: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --radius: 10px;
    --radius-lg: 16px;
    --get-color: #22c55e;
    --post-color: #f59e0b;
    --free-color: #22c55e;
    --user-color: #f59e0b;
    --vip-color: #ef4444;
}

/* ===== THEME SYSTEM ===== */
[data-theme="green"]  { --primary: #22c55e; --primary-glow: rgba(34,197,94,0.15); --success: #22c55e; --get-color: #22c55e; }
[data-theme="orange"] { --primary: #f97316; --primary-glow: rgba(249,115,22,0.15); --success: #f97316; --get-color: #f97316; }
[data-theme="blue"]   { --primary: #3b82f6; --primary-glow: rgba(59,130,246,0.15); --success: #3b82f6; --get-color: #3b82f6; }
[data-theme="red"]    { --primary: #ef4444; --primary-glow: rgba(239,68,68,0.15); --success: #ef4444; --get-color: #ef4444; }
[data-theme="purple"] { --primary: #a855f7; --primary-glow: rgba(168,85,247,0.15); --success: #a855f7; --get-color: #a855f7; }
[data-theme="yellow"]{ --primary: #eab308; --primary-glow: rgba(234,179,8,0.15); --success: #eab308; --get-color: #eab308; }

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Dotted Background - Same as home.html */
.dots {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 0;
    pointer-events: none;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--blue));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

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

/* Dark Mode Toggle */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    padding: 8px 14px;
    border-radius: 20px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.dark-mode-toggle:hover {
    background: var(--card-border);
}

.toggle-switch {
    width: 40px;
    height: 22px;
    background: var(--input-border);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch.active::after {
    transform: translateX(18px);
}

/* Menu Button */
.menu-btn {
    width: 40px;
    height: 40px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 16px;
    transition: all 0.2s;
}

.menu-btn:hover {
    background: var(--card-border);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--card);
    border-right: 1px solid var(--card-border);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
}

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

.sidebar-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.sidebar-close:hover {
    background: var(--error);
    color: white;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--blue));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.sidebar-logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
}

.sidebar-nav a i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.sidebar-nav a:hover {
    background: var(--input-bg);
    color: var(--text);
}

.sidebar-nav a.active {
    background: var(--primary);
    color: #000;
}

.sidebar-nav a.active i {
    color: #000;
}

/* Sidebar Shop Button */
.sidebar-shop {
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary));
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    text-decoration: none;
}
.sidebar-shop:hover { opacity: 0.9; transform: translateY(-1px); }

/* Sidebar Profile Link */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-top: 8px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    border-top: 1px solid var(--card-border);
}
.sidebar-profile:hover { background: var(--input-bg); color: var(--text); }
.sidebar-profile i { width: 18px; text-align: center; font-size: 15px; }

/* Theme Toggle Switch */
.toggle-switch {
    position: relative; display: inline-flex; width: 44px; height: 24px;
    border-radius: 12px; background: var(--primary); cursor: pointer;
    transition: background 0.2s; border: none; padding: 0; flex-shrink: 0;
}
.toggle-switch.off { background: var(--text-muted); }
.toggle-switch .toggle-dot {
    position: absolute; top: 2px; width: 20px; height: 20px;
    border-radius: 50%; background: white; transition: left 0.2s;
}
.toggle-switch .toggle-dot.on { left: 22px; }
.toggle-switch .toggle-dot.off { left: 2px; }

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

/* Category Header */
.category-header {
    margin-bottom: 24px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.category-title i {
    color: var(--primary);
}

.category-description {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Status Badges */
.status-badges {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Search and Filter */
.search-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-dropdown {
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2352525b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--primary);
}

/* API Cards Grid */
.api-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.api-card:hover {
    border-color: var(--primary);
}

.api-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--primary-glow);
}

.api-card-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.api-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.method-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.method-badge.get {
    background: rgba(34, 197, 94, 0.15);
    color: var(--get-color);
}

.method-badge.post {
    background: rgba(245, 158, 11, 0.15);
    color: var(--post-color);
}

.api-endpoint {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.play-btn {
    width: 36px;
    height: 36px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.play-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

/* Inline Test Panel */
.test-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    border-left: 1px solid var(--card-border);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

/* Dotted background for test panel */
.test-panel::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

.test-panel.active {
    transform: translateX(0);
}

.test-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.test-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.test-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 10;
    position: relative;
}

.test-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-panel-title h2 {
    font-size: 1rem;
    font-weight: 700;
}

.test-panel-close {
    width: 32px;
    height: 32px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.test-panel-close:hover {
    background: var(--error);
    color: white;
}

.test-panel-body {
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Request URL Box */
.request-url-box {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 20px;
}

.request-url-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.request-url-input-group {
    display: flex;
    gap: 8px;
}

.request-url-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.copy-url-btn {
    padding: 10px 12px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Parameters Section */
.parameters-section {
    margin-bottom: 20px;
}

.parameters-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.9rem;
}

.parameters-header i {
    color: var(--primary);
}

.parameter-group {
    margin-bottom: 14px;
}

.parameter-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.parameter-input,
.parameter-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.parameter-input:focus,
.parameter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.parameter-input::placeholder {
    color: var(--text-muted);
}

.parameter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2352525b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.file-input {
    padding: 8px;
}

.file-input::-webkit-file-upload-button {
    padding: 8px 14px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
}

/* Send Request Button */
.send-request-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary), #16a34a);
    border: none;
    border-radius: var(--radius);
    color: #000;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.send-request-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.send-request-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Response Section */
.response-section {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--card);
    border-bottom: 1px solid var(--card-border);
}

.response-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.response-title i {
    color: var(--primary);
}

.copy-json-btn {
    padding: 6px 10px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.response-body {
    padding: 14px;
}

.response-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.response-time,
.response-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--card);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.response-time i {
    color: var(--primary);
}

.response-status.success {
    color: var(--success);
}

.response-status.error {
    color: var(--error);
}

/* JSON Syntax Highlighting */
.json-response {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.json-key {
    color: #93c5fd;
}

.json-string {
    color: #86efac;
}

.json-number {
    color: #fca5a5;
}

.json-boolean {
    color: #fbbf24;
}

.json-null {
    color: #f472b6;
}

/* Code Examples Tabs */
.code-examples {
    margin-top: 20px;
}

.code-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 12px;
}

.code-tab {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.code-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.code-copy-btn {
    margin-left: auto;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-copy-btn:hover {
    background: var(--input-bg);
    color: var(--text);
}

.code-copy-btn:active {
    background: var(--primary);
    color: #000;
}

.code-content {
    display: none;
}

.code-content.active {
    display: block;
}

.code-block {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    overflow-x: auto;
    color: var(--text);
    white-space: pre;
}

/* Prevent any pseudo-element text duplication */
.code-block::before,
.code-block::after {
    content: none !important;
    display: none !important;
}

/* Syntax Highlighting for Code Blocks */
.code-block .comment {
    color: #6b7280;
    font-style: italic;
}

.code-block .keyword {
    color: #7ee787;
    font-weight: 600;
}

.code-block .string {
    color: #a5d6ff;
}

.code-block .number {
    color: #79c0ff;
}

.code-block .function {
    color: #d2a8ff;
}

.code-block .variable {
    color: #ffa657;
}

.code-block .operator {
    color: #c9d1d9;
}

.code-block .punctuation {
    color: #c9d1d9;
}

.code-block .url {
    color: #a5d6ff;
    text-decoration: underline;
}

.code-block .http-method {
    color: #ff7b72;
    font-weight: 600;
}

.code-block .header-key {
    color: #d19a66;
}

.code-block .header-value {
    color: #98c379;
}

.code-block .param-key {
    color: #e06c75;
}

.code-block .param-value {
    color: #98c379;
}

/* Related APIs */
.related-section {
    margin-top: 20px;
}

.related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.related-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.related-count {
    padding: 4px 10px;
    background: var(--input-bg);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.related-list {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.related-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    cursor: pointer;
}

.related-item:last-child {
    border-bottom: none;
}

.related-item:hover {
    background: var(--card);
}

.related-item .method-badge {
    flex-shrink: 0;
}

.related-item-name {
    flex: 1;
    font-size: 0.85rem;
}

.related-item-arrow {
    color: var(--text-muted);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 18px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    color: var(--primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--card-border);
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

/* Image Preview */
.image-preview {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 12px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.download-btn:hover {
    opacity: 0.9;
}

/* Audio/Video Preview */
.audio-preview,
.video-preview {
    width: 100%;
    border-radius: 8px;
    margin-top: 12px;
}

/* Binary File Preview */
.file-preview {
    text-align: center;
    padding: 20px;
}

.file-icon {
    font-size: 2.5rem;
    color: var(--blue);
    margin-bottom: 10px;
}

.file-name {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.file-info {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 14px;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--input-border);
}

/* Responsive */
@media (min-width: 640px) {
    .search-filter-bar {
        flex-direction: row;
    }

    .filter-dropdown {
        width: 180px;
    }
}

@media (max-width: 639px) {
    .header {
        padding: 12px 16px;
    }

    .main-content {
        padding: 16px;
    }

    .category-title {
        font-size: 1.3rem;
    }

    .sidebar {
        width: 100%;
        max-width: 320px;
    }

    /* API Card mobile fixes */
    .api-card {
        padding: 12px;
        gap: 8px;
    }

    .api-card-info {
        gap: 8px;
        min-width: 0;
    }

    .api-meta {
        gap: 6px;
    }

    .api-endpoint {
        max-width: 140px;
        font-size: 0.7rem;
    }

    .api-name {
        font-size: 0.85rem;
    }

    .play-btn {
        width: 32px;
        height: 32px;
    }
}

/* Mobile viewport fix */
@supports (height: 100dvh) {
    .test-panel {
        height: 100dvh;
    }
    
    .sidebar {
        height: 100dvh;
    }
}

/* Prevent zoom on input focus for iOS */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Ensure proper touch handling */
* {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* VIP/FREE/PREMIUM Badges */
.vip-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 4px; font-size: 10px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    flex-shrink: 0;
}
.vip-badge.free {
    background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3);
}
.vip-badge.user {
    background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3);
}
.vip-badge.premium {
    background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3);
}

/* ===== THEME SYSTEM ===== */
[data-theme="green"]  { --primary: #22c55e; --primary-glow: rgba(34,197,94,0.15); --success: #22c55e; }
[data-theme="orange"] { --primary: #f97316; --primary-glow: rgba(249,115,22,0.15); --success: #f97316; }
[data-theme="blue"]   { --primary: #3b82f6; --primary-glow: rgba(59,130,246,0.15); --success: #3b82f6; }
[data-theme="red"]    { --primary: #ef4444; --primary-glow: rgba(239,68,68,0.15); --success: #ef4444; }
[data-theme="purple"] { --primary: #a855f7; --primary-glow: rgba(168,85,247,0.15); --success: #a855f7; }
[data-theme="yellow"]{ --primary: #eab308; --primary-glow: rgba(