/* Modern Documentation Style */

:root {
    --primary-color: #135571;
    --primary-dark: #0d3d52;
    --primary-light: #1a6b8c;
    --accent-color: #26abe2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-code: #1e293b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    
    --sidebar-width: 280px;
    --navbar-height: 64px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    --transition: all 0.2s ease;
}

/* Dark mode variables */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-code: #1e293b;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #334155;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-top: 3rem; }
h3 { font-size: 1.5rem; margin-top: 2rem; }
h4 { font-size: 1.25rem; margin-top: 1.5rem; }

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

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-brand .logo {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Home Link - Simple Modern Design */
.home-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.home-link:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
    transform: translateX(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.home-link i {
    font-size: 1rem;
    opacity: 0.8;
}

.home-link:hover i {
    opacity: 1;
}

/* Dark theme adjustments */
[data-theme="dark"] .home-link {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .home-link:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Search Bar */
.search-container {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem !important;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(38, 171, 226, 0.1);
}

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

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

/* Language Selector */
.lang-selector {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    transition: var(--transition);
    z-index: 999;
}

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

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

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-left-color: var(--accent-color);
}

.sidebar-link.active {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    font-weight: 500;
    border-left-color: var(--primary-color);
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    position: fixed;
    top: var(--navbar-height);
    left: var(--sidebar-width);
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 998;
    transition: var(--transition);
}

.breadcrumb-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.breadcrumb {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-item i {
    margin-right: 0.25rem;
}

/* Reading Progress */
.reading-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    width: 120px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--navbar-height) + 60px);
    min-height: 100vh;
    transition: var(--transition);
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Endpoint Card */
.endpoint-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1.5rem 0;
}

.endpoint-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
}

.method {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Lead text */
.lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Payment Methods Grid */
.payment-methods-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.payment-methods-grid .badge {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Method badge for endpoints */
.method.post { background: var(--success-color); }
.method.get { background: var(--accent-color); }
.method.put { background: var(--warning-color); }
.method.delete { background: var(--danger-color); }

/* Code Blocks */
pre {
    background: var(--bg-code);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
}

pre code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Copy Button */
.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.copy-button:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-tertiary);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}

