@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Thai:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Core Colors */
    --primary: #5b50e6;
    --primary-light: #8f86ff;
    --primary-dark: #3f35bd;
    --accent: #0ea5a4;

    --bg-body: #f5f7fb;
    --bg-surface: #ffffff;
    --bg-sidebar: rgba(255, 255, 255, 0.92);

    --text-main: #25324a;
    --text-muted: #65738b;
    --text-light: #94a3b8;

    --border-color: #e2e7f0;
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 24px rgb(15 23 42 / 0.04);
    --shadow-md: 0 14px 34px rgb(35 41 70 / 0.10);
    --shadow-lg: 0 24px 64px rgb(35 41 70 / 0.14);

    /* Methods */
    --method-get-bg: #dcfce7;
    --method-get-text: #166534;
    --method-post-bg: #dbeafe;
    --method-post-text: #1e40af;
    --method-put-bg: #fef9c3;
    --method-put-text: #854d0e;
    --method-delete-bg: #fee2e2;
    --method-delete-text: #991b1b;
    --method-view-bg: #f3e8ff;
    --method-view-text: #6b21a8;

    /* Sizes */
    --sidebar-width: 300px;
    --header-height: 72px;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-body: #0b1120;
    --bg-surface: #151e31;
    --bg-sidebar: rgba(11, 17, 32, 0.95);

    --text-main: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-light: #64748b;

    --border-color: #2a3850;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);

    --method-get-bg: #14532d;
    --method-get-text: #dcfce7;
    --method-post-bg: #1e3a8a;
    --method-post-text: #dbeafe;
    --method-delete-bg: #7f1d1d;
    --method-delete-text: #fee2e2;
}

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

html.scroll-smooth {
    scroll-behavior: smooth;
}

button,
input {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(91, 80, 230, 0.24);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    background:
        radial-gradient(circle at 82% 6%, rgba(91, 80, 230, 0.08), transparent 28rem),
        var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* Layout Grid */
.app-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 0 28px;
    transition: background 0.3s;
}

body.dark-mode .main-header {
    background: rgba(15, 23, 42, 0.8);
}

.header-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

.brand-subtitle {
    display: block;
    margin-top: 1px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #766cff 0%, #4f46d8 62%, #3930a8 100%);
    border-radius: 12px 12px 12px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 9px 22px rgba(79, 70, 229, 0.28);
    position: relative;
    isolation: isolate;
}

.brand-icon::before {
    content: '';
    position: absolute;
    inset: 5px;
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px 8px 8px 3px;
}

.brand-icon-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 5px;
    height: 5px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    background: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.14);
}

.header-actions,
.language-switcher {
    display: flex;
    align-items: center;
}

.header-actions {
    gap: 10px;
}

.language-switcher {
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-body);
}

.language-button {
    min-width: 42px;
    padding: 6px 10px;
    border: 0;
    border-radius: 7px;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    transition: 160ms ease;
}

.language-button:hover {
    color: var(--text-main);
}

.language-button.active {
    color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.theme-toggle {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-muted);
    background: var(--bg-surface);
    cursor: pointer;
    transition: 160ms ease;
}

.theme-toggle:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

.version-badge {
    padding: 7px 10px;
    border: 1px solid rgba(91, 80, 230, 0.14);
    border-radius: 8px;
    color: var(--primary);
    background: rgba(91, 80, 230, 0.07);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(18px);
    overflow-y: auto;
    padding: 20px 0 32px;
    z-index: 40;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-content {
    padding: 0 18px;
}

.sidebar-search {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    padding: 0 11px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    color: var(--text-light);
    background: var(--bg-body);
    transition: 160ms ease;
}

.sidebar-search:focus-within {
    border-color: rgba(91, 80, 230, 0.45);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(91, 80, 230, 0.08);
}

.sidebar-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--text-main);
    background: transparent;
    font-size: 0.82rem;
}

.sidebar-search input::placeholder {
    color: var(--text-light);
}

.sidebar-search kbd {
    padding: 1px 6px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-light);
    background: var(--bg-surface);
    font-size: 0.68rem;
}

.search-empty {
    margin: -8px 0 18px;
    padding: 10px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.78rem;
}

.nav-category {
    margin-bottom: 20px;
}

.category-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    font-weight: 700;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.category-title:hover {
    background: rgba(0, 0, 0, 0.03);
}

body.dark-mode .category-title:hover {
    background: rgba(255, 255, 255, 0.05);
}

