/* ============================================================
   NoteStake — Casino Dark Theme
   Brand: Amber/Gold #F59E0B · Violet #7C3AED
   ============================================================ */

/* --- Bootstrap CSS Variable Overrides --- */
[data-bs-theme="dark"] {
    --bs-body-bg: #14171f;
    --bs-body-color: #E5E7EB;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;

    --bs-primary: #F59E0B;
    --bs-primary-rgb: 245, 158, 11;
    --bs-secondary: #7C3AED;
    --bs-secondary-rgb: 124, 58, 237;
    --bs-success: #10B981;
    --bs-success-rgb: 16, 185, 129;
    --bs-danger: #EF4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-warning: #F59E0B;
    --bs-warning-rgb: 245, 158, 11;
    --bs-info: #7C3AED;
    --bs-info-rgb: 124, 58, 237;
    --bs-light: #1F2937;
    --bs-light-rgb: 31, 41, 55;
    --bs-dark: #F9FAFB;
    --bs-dark-rgb: 249, 250, 251;

    --bs-card-bg: #1F2937;
    --bs-card-border-color: rgba(245, 158, 11, 0.1);
    --bs-border-color: #374151;

    --bs-tertiary-bg: #111827;
    --bs-secondary-bg: #1F2937;
    --bs-emphasis-color: #F9FAFB;

    --bs-link-color: #F59E0B;
    --bs-link-hover-color: #FBBF24;

    --bs-modal-bg: #1F2937;
    --bs-modal-border-color: #374151;
    --bs-modal-header-border-color: #374151;
    --bs-modal-footer-border-color: #374151;

    --bs-dropdown-bg: #1F2937;
    --bs-dropdown-border-color: #374151;
    --bs-dropdown-link-color: #E5E7EB;
    --bs-dropdown-link-hover-bg: rgba(245, 158, 11, 0.1);
    --bs-dropdown-link-hover-color: #F59E0B;
    --bs-dropdown-link-active-bg: rgba(245, 158, 11, 0.2);
    --bs-dropdown-link-active-color: #F59E0B;
    --bs-dropdown-divider-bg: #374151;

    --bs-tooltip-bg: #374151;
    --bs-tooltip-color: #E5E7EB;

    --bs-popover-bg: #1F2937;
    --bs-popover-border-color: #374151;
    --bs-popover-header-bg: #111827;
    --bs-popover-body-color: #E5E7EB;

    --bs-accordion-bg: #1F2937;
    --bs-accordion-border-color: #374151;
    --bs-accordion-btn-color: #E5E7EB;
    --bs-accordion-btn-bg: #1F2937;
    --bs-accordion-active-bg: rgba(245, 158, 11, 0.08);
    --bs-accordion-active-color: #F59E0B;

    --bs-pagination-bg: #1F2937;
    --bs-pagination-border-color: #374151;
    --bs-pagination-color: #9CA3AF;
    --bs-pagination-hover-bg: rgba(245, 158, 11, 0.1);
    --bs-pagination-hover-color: #F59E0B;
    --bs-pagination-hover-border-color: #4B5563;
    --bs-pagination-active-bg: #F59E0B;
    --bs-pagination-active-border-color: #F59E0B;
    --bs-pagination-active-color: #0D0D0D;
    --bs-pagination-disabled-bg: #111827;
    --bs-pagination-disabled-color: #4B5563;
    --bs-pagination-disabled-border-color: #374151;

    --bs-progress-bg: #374151;
    --bs-progress-bar-bg: #F59E0B;

    --bs-toast-bg: #1F2937;
    --bs-toast-border-color: #374151;
    --bs-toast-header-bg: #111827;
    --bs-toast-header-color: #E5E7EB;

    --bs-offcanvas-bg: #1F2937;
    --bs-offcanvas-border-color: #374151;
    --bs-offcanvas-color: #E5E7EB;
}

/* --- Global --- */
html, body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #14171f;
    color: #E5E7EB;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: #F9FAFB;
    font-weight: 700;
}

.font-mono, .ns-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* --- Primary Buttons --- */
.btn-primary {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    border: none;
    color: #0D0D0D;
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    color: #0D0D0D;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}
.btn-primary:active {
    background: #D97706 !important;
    color: #0D0D0D !important;
}

.btn-outline-primary {
    color: #F59E0B;
    border-color: #F59E0B;
}
.btn-outline-primary:hover {
    background: #F59E0B;
    color: #0D0D0D;
}

/* --- Secondary / Violet Buttons --- */
.btn-info, .btn-secondary {
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    border: none;
    color: #fff;
    font-weight: 600;
}
.btn-info:hover, .btn-secondary:hover {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
    color: #fff;
}

.btn-outline-secondary {
    color: #9CA3AF;
    border-color: #4B5563;
}
.btn-outline-secondary:hover {
    background: #374151;
    color: #E5E7EB;
    border-color: #6B7280;
}

/* --- Success / Danger buttons --- */
.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    border: none;
    font-weight: 600;
}
.btn-success:hover {
    background: linear-gradient(135deg, #34D399, #10B981);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    border: none;
    font-weight: 600;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #F87171, #EF4444);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    border: none;
    color: #0D0D0D;
    font-weight: 600;
}

/* --- Cards --- */
.card {
    background: #1F2937;
    border: 1px solid rgba(245, 158, 11, 0.08);
    border-radius: 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
    border-color: rgba(245, 158, 11, 0.2);
}
.card.cursor-pointer:hover {
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.1);
    cursor: pointer;
}

