/* =============================================================================
   API Documentation Shared Styles
   Generated from inline styles in api_hub/docs/*.html templates
   ============================================================================= */

/* ----- RESET & GLOBAL ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f7f9fc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #0a2540;
    line-height: 1.5;
}

/* Hide any global nav that might interfere */
.navbar, .main-header, .breadcrumb, .user-menu {
    display: none !important;
}

/* ----- SIDEBAR (modern glass-morphism) ----- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(145deg, #0f172ad9 0%, #0a0f1fe6 100%);
    backdrop-filter: blur(4px);
    background-color: #0f172a;
    color: #e2e8f0;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid rgba(59,130,246,0.2);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: 8px 0 32px rgba(0,0,0,0.08);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* custom scroll */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: #1e293b;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 6px;
}

/* Logo area */
.sidebar-header {
    padding: 28px 24px 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 24px;
}
.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c084fc, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
}
.sidebar-header p {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 6px;
}

.nav-links {
    list-style: none;
    padding: 0 16px;
    margin: 0;
}

.nav-links li {
    margin-bottom: 6px;
}

.nav-links a {
    color: #cbd5e6;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    letter-spacing: -0.2px;
    cursor: pointer;
}

.nav-links a i {
    width: 22px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-links a:hover {
    background: rgba(59, 130, 246, 0.15);
    color: white;
    transform: translateX(4px);
}

.nav-links a.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 6px 12px -6px rgba(59,130,246,0.4);
}

/* ----- MAIN CONTENT (modern spacious) ----- */
.main-content {
    margin-left: 280px;
    padding: 40px 56px 80px 56px;
    max-width: 1300px;
    background: #f7f9fc;
    transition: margin 0.3s;
}

.main-content.expanded {
    margin-left: 80px;
}

/* hero header */
.hero {
    margin-bottom: 48px;
    position: relative;
}
.hero-badge {
    display: inline-block;
    background: rgba(59,130,246,0.12);
    backdrop-filter: blur(2px);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 20px;
    border: 1px solid rgba(59,130,246,0.2);
}
.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(145deg, #0f2b3d, #1e3a5f);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}
.hero p {
    font-size: 1.2rem;
    color: #334155;
    max-width: 680px;
    line-height: 1.5;
}

/* hero buttons */
.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 8px 16px -6px rgba(59,130,246,0.4);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -6px rgba(59,130,246,0.5);
}
.hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: #374151;
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    transition: all 0.2s;
    cursor: pointer;
    font-family: inherit;
}
.hero-btn-secondary:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* card sections */
.section {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(0px);
    border-radius: 32px;
    box-shadow: 0 8px 28px -8px rgba(0,0,0,0.05), 0 0 0 1px rgba(0,0,0,0.01);
    margin-bottom: 40px;
    padding: 32px 36px;
    transition: all 0.2s;
    border: 1px solid #eef2f6;
}

.section:hover {
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.08);
    border-color: #e2e8f0;
}

.section h2 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: #0f172a;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-left: 5px solid #3b82f6;
    padding-left: 20px;
}
.section h2 i {
    color: #3b82f6;
    font-size: 1.8rem;
}
.section h3 {
    font-weight: 600;
    font-size: 1.3rem;
    margin: 24px 0 16px 0;
    color: #1e293b;
}

.section p {
    color: #334155;
    line-height: 1.6;
    font-size: 1rem;
}

/* endpoint cards modern */
.endpoint-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 16px 0 8px;
}
.endpoint-card {
    background: #f1f5f9;
    border-radius: 20px;
    padding: 18px 24px;
    flex: 1 1 240px;
    border-left: 4px solid #3b82f6;
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
    transition: 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.endpoint-card strong {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 700;
    color: #0f172a;
    display: block;
    margin-bottom: 8px;
}
.endpoint-card code {
    background: none;
    font-size: 0.8rem;
    color: #2563eb;
    word-break: break-word;
}

/* method badges */
.method-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 40px;
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    letter-spacing: 0.3px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}
.method-post {
    background: rgba(139,92,246,0.15);
    color: #7c3aed;
    border: 1px solid rgba(139,92,246,0.4);
}
.method-get {
    background: rgba(16,185,129,0.15);
    color: #059669;
    border: 1px solid rgba(16,185,129,0.4);
}

.endpoint-path {
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    color: #2563eb;
    word-break: break-word;
    vertical-align: middle;
}

.param-list {
    margin: 8px 0 8px 0;
    padding-left: 20px;
    color: #475569;
    font-size: 0.95rem;
}
.param-list li {
    margin: 4px 0;
}
.param-list code {
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
    color: #2563eb;
}