.category-items {
    display: block;
    transition: all 0.3s ease;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 9px;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(91, 80, 230, 0.06);
    color: var(--primary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(91, 80, 230, 0.13), rgba(91, 80, 230, 0.06));
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

body.dark-mode .nav-item:hover {
    background: rgba(79, 70, 229, 0.2);
    color: var(--primary-light);
}

body.dark-mode .nav-item.active {
    background: rgba(79, 70, 229, 0.3);
    color: var(--primary-light);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 44px clamp(24px, 4vw, 64px) 56px;
    max-width: 100%;
    min-width: 0;
    /* Fix flex child overflow */
}

.main-content > section,
#page-navigation {
    width: min(100%, 1120px);
    margin-left: auto;
    margin-right: auto;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* API Cards */
.api-card {
    background: var(--bg-surface);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: clamp(24px, 3vw, 40px);
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.api-title {
    font-size: clamp(1.55rem, 2.1vw, 2rem);
    font-weight: 750;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.2;
}

.api-desc {
    color: var(--text-muted);
    font-size: 1rem;
}

.api-description {
    max-width: 860px;
    margin-top: 14px;
}

.api-description-lead {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.api-description-lead i {
    margin-top: 5px;
    color: var(--primary);
}

.api-description-label {
    margin: 18px 0 9px;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.api-description-list {
    display: grid;
    gap: 8px;
    list-style: none;
}

.api-description-list li {
    display: grid;
    grid-template-columns: minmax(130px, auto) 1fr;
    align-items: start;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-body);
}

.api-description-list code {
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
}

.api-description-list span {
    color: var(--text-muted);
    line-height: 1.6;
}

.api-description-extra {
    margin-top: 10px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Method Badge */
.method-badge {
    padding: 7px 13px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.method-GET {
    background: var(--method-get-bg);
    color: var(--method-get-text);
}

.method-POST {
    background: var(--method-post-bg);
    color: var(--method-post-text);
}

.method-PUT {
    background: var(--method-put-bg);
    color: var(--method-put-text);
}

.method-DELETE {
    background: var(--method-delete-bg);
    color: var(--method-delete-text);
}

.method-VIEW {
    background: var(--method-view-bg);
    color: var(--method-view-text);
}

/* Endpoint URL Bar */
.endpoint-bar {
    background: linear-gradient(135deg, #172033, #1e2b43);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    overflow-x: auto;
}

.endpoint-method {
    color: #a59fff;
    font-weight: 700;
}

.endpoint-path {
    min-width: max-content;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

/* Parameters Table */
.params-table {
    width: 100%;
    margin-bottom: 28px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.params-table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-body);
}

.params-table td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-main);
    vertical-align: top;
}

.params-table tr:last-child td {
    border-bottom: 0;
}

.param-example {
    display: inline-block;
    max-width: 100%;
    margin: 0 0 5px;
    padding: 4px 7px;
    border-radius: 6px;
    color: var(--text-main);
    background: var(--bg-body);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.param-desc {
    display: block;
    line-height: 1.6;
}

.signature-notice {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin: 0 0 26px;
    padding: 16px 18px;
    border: 1px solid rgba(217, 119, 6, 0.28);
    border-radius: 12px;
    color: #854d0e;
    background: #fffbeb;
}

.signature-notice > i {
    margin-top: 3px;
    color: #d97706;
    font-size: 1.05rem;
}

.signature-notice strong {
    display: block;
    margin-bottom: 3px;
    color: #78350f;
}

.signature-notice p {
    line-height: 1.65;
}

body.dark-mode .signature-notice {
    border-color: rgba(245, 158, 11, 0.28);
    color: #fde68a;
    background: rgba(120, 53, 15, 0.28);
}

body.dark-mode .signature-notice strong {
    color: #fef3c7;
}

.param-name {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    font-weight: 600;
}

.param-desc {
    color: var(--text-muted);
}

/* Code Blocks & Tabs */
.code-section {
    margin-top: 24px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    /* Dark terminal bg */
}

.tab-header {
    background: #131d30;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    overflow-x: auto;
}

.code-tab {
    padding: 13px 18px;
    color: #94a3b8;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.code-tab:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.code-tab.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
}

.code-content {
    padding: 22px;
    color: #f1f5f9;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    position: relative;
    max-height: 400px;
    overflow-y: auto;
}

.code-content pre {
    margin: 0;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.request-meta {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.025);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Introduction/Docs Page Style */
.docs-paper {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: clamp(24px, 3vw, 40px);
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.docs-hero {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 50%),
        linear-gradient(135deg, #675cf0 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero-eyebrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.11);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.intro-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.summary-card {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-body);
}

.summary-card strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text-main);
    font-size: 1.08rem;
}

.summary-card span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.intro-panel {
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid rgba(91, 80, 230, 0.14);
    border-radius: 14px;
    background: rgba(91, 80, 230, 0.045);
}

.intro-panel-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 750;
}

.intro-panel-heading i {
    color: var(--primary);
}

.intro-panel p {
    color: var(--text-muted);
    line-height: 1.7;
}

.quick-start {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.quick-step {
    position: relative;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 13px;
    background: var(--bg-surface);
}

.quick-step-number {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 8px;
    color: white;
    background: var(--primary);
    font-size: 0.76rem;
    font-weight: 750;
}

.quick-step strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-main);
}

.quick-step p {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.6;
}

.base-url-panel {
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-body);
}

.base-url-code {
    padding: 15px 16px;
    border-radius: 10px;
    color: #e2e8f0;
    background: #172033;
    font-family: 'JetBrains Mono', monospace;
    overflow-x: auto;
}

.docs-hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image:
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    pointer-events: none;
}

.docs-section-hero {
    margin: 0;
    border-radius: 0;
}

.docs-body {
    padding: clamp(22px, 3vw, 40px);
}

.docs-content-panel {
    padding: clamp(20px, 2.6vw, 32px);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-body);
}