.card-header {
    background: rgba(245, 158, 11, 0.05);
    border-bottom: 1px solid rgba(245, 158, 11, 0.1);
    font-weight: 600;
}

.card-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #374151;
}

/* --- Forms --- */
.form-control, .form-select {
    background: #111827;
    border: 1px solid #374151;
    color: #E5E7EB;
}
.form-control:focus, .form-select:focus {
    background: #111827;
    border-color: #F59E0B;
    color: #E5E7EB;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15);
}
.form-control::placeholder {
    color: #6B7280;
}
.form-label {
    color: #9CA3AF;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-check-input {
    background-color: #1F2937;
    border-color: #4B5563;
}
.form-check-input:checked {
    background-color: #F59E0B;
    border-color: #F59E0B;
}
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15);
    border-color: #F59E0B;
}

/* --- Tables --- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: #E5E7EB;
    --bs-table-border-color: #374151;
    --bs-table-striped-bg: rgba(245, 158, 11, 0.03);
    --bs-table-hover-bg: rgba(245, 158, 11, 0.06);
}
.table thead th {
    color: #F59E0B;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(245, 158, 11, 0.2);
}

/* --- Badges --- */
.badge.bg-primary { background: #F59E0B !important; color: #0D0D0D; }
.badge.bg-info { background: #7C3AED !important; color: #fff; }
.badge.bg-success { background: #10B981 !important; }
.badge.bg-danger { background: #EF4444 !important; }
.badge.bg-warning { background: #F59E0B !important; color: #0D0D0D; }
.badge.bg-secondary { background: #4B5563 !important; }

/* --- Alerts --- */
.alert-info {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
    color: #C4B5FD;
}
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}
.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #FCD34D;
}

/* --- Nav tabs --- */
.nav-tabs {
    border-bottom-color: #374151;
}
.nav-tabs .nav-link {
    color: #9CA3AF;
    border: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.nav-tabs .nav-link:hover {
    color: #F59E0B;
    border-color: rgba(245, 158, 11, 0.3);
}
.nav-tabs .nav-link.active {
    color: #F59E0B;
    background: transparent;
    border-color: #F59E0B;
    border-bottom: 2px solid #F59E0B;
}

/* --- List groups --- */
.list-group-item {
    background: #1F2937;
    border-color: #374151;
    color: #E5E7EB;
}

/* --- Custom NoteStake components --- */

/* Gold glow card */
.ns-card-glow {
    border: 1px solid rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.05);
}
.ns-card-glow:hover {
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}

/* Gradient text */
.ns-gradient-text {
    background: linear-gradient(135deg, #F59E0B, #7C3AED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stats number */
.ns-stat {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #F59E0B;
}

/* Gold divider */
.ns-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.3), transparent);
    margin: 2rem 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #111827;
}
::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4B5563;
}

/* --- Validation --- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #10B981;
}
.invalid {
    outline: 1px solid #EF4444;
}
.validation-message {
    color: #EF4444;
    font-size: 0.875rem;
}

/* --- Blazor Error UI --- */
.blazor-error-boundary {
    background: #7F1D1D;
    padding: 1rem 1rem 1rem 1rem;
    color: #FCA5A5;
    border-radius: 0.5rem;
}
.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    background: #1F2937;
    border-top: 2px solid #EF4444;
    color: #FCA5A5;
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
#blazor-error-ui .reload {
    color: #F59E0B;
}

/* --- Auth page card --- */
.ns-auth-card {
    background: #1F2937;
    border: 1px solid rgba(245, 158, 11, 0.1);
    border-radius: 1rem;
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.05);
    padding: 2.5rem;
    max-width: 480px;
    margin: 0 auto;
}

/* --- Manage nav --- */
.ns-manage-nav .list-group-item {
    background: transparent;
    border: none;
    color: #9CA3AF;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}
.ns-manage-nav .list-group-item:hover {
    background: rgba(245, 158, 11, 0.08);
    color: #F59E0B;
}
.ns-manage-nav .list-group-item.active {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
    font-weight: 600;
}

/* --- Class nav pills --- */
.ns-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #9CA3AF;
    background: transparent;
    border: 1px solid #374151;
    text-decoration: none;
    transition: all 0.15s;
}
.ns-nav-pill:hover {
    color: #F59E0B;
    border-color: #F59E0B;
    background: rgba(245, 158, 11, 0.08);
    text-decoration: none;
}
.ns-nav-pill.active {
    color: #F59E0B;
    border-color: #F59E0B;
    background: rgba(245, 158, 11, 0.12);
    font-weight: 600;
}

/* --- Content area padding --- */
.content {
    padding-top: 1.5rem;
}

/* --- Misc --- */
.cursor-pointer { cursor: pointer; }

/* Centered narrow content for form/settings pages */
.ns-page-center {
    max-width: 640px;
    margin: 0 auto;
}

/* Full-bleed pages (chat, etc.) — removes main padding/max-width */
main:has(.ns-full-page) {
    padding: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
}

a, .btn-link {
    color: #F59E0B;
}
a:hover, .btn-link:hover {
    color: #FBBF24;
}

.text-muted {
    color: #6B7280 !important;
}

hr {
    border-color: #374151;
    opacity: 0.5;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: #6B7280;
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.darker-border-checkbox.form-check-input {
    border-color: #4B5563;
}

/* --- Page-specific table row overrides (Leaderboard, Bet history) --- */
.table-success {
    --bs-table-bg: rgba(16, 185, 129, 0.12);
    --bs-table-color: #6EE7B7;
}
.table-danger {
    --bs-table-bg: rgba(239, 68, 68, 0.12);
    --bs-table-color: #FCA5A5;
}