/* Who Wants to Be a Millionaire Question Database CSS */

:root {
    /* palette matches static/css/game.css */
    --wwtbam-navy: #0b1d4f;
    --wwtbam-navy-2: #132a6b;
    --wwtbam-blue: #1e3a8a;
    --wwtbam-accent: #3d8bfd;   /* the lighter blue: borders/glow only */
    --wwtbam-gold: #f5b301;
    --wwtbam-dark: #1f2937;
    --wwtbam-light: #f8fafc;
}

/* ------------------------------------------------------------------ */
/* Site-wide theme: navy surfaces, gold accents, light blue as border */
/* (the light blue is the show's question-box border, not a fill)     */
/* ------------------------------------------------------------------ */

.navbar.bg-primary {
    background: linear-gradient(180deg, var(--wwtbam-navy-2), var(--wwtbam-navy)) !important;
    border-bottom: 2px solid var(--wwtbam-accent);
}

.navbar.bg-primary .navbar-brand {
    color: var(--wwtbam-gold);
}

.navbar.bg-primary .nav-link.active,
.navbar.bg-primary .nav-link:hover {
    color: var(--wwtbam-gold);
}

.bg-primary:not(.navbar) {
    background: var(--wwtbam-navy) !important;
}

.card .card-header.bg-primary {
    border-bottom: 2px solid var(--wwtbam-accent);
}

.card.border-primary {
    border: 2px solid var(--wwtbam-accent) !important;
    border-radius: 0.75rem;
    box-shadow: 0 0 12px rgba(61, 139, 253, 0.25);
}

.btn-primary {
    background-color: var(--wwtbam-navy);
    border-color: var(--wwtbam-accent);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--wwtbam-navy-2);
    border-color: var(--wwtbam-accent);
}

.btn-outline-primary {
    color: var(--wwtbam-navy-2);
    border-color: var(--wwtbam-accent);
}

.btn-outline-primary:hover {
    background-color: var(--wwtbam-navy);
    border-color: var(--wwtbam-accent);
}

.badge.bg-primary {
    background-color: var(--wwtbam-navy) !important;
    border: 1px solid var(--wwtbam-accent);
}

a {
    color: var(--wwtbam-navy-2);
}

a:hover {
    color: var(--wwtbam-blue);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--wwtbam-light);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
}

.jumbotron {
    background: linear-gradient(135deg, var(--wwtbam-navy) 0%, var(--wwtbam-navy-2) 100%);
    border: 2px solid var(--wwtbam-accent);
    border-radius: 0.75rem;
}

/* Card enhancements */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    background-color: rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.125);
}

/* Question styling */
.question-card {
    border-left: 4px solid var(--wwtbam-gold);
}

.question-card .card-header {
    background: var(--wwtbam-navy);
    color: white;
    border-bottom: 2px solid var(--wwtbam-accent);
}

/* Answer choices: navy pill with light blue border, like the show's boxes */
.answer-choice,
.answer-choice.btn-outline-dark {
    transition: all 0.2s ease;
    background: linear-gradient(180deg, var(--wwtbam-navy-2), var(--wwtbam-navy));
    color: #fff;
    border: 2px solid var(--wwtbam-accent);
    border-radius: 2rem;
}

.answer-choice:hover:not(:disabled) {
    border-color: var(--wwtbam-gold);
    color: #fff;
    transform: translateY(-1px);
}

.answer-choice .badge {
    min-width: 28px;
    font-weight: bold;
    background: transparent !important;
    color: var(--wwtbam-gold);
}

/* post-answer state colors must win over the navy base */
.answer-choice.btn-success {
    background: var(--bs-success);
    border-color: var(--bs-success);
}

.answer-choice.btn-danger {
    background: var(--bs-danger);
    border-color: var(--bs-danger);
}

.answer-choice.btn-outline-success {
    background: var(--wwtbam-navy);
    border-color: var(--bs-success);
    box-shadow: 0 0 8px rgba(25, 135, 84, 0.6);
}

/* Dollar amount styling */
.dollar-amount {
    color: var(--wwtbam-gold);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Progress bars */
.progress {
    background-color: rgba(0,0,0,0.1);
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Search highlighting */
.highlight {
    background-color: yellow;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* Statistics cards */
.stats-card {
    background: linear-gradient(135deg, var(--wwtbam-blue), #3b82f6);
    color: white;
}

.stats-card .card-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Button enhancements */
.btn-primary {
    background-color: var(--wwtbam-blue);
    border-color: var(--wwtbam-blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #1e40af;
    border-color: #1e40af;
}

.btn-success {
    background-color: #10b981;
    border-color: #10b981;
}

.btn-success:hover,
.btn-success:focus {
    background-color: #059669;
    border-color: #059669;
}

/* Screenshot images */
.question-screenshot,
.answer-screenshot {
    max-width: 100%;
    height: auto;
}

/* Answer choice buttons: comfortable touch targets */
.answer-choice {
    min-height: 48px;
    white-space: normal;
    text-align: left;
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem;
    }

    .jumbotron .display-4 {
        font-size: 2rem;
    }

    .answer-choice {
        margin-bottom: 0.5rem;
        font-size: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    /* Comfortable tap targets on touch devices */
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 40px;
    }

    .navbar .nav-link {
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }

    /* Touch-friendly pagination that wraps instead of overflowing */
    .pagination {
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }

    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Keep screenshots comfortably inside a phone viewport
       (overrides the inline desktop max-heights) */
    .question-screenshot {
        max-height: 220px !important;
    }

    .answer-screenshot {
        max-height: 180px !important;
    }

    /* Card headers with amount + episode + date wrap instead of overflowing */
    .card-header {
        row-gap: 0.25rem;
    }

    /* Big stat numbers scale down so 4-up cards don't crowd */
    .stats-card .card-title {
        font-size: 2rem;
    }
}

/* Table enhancements */
.table-responsive {
    border-radius: 0.375rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table th {
    background-color: var(--wwtbam-blue);
    color: white;
    border: none;
    font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

/* Alert styling */
.alert-info {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Badge styling */
.badge {
    font-size: 0.8em;
}

/* Form enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--wwtbam-blue);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

/* Pagination */
.pagination .page-link {
    color: var(--wwtbam-blue);
}

.pagination .page-item.active .page-link {
    background-color: var(--wwtbam-blue);
    border-color: var(--wwtbam-blue);
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}