html {
    font-size: 14px;
    min-height: 100%;
    position: relative;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; }

body { margin-bottom: 60px; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { text-align: start; }

/* API Documentation styles */

.api-section { padding: 1rem 0; }

.api-intro {
    background-color: #f8f9fa;
    border-left: 4px solid #0d6efd;
    border-radius: 0.25rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.api-info { margin-bottom: 2rem; }

.tag-section {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

/* Game-specific API documentation styles */

.game-banner img {
    max-height: 400px;
    object-fit: cover;
    width: 100%;
}

/* Code and parameter styling */

pre {
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    margin: 1rem 0;
    overflow-x: auto;
    padding: 1rem;
}

code {
    background-color: #000000;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 0.25rem;
    color: #d63384;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875em;
    padding: 0.2rem 0.4rem;
}

pre code {
    background-color: transparent;
    color: #212529;
    padding: 0;
}

/* Method badges */

.badge.bg-info { background-color: #0dcaf0 !important; }

.badge.bg-success { background-color: #198754 !important; }

.badge.bg-warning { background-color: #ffc107 !important; }

.badge.bg-danger { background-color: #dc3545 !important; }

.badge.bg-dark { background-color: #212529 !important; }

.card-header code {
    font-size: 1rem;
    word-break: break-word;
}

.badge {
    font-size: 0.85rem;
    min-width: 60px;
    text-align: center;
}

#api-docs-container { counter-reset: section; }

.tag-section h3:before {
    content: counter(section) ". ";
    counter-increment: section;
}

@media print {
    .navbar, .footer, #exportPdf { display: none !important; }

    body {
        margin: 0;
        padding: 0;
    }

    .container {
        margin: 0;
        max-width: 100%;
        padding: 0;
        width: 100%;
    }
}

/* Dark mode refinements */

[data-bs-theme="dark"] .api-intro {
    background-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: #0d6efd;
}

/* Only apply dark pre styles to general pre elements, not API documentation examples */
[data-bs-theme="dark"] pre:not(.bg-light):not(.bg-dark) {
    background-color: #212529 !important;
    color: #e9ecef;
}

/* Specific styles for API documentation code blocks in dark mode */
[data-bs-theme="dark"] .bg-light {
    background-color: #343a40 !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .bg-dark {
    background-color: #000000 !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .text-light {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .footer {
    border-top-color: #ffffff !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] code {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f8f9fa;
}

[data-bs-theme="dark"] pre code {
    background-color: transparent;
    color: inherit;
}

/* Theme toggle button styles */

#theme-toggle {
    align-items: center;
    border-radius: 50%;
    display: flex;
    height: 40px;
    justify-content: center;
    padding: 0.25rem;
    width: 40px;
}

#theme-toggle i { font-size: 1.25rem; }

/* Custom confirm modal styling */

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px #000000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
}

.modal-body { padding: 1.5rem; }

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

/* Add some animation */

.modal.fade .modal-dialog {
    transform: scale(0.8);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog { transform: scale(1); }

/* API Documentation theme-aware styles */
.api-example-box {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-body-color, #212529);
}

.api-curl-box {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-body-color, #212529);
}

/* Theme-specific overrides */
[data-bs-theme="dark"] .api-example-box .api-curl-box {
    background-color: var(--bs-dark, #212529);
    color: var(--bs-light, #f8f9fa);
    border-color: var(--bs-border-color, #495057) !important;
}

[data-bs-theme="light"] .api-example-box .api-curl-box {
    background-color: var(--bs-light, #f8f9fa);
    color: var(--bs-dark, #212529);
    border-color: var(--bs-border-color, #dee2e6) !important;
}

/* Ensure code blocks have proper contrast */
.api-example-box pre,
.api-curl-box pre {
    color: inherit;
    background: transparent;
}