.docs-pre,
.docs-copy {
    margin: 0;
    color: var(--text-main);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: 'Inter', 'Noto Sans Thai', sans-serif;
    font-size: 0.95rem;
    line-height: 1.85;
}

.docs-copy img {
    border: 1px solid var(--border-color);
}

.page-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
    padding: 18px 22px;
}

.page-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 650;
    transition: 160ms ease;
}

.page-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.page-button-secondary {
    border: 1px solid var(--border-color);
    color: var(--text-main);
    background: var(--bg-body);
}

.page-button-primary {
    border: 1px solid var(--primary);
    color: white;
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(91, 80, 230, 0.2);
}

.page-button:not(:disabled):hover {
    transform: translateY(-1px);
}

.page-label {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.page-number {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 750;
}

/* Mobile Tweaks */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(2, 6, 23, 0.56);
    backdrop-filter: blur(2px);
}

/* Responsive - Mobile & Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 252px;
    }

    .sidebar {
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .main-header {
        padding: 0 16px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        /* Wider drawer on mobile */
        background: var(--bg-surface);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }

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

    .main-content {
        margin-left: 0;
        padding: 20px 16px;
        width: 100%;
    }

    .site-footer {
        margin-left: 0;
    }

    .api-card {
        padding: 16px;
        border-radius: 12px;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
    }

    .api-title {
        font-size: 1.1rem;
        word-break: break-word;
        /* Prevent long titles from overflowing */
    }

    .method-badge {
        font-size: 0.7rem;
        align-self: flex-start;
    }

    /* Navbar/Header fixes for mobile */
    .header-content {
        padding: 0 4px;
    }

    #api-title {
        font-size: 0.9rem;
    }

    .brand-subtitle {
        display: none;
    }

    #api-version {
        display: none;
        /* Hide version on mobile */
    }

    .brand-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    /* Icon fixes */
    .nav-item i,
    .category-toggle,
    .brand-icon i,
    .fa-spinner {
        flex-shrink: 0;
        /* Prevent icons from squeezing */
    }

    /* Docs Paper Mobile */
    .docs-paper {
        padding: 20px;
    }

    .docs-hero {
        padding: 20px;
    }

    .docs-hero h1 {
        font-size: 1.5rem !important;
    }

    .docs-hero h2 {
        font-size: 1.25rem !important;
    }

    .docs-hero p {
        font-size: 0.9rem !important;
    }

    .docs-hero i {
        font-size: 28px !important;
    }

    .intro-summary,
    .quick-start {
        grid-template-columns: 1fr;
    }

    .api-description-list li {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .footer-content {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px 20px;
    }
}

@media (max-width: 520px) {
    .header-actions {
        gap: 6px;
    }

    .language-button {
        min-width: 34px;
        padding-inline: 7px;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
    }

    .brand-icon {
        display: none;
    }

    .api-card,
    .docs-paper {
        padding: 18px;
    }

    .card-header {
        margin-bottom: 18px;
    }

    .endpoint-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .params-table th,
    .params-table td {
        padding: 11px;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading Overlay */
#loading {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
}

.loading-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: white;
    background: linear-gradient(145deg, #766cff, #4338ca);
    animation: loadingPulse 1.4s ease-in-out infinite;
    font-size: 1rem;
}

.loading-title {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 700;
}

.loading-subtitle {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

@keyframes loadingPulse {
    50% { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(91, 80, 230, 0.28); }
}

.site-footer {
    margin-left: var(--sidebar-width);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    background: var(--bg-surface);
}

.footer-content {
    width: min(100%, 1248px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
    padding: 28px 48px;
}

.footer-brand-row,
.footer-links,
.footer-links a {
    display: flex;
    align-items: center;
}

.footer-brand-row {
    gap: 9px;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 650;
}

.footer-brand > p {
    margin-top: 5px;
    font-size: 0.78rem;
}

.footer-links {
    gap: 8px;
}

.footer-links a {
    gap: 7px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
}

.footer-links a:hover {
    color: var(--primary);
    background: rgba(91, 80, 230, 0.06);
}

/* Utility Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Deprecated API Styles */
.api-card.deprecated {
    border: 2px solid #ef4444 !important;
    background: #fff5f5;
    position: relative;
    overflow: hidden;
}

.api-card.deprecated .card-header .api-title {
    color: #b91c1c;
    /* Removed text-decoration: line-through */
}

.deprecated-badge {
    background: #ef4444;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.deprecated-warning {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    font-weight: 500;
    gap: 12px;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}