/* tables polished */
.param-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.param-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #0f172a;
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.param-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #ecf3f9;
    color: #1e2a3e;
    font-size: 0.9rem;
}
.param-table tr:last-child td {
    border-bottom: none;
}
.param-table td code {
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.85rem;
    color: #2563eb;
}

/* code blocks with modern glass */
.code-block {
    background: #0f172a;
    border-radius: 24px;
    padding: 0;
    margin: 16px 0;
    position: relative;
    overflow: hidden;
    transition: 0.2s;
    border: 1px solid #2d3a5e;
}
.code-block h4 {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    padding: 12px 20px;
    border-bottom: 1px solid #2d3a5e;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.code-block h4::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    margin-right: 10px;
}
.code-block pre {
    margin: 0;
    background: transparent;
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 20px;
    overflow-x: auto;
}
.code-block code {
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    color: #e2e8f0;
    background: none;
}

/* copy icon */
.copy-icon {
    position: absolute;
    top: 14px;
    left: 16px;
    cursor: pointer;
    color: #94a3b8;
    background: #1e293b;
    padding: 8px 10px;
    border-radius: 40px;
    transition: all 0.2s;
    z-index: 15;
    font-size: 0.85rem;
}
.copy-icon:hover {
    background: #3b82f6;
    color: white;
}

/* Adjust header to accommodate left copy icon */
.code-block h4 {
    padding-left: 50px;
}

/* tabs */
.tab-bar {
    display: flex;
    gap: 4px;
    margin: 16px 0 0;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.tab-btn {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    white-space: nowrap;
}
.tab-btn:hover {
    color: #2563eb;
    background: rgba(59,130,246,0.06);
}
.tab-btn.tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* alert boxes */
.alert {
    border-radius: 20px;
    padding: 18px 22px;
    margin: 18px 0;
    border: 1px solid;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.alert i {
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.alert-warning {
    background: rgba(245,158,11,0.08);
    border-color: rgba(245,158,11,0.35);
}
.alert-warning i { color: #f59e0b; }
.alert-info {
    background: rgba(59,130,246,0.08);
    border-color: rgba(59,130,246,0.35);
}
.alert-info i { color: #3b82f6; }
.alert-critical {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.35);
}
.alert-critical i { color: #ef4444; }
.alert strong {
    color: #0f172a;
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}
.alert p {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* steps */
.step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 18px 0;
}
.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.35);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}
.step-content {
    flex: 1;
}
.step-content h4 {
    color: #0f172a;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 1.05rem;
}
.step-content p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 4px 0;
}
.step-content a {
    color: #2563eb;
    text-decoration: underline;
}

/* status code list */
.status-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    padding: 14px 20px;
    border-radius: 24px;
    border: 1px solid #eef2f6;
    transition: all 0.2s;
}
.status-item:hover {
    border-color: #e2e8f0;
    box-shadow: 0 6px 14px -6px rgba(0,0,0,0.08);
}
.status-item code {
    font-family: ui-monospace, 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-weight: 700;
    color: #2563eb;
    font-size: 0.95rem;
}
.status-item span {
    color: #475569;
    font-size: 0.9rem;
}

.limitation-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 20px 0 8px;
}
.limitation-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    padding: 14px 20px;
    border-radius: 24px;
    transition: 0.1s;
}
.limitation-item i {
    font-size: 1.4rem;
    width: 32px;
    color: #3b82f6;
}

/* mobile */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 102;
    background: rgba(15,23,42,0.9);
    border: none;
    border-radius: 60px;
    padding: 14px 18px;
    color: white;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    cursor: pointer;
    backdrop-filter: blur(8px);
}

@media (max-width: 880px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 24px 20px;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .section {
        padding: 24px 20px;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
}
@media (max-width: 480px) {
    .param-table th, .param-table td {
        padding: 12px 12px;
    }
    .code-block {
        font-size: 0.7rem;
    }
}

/* API-specific customizations (extend in individual templates) */
.api-docs-header {
    --sidebar-icon: var(--api-icon, fa-file-alt);
    --sidebar-title: var(--api-title, API Documentation);
    --sidebar-subtitle: var(--api-subtitle, v1);
    --hero-badge-icon: var(--api-badge-icon, fa-file-alt);
    --hero-badge-text: var(--api-badge-text, API Documentation);
    --hero-title: var(--api-hero-title, API Documentation);
    --hero-description: var(--api-hero-desc, Documentation for the API);
    --hero-primary-url: var(--api-try-url, #);
    --hero-primary-text: var(--api-try-text, Try it now);
    --hero-secondary-url: var(--api-back-url, #);
    --hero-secondary-text: var(--api-back-text, Back to API Hub);
}