.alert-info {
    background: rgba(38, 171, 226, 0.1);
    border: 1px solid rgba(38, 171, 226, 0.2);
    color: var(--accent-color);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

/* Tabs */
.tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tabs-list {
    display: flex;
    gap: 1rem;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

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

.tab-button.active {
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Footer */
.footer {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 1rem;
    }
    
    .search-container {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .breadcrumb-nav {
        left: 0;
        height: 50px;
    }
    
    .breadcrumb-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        justify-content: center;
    }
    
    .reading-progress {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .progress-bar {
        flex: 1;
        margin-right: 1rem;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: calc(var(--navbar-height) + 50px);
    }
    
    .footer {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 2rem 1rem;
    }
}

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

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

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

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

/* Loading Animation */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.8s linear infinite;
}

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

/* Search highlights */
.search-highlight {
    background: var(--accent-color);
    color: white;
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* No results message */
.no-results-message {
    margin: 2rem 0;
}

/* Enhanced copy button positioning */
.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    opacity: 0.8;
}

.copy-button:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    opacity: 1;
}

.copy-button.copied {
    background: var(--success-color);
    color: white;
    opacity: 1;
}

/* Better mobile experience for search */
@media (max-width: 768px) {
    .search-container {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .navbar-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .navbar-container {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    
    .navbar {
        height: auto;
        padding: 0;
    }
    
    .main-content {
        padding-top: calc(var(--navbar-height) + 3rem);
    }
}

/* API Explorer Styles */
.api-config-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input, .form-select, .form-control, input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"], textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.form-input:focus, .form-select:focus, .form-control:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(38, 171, 226, 0.1);
}

.form-input[readonly] {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.toggle-visibility {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    margin-top: 0.75rem;
}

.toggle-visibility:hover {
    color: var(--text-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-generate {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    margin-top: 0.75rem;
}

.btn-generate:hover {
    background: var(--primary-light);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    text-decoration: none;
}

.api-test-container {
    margin: 2rem 0;
}

.api-form-container {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-top: 1rem;
}

.tab-content {
    display: none;
}

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

.api-response-container {
    margin: 2rem 0;
}

.response-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.response-tab {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.response-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.response-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.api-response {
    position: relative;
    background: var(--bg-code);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.api-response pre {
    margin: 0;
    background: transparent;
}

.api-response .copy-button {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.api-response .copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* Loading spinner for API calls */
.api-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.api-loading .loading {
    width: 1rem;
    height: 1rem;
}

/* Responsive adjustments for API explorer */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .response-tabs {
        flex-wrap: wrap;
    }
    
    .api-form-container {
        padding: 1rem;
    }
}

/* Heading anchors */
.heading-anchor {
    opacity: 0;
    margin-left: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8em;
    text-decoration: none;
    transition: var(--transition);
}

h1:hover .heading-anchor,
h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor,
h5:hover .heading-anchor,
h6:hover .heading-anchor {
    opacity: 1;
}

.heading-anchor:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Anchor tooltip */
.anchor-tooltip {
    position: fixed;
    background: var(--bg-code);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    z-index: 9999;
    transform: translateX(-50%);
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(5px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-5px); }
}

/* Floating Table of Contents */
.floating-toc {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    max-width: 250px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 997;
    box-shadow: var(--shadow-lg);
    opacity: 0.9;
    transition: var(--transition);
}

.floating-toc:hover {
    opacity: 1;
}

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

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-link {
    display: block;
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    line-height: 1.4;
}

.toc-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
}

.toc-link.active {
    background: var(--primary-color);
    color: white;
}

.toc-item.level-2 .toc-link {
    padding-left: 1rem;
}

.toc-item.level-3 .toc-link {
    padding-left: 1.5rem;
    font-size: 0.7rem;
}

/* TOC Header and Toggle */
.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.toc-header h4 {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.toc-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.toc-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(38, 171, 226, 0.2);
}

/* TOC Content and Collapsed State */
.toc-content {
    transition: var(--transition);
    overflow: hidden;
}

.floating-toc.collapsed .toc-content {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.floating-toc.collapsed {
    padding: 1rem 1rem 0.5rem 1rem;
}

.floating-toc.collapsed .toc-header {
    margin-bottom: 0.5rem;
    border-bottom: none;
}

/* TOC Count */
.toc-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: 0.25rem;
}

/* API Tester Specific Styles */
.api-tester {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1rem;
}

.api-tester .form-group {
    margin-bottom: 1rem;
}

.api-tester label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.api-tester input,
.api-tester textarea,
.api-tester select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: var(--transition);
    resize: vertical;
}

.api-tester input:focus,
.api-tester textarea:focus,
.api-tester select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(38, 171, 226, 0.1);
}

.api-tester textarea {
    min-height: 100px;
    resize: vertical;
}

.api-tester button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.api-tester button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.api-tester button:active {
    transform: translateY(0);
}

.test-result {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}

.test-result h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.test-result pre {
    background: var(--bg-code);
    color: var(--text-inverse);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 0;
    overflow-x: auto;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Hide floating TOC on mobile */
@media (max-width: 1200px) {
    .floating-toc {
        display: none;
    }
}

/* Keyboard shortcuts help */
.keyboard-shortcuts {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.75rem;
    opacity: 0.7;
    z-index: 996;
    transition: var(--transition);
}

.keyboard-shortcuts:hover {
    opacity: 1;
}

.keyboard-shortcuts kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 0.125rem 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* Hide keyboard shortcuts on mobile */
@media (max-width: 768px) {
    .keyboard-shortcuts {
        display: none;
    }
}

/* Keyboard Help Modal */
.keyboard-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.shortcut-grid {
    display: grid;
    gap: 1rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.shortcut-item kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    min-width: 2rem;
    text-align: center;
}

.shortcut-item span {
    color: var(--text-secondary);
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}