:root {
    --primary-color: #3f71f3;
    --secondary-color: #525252;
    --background-color: #ffffff;
    --text-color: #212529;
    --border-color: #dee2e6;
    --hover-color: #ffbf00;
    --code-bg: #f6f8fa;
    --panel-bg: #f8f9fa;
    --code-text: #24292e;
    --link-hover: #2d5cd4;
}

[data-theme="dark"] {
    --primary-color: #4284fb;
    --secondary-color: #9fc0e0;
    --background-color: #0e0f19;
    --text-color: #e1e8f0;
    --border-color: #2a2d40;
    --hover-color: #ffd43b;
    --code-bg: #181b2d;
    --panel-bg: #1e2235;
    --code-text: #e1e8f0;
    --link-hover: #6daae0;
}

body {
    font-family: "Poppins", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color) !important;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    padding: 2rem;
}

.button-link {
    display: inline-block;
    padding: 10px 20px;
    color: #fff;
    background: linear-gradient(135deg, #3f71f3, #5b8aff);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(63, 113, 243, 0.25);
}

.button-link:hover {
    background: linear-gradient(135deg, #2d5cd4, #3f71f3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(63, 113, 243, 0.4);
    color: #fff;
    text-decoration: none;
}

.button-link i {
    margin-right: 0.5rem;
}

.panel {
    background: var(--panel-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.panel-heading {
    background-color: var(--panel-bg);
    color: var(--text-color);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid var(--primary-color);
}

.panel-body {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.65;
}

.panel-body p {
    margin-bottom: 1rem;
}

.panel-body ul,
.panel-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.panel-body li {
    margin-bottom: 0.5rem;
}

.panel-body h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

pre {
    background-color: var(--code-bg);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    color: var(--code-text);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
    line-height: 1.5;
}

.alert {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border: none;
}

.alert-primary {
    background-color: rgba(66, 132, 251, 0.1);
    border-left: 4px solid var(--primary-color);
}

.alert-primary h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

[data-theme="dark"] .alert-primary {
    background-color: rgba(66, 132, 251, 0.15);
}

[data-theme="dark"] .alert-primary h4 {
    color: #e1e8f0;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(220, 53, 69, 0.12);
    border-left-color: #e05565;
    color: var(--text-color);
}

.table {
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

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

.table td,
.table th {
    padding: 0.75rem 1rem;
}

blockquote {
    background-color: var(--code-bg);
    border-left: 4px solid var(--primary-color);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
}

blockquote .code-block-wrapper {
    margin: 0;
}

blockquote pre {
    margin: 0;
    background: transparent;
    border: none;
    padding: 0;
}

[data-theme="dark"] pre {
    background-color: var(--code-bg);
    color: var(--code-text);
    border-color: var(--border-color);
}

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

[data-theme="dark"] blockquote {
    background-color: var(--code-bg);
    color: var(--code-text);
}

html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

.info-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.info-card i {
    font-size: 1.5em !important;
    margin-bottom: 0.4rem !important;
}

.info-card h4 {
    margin: 0.4rem 0;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.info-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--secondary-color);
    line-height: 1.4;
}

.info-card code {
    background: var(--code-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.toc-link {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.toc-link:hover {
    background: var(--code-bg);
    color: var(--link-hover);
    text-decoration: none;
    padding-left: 0.75rem;
}

[data-theme="dark"] .toc-link:hover {
    color: var(--link-hover);
}

.toc-link.active {
    background: rgba(66, 132, 251, 0.15);
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    padding-left: calc(0.5rem - 3px);
}

[data-theme="dark"] .toc-link.active {
    background: rgba(66, 132, 251, 0.2);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.toc-link i {
    margin-right: 0.5rem;
    width: 20px;
    display: inline-block;
}

.toc-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    background: rgba(66, 132, 251, 0.1);
}

.http-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    margin-right: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.http-get {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.http-post {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

@media (max-width: 992px) {
    #api-toc {
        display: none;
    }
}

.code-block-wrapper {
    position: relative;
}

.copy-button {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    opacity: 0.95;
}

.copy-button:hover {
    opacity: 1;
    background: var(--link-hover);
    color: white;
    transform: translateY(-50%) scale(1.02);
}

.copy-button:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.copy-button.copied {
    background: #10b981 !important;
    color: white !important;
    animation: copyPulse 0.3s ease;
}

@keyframes copyPulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
    100% { transform: translateY(-50%) scale(1); }
}

[data-theme="dark"] .copy-button {
    background: var(--primary-color);
}

[data-theme="dark"] .copy-button:hover {
    background: var(--link-hover);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

#backToTop {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #3f71f3, #5b8aff);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(63, 113, 243, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    font-size: 1.2em;
}

#backToTop:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(63, 113, 243, 0.5);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--code-bg);
}

.status-code-200 {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border-left: 4px solid #10b981;
}

.status-code-4xx {
    background-color: rgba(245, 158, 11, 0.1) !important;
    border-left: 4px solid #f59e0b;
}

.status-code-5xx {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border-left: 4px solid #ef4444;
}

#collapse1 {
    background-color: var(--background-color);
    color: var(--text-color);
    display: block !important;
    height: auto !important;
    overflow: visible !important;
}

.panel-default {
    background-color: var(--panel-bg);
    color: var(--text-color);
}

[data-theme="dark"] #collapse1,
[data-theme="dark"] .panel-default {
    background-color: var(--background-color);
    color: var(--text-color);
}

[data-theme="dark"] .panel-heading {
    background-color: var(--panel-bg);
    color: var(--text-color) !important;
    border-bottom: 2px solid var(--primary-color);
}

.skip-links {
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 9999;
}

.skip-links a {
    display: inline-block;
    padding: 12px 24px;
    background-color: #3c5fec;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: top 0.2s ease;
}

.skip-links a:focus {
    position: fixed;
    top: 0;
    left: 20px;
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

[data-theme="dark"] .skip-links a {
    background-color: #1e2235;
}

.sr-only-caption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.breadcrumb-nav {
    background-color: var(--code-bg);
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-nav ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
}

.breadcrumb-nav li {
    display: flex;
    align-items: center;
}

.breadcrumb-nav li:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: var(--secondary-color);
}

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

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.breadcrumb-nav .current {
    color: var(--secondary-color);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .panel-body {
        padding: 1rem;
    }

    .info-card {
        padding: 1rem;
    }

    .info-card h4 {
        font-size: 0.9rem;
    }

    .info-card p {
        font-size: 0.8rem;
    }

    pre {
        padding: 0.75rem;
        font-size: 0.75rem;
        max-width: 100%;
        word-wrap: break-word;
    }

    blockquote {
        padding: 0.5rem 0.75rem;
    }

    blockquote pre {
        font-size: 0.7rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table td,
    .table th {
        padding: 0.5rem;
    }

    .alert {
        padding: 0.75rem 1rem;
    }

    .alert-primary h4 {
        font-size: 0.9rem;
    }

    .http-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    h1 {
        font-size: 1.4rem !important;
    }

    h2 {
        font-size: 1.2rem !important;
    }

    .panel-heading {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .breadcrumb-nav {
        padding: 0.5rem 1rem;
    }

    .breadcrumb-nav ol {
        font-size: 0.8rem;
    }

    #backToTop {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 992px) {
    .mobile-toc {
        display: block;
        background: var(--panel-bg);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .mobile-toc-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--primary-color);
    }

    .mobile-toc-toggle::after {
        content: '\f078';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 0.8rem;
        transition: transform 0.3s ease;
    }

    .mobile-toc.expanded .mobile-toc-toggle::after {
        transform: rotate(180deg);
    }

    .mobile-toc-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .mobile-toc.expanded .mobile-toc-content {
        max-height: 500px;
        margin-top: 1rem;
    }

    .mobile-toc-content ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .mobile-toc-content .toc-link {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

@media (min-width: 993px) {
    .mobile-toc {
        display: none;
    }
}

@media (max-width: 480px) {
    .mobile-toc-content ul {
        grid-template-columns: 1fr;
    }

    .button-link {
        display: block;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .info-card i {
        font-size: 1.2em !important;
    }
}
