/**
 * Box Cricket Live Player Bidding System
 * Core UI Stylesheet (High Contrast & Crystal Clear Visibility)
 */

:root {
    --bg-dark: #0b0f19;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --border-color: #334155;
    --border-light: #475569;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --text-dim: #cbd5e1;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar-custom {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff !important;
}

.navbar-brand span {
    color: var(--accent-gold);
}

/* Cards */
.card-custom {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s ease;
}

.card-custom:hover {
    border-color: var(--border-light);
}

.card-header-custom {
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

/* Modals High Contrast */
.modal-content.bg-dark, .modal-content {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid #475569 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8) !important;
}

.modal-header {
    background-color: #0f172a !important;
    border-bottom: 1px solid #334155 !important;
}

.modal-footer {
    background-color: #0f172a !important;
    border-top: 1px solid #334155 !important;
}

/* Form Controls & Inputs */
.form-label, label {
    color: #f1f5f9 !important;
    font-weight: 700 !important;
    margin-bottom: 0.4rem;
}

.form-control-dark, .form-select-dark, .form-control, .form-select {
    background-color: #0f172a !important;
    border: 1.5px solid #475569 !important;
    color: #ffffff !important;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
}

.form-control-dark:focus, .form-select-dark:focus, .form-control:focus, .form-select:focus {
    background-color: #0f172a !important;
    border-color: var(--accent-gold) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(245, 158, 11, 0.25) !important;
}

.form-control-dark::placeholder, .form-control::placeholder {
    color: #64748b !important;
    opacity: 1;
}

.form-check-input {
    background-color: #0f172a !important;
    border: 2px solid #64748b !important;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--accent-gold) !important;
    border-color: var(--accent-gold) !important;
}

.form-check-label {
    color: #cbd5e1 !important;
    cursor: pointer;
    font-weight: 500;
}

.text-secondary, small.text-secondary {
    color: #94a3b8 !important;
}

/* Nav Tabs in Dark Mode */
.nav-tabs {
    border-bottom: 2px solid #334155 !important;
}

.nav-tabs .nav-link {
    color: #94a3b8 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 0.65rem 1.25rem !important;
    font-weight: 700 !important;
    font-size: 0.95rem;
}

.nav-tabs .nav-link:hover {
    color: #ffffff !important;
    border-color: #475569 #475569 transparent !important;
}

.nav-tabs .nav-link.active {
    color: var(--accent-gold) !important;
    background-color: #0f172a !important;
    border-color: #334155 #334155 #0f172a !important;
    border-bottom: 3px solid var(--accent-gold) !important;
}

/* Badges */
.badge-role {
    font-size: 0.8rem;
    padding: 0.35em 0.75em;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-all-rounder    { background-color: #8b5cf6 !important; color: #fff !important; }
.badge-batsman        { background-color: #3b82f6 !important; color: #fff !important; }
.badge-bowler         { background-color: #10b981 !important; color: #fff !important; }
.badge-wicket-keeper  { background-color: #ec4899 !important; color: #fff !important; }

.badge-status-ready      { background-color: #475569 !important; color: #fff !important; }
.badge-status-in_auction { background-color: #f59e0b !important; color: #000 !important; animation: pulse-badge 1.5s infinite; }
.badge-status-sold       { background-color: #10b981 !important; color: #fff !important; }
.badge-status-unsold     { background-color: #ef4444 !important; color: #fff !important; }

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Alerts High Contrast */
.alert {
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 0.9rem 1.25rem !important;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    border: 1.5px solid #10b981 !important;
    color: #34d399 !important;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border: 1.5px solid #ef4444 !important;
    color: #f87171 !important;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    border: 1.5px solid #f59e0b !important;
    color: #fbbf24 !important;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.2) !important;
    border: 1.5px solid #3b82f6 !important;
    color: #60a5fa !important;
}

/* Stat Cards */
.stat-card {
    padding: 1.5rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-val {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

/* Tables Dark Mode */
html {
    color-scheme: dark;
}

.table, table, .table-dark-custom {
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-hover-bg: #334155 !important;
    --bs-table-color: #ffffff !important;
    color: #ffffff !important;
    background-color: transparent !important;
    border-collapse: separate;
    border-spacing: 0;
}

.table > :not(caption) > * > *,
.table-dark-custom > :not(caption) > * > * {
    background-color: transparent !important;
    color: #ffffff !important;
    border-bottom: 1px solid #334155 !important;
}

.table thead th, .table-dark-custom thead th {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #334155 !important;
    padding: 0.9rem 1rem;
}

.table tbody tr, .table-dark-custom tbody tr {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

.table tbody tr:hover, .table-dark-custom tbody tr:hover {
    background-color: #334155 !important;
}

.table tbody td, .table-dark-custom tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6) !important;
    vertical-align: middle;
    color: #ffffff !important;
}

/* Buttons */
.btn-gold {
    background-color: var(--accent-gold);
    color: #000000;
    font-weight: 800;
    border: none;
}
.btn-gold:hover {
    background-color: #d97706;
    color: #000000;
}

/* Player Avatar in tables */
.player-thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #475569;
    background-color: #1e293b;
}

.team-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background-color: #fff;
    padding: 2px;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.95);
    padding: 1.25rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
