/* MLB Series Betting Dashboard - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 18px;
}

.auth-card h2 {
    color: #1e3c72;
    margin-bottom: 6px;
}

.auth-message {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: #555;
}

.auth-message.error {
    color: #b42318;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-tab {
    border: 1px solid #d0d7e2;
    background: #f7f9fc;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 600;
}

.auth-tab.active {
    background: #1e3c72;
    border-color: #1e3c72;
    color: #ffffff;
}

.auth-form .form-group {
    margin-bottom: 10px;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 1.8em;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-icon-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

.today-date {
    font-size: 1em;
    font-weight: 600;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.btn-bankroll {
    background-color: #ffc107;
    color: #333;
    font-weight: 600;
}

.btn-bankroll:hover {
    background-color: #ffb300;
}

.header-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.header-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.header-icon-glyph {
    font-size: 1.1rem;
    line-height: 1;
}

.header-icon-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #dc3545;
    border: 2px solid #1f457f;
}

.hidden {
    display: none !important;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.header-stats .stat-label {
    font-size: 0.9em;
    opacity: 1;
    color: #ffffff;
}

.header-stats .stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #ffffff;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    border-bottom: 2px solid #ddd;
}

.nav-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    transition: all 0.3s;
}

.nav-tab:hover {
    color: #1e3c72;
    background-color: #f0f0f0;
}

.nav-tab.active {
    color: #1e3c72;
    border-bottom-color: #1e3c72;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-content h2 {
    color: #1e3c72;
    margin-bottom: 12px;
    font-size: 1.55em;
}

.tab-content h3 {
    color: #2a5298;
    margin-bottom: 10px;
    font-size: 1.12em;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.overview-block {
    margin-bottom: 14px;
}

.overview-delimited {
    border-top: 2px solid #e3e8f3;
    padding-top: 10px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: 1px;
}

.overview-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.season-insights-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 6px;
}

.season-insights-grid .metric-card {
    padding: 10px;
}

.season-insights-grid .metric-card h3 {
    font-size: 0.74em;
    margin-bottom: 6px;
}

.season-insights-grid .metric-value {
    font-size: 1.25em;
}

.metric-card {
    background: white;
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-card h3 {
    font-size: 0.82em;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.65em;
    font-weight: bold;
    color: #1e3c72;
}

/* Sections */
.section {
    background: white;
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
}

/* Consistent section delimiter treatment across tabs */
.tab-content > .section {
    border-top: 2px solid #e3e8f3;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

@media (max-width: 1200px) {
    .season-insights-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 900px) {
    .overview-two-col {
        grid-template-columns: 1fr;
    }

    .overview-delimited {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Today's Games */
.todays-games-summary {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.todays-games-summary p {
    margin: 5px 0;
    font-size: 1.1em;
}

.betting-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 10px;
}

.betting-status-badge.can-bet-both {
    background-color: #d4edda;
    color: #155724;
}

.betting-status-badge.can-bet-one {
    background-color: #fff3cd;
    color: #856404;
}

.betting-status-badge.cannot-bet {
    background-color: #f8d7da;
    color: #721c24;
}

.team-selection-note {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.bettor-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.insight-rows {
    margin-top: 8px;
    font-size: 0.9em;
    color: #2d3748;
    line-height: 1.45;
}

.insight-rows strong {
    color: #1e3c72;
}

@media (max-width: 980px) {
    .bettor-insights-grid {
        grid-template-columns: 1fr;
    }

    .season-insights-grid {
        grid-template-columns: 1fr;
    }
}

.filters input,
.filters select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

.filters select {
    min-width: 180px;
}

.filters span {
    display: flex;
    align-items: center;
    color: #666;
    font-weight: 500;
}

/* Series List */
.series-list {
    display: grid;
    gap: 15px;
}

.series-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #1e3c72;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.series-card.eligible {
    border-left-color: #28a745;
}

.series-card.active {
    border-left-color: #ffc107;
}

.series-card.closed {
    border-left-color: #dc3545;
    opacity: 0.7;
}

.series-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.series-teams {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.series-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.series-badge.eligible {
    background-color: #d4edda;
    color: #155724;
}

.series-badge.active {
    background-color: #fff3cd;
    color: #856404;
}

.series-badge.closed {
    background-color: #f8d7da;
    color: #721c24;
}

.series-badge.completed {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ==================== BET PLACED + CHASE ACTIVE BADGES ==================== */

/* Allows multiple badges to sit neatly in the series header (right side) */
.series-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Keep existing .series-badge sizing; these are additional variants */
.series-badge.bet-placed {
    background-color: #f1f5f9;   /* light slate */
    color: #0f172a;              /* deep slate text */
    border: 1px solid #cbd5e1;
}

.series-badge.bet-placed::before {
    content: "🧾 ";
}

/* CHASE ACTIVE: louder + pulsing ring so it pops */
.series-badge.chase-active {
    background-color: #fff1f2;   /* light red/pink */
    color: #7f1d1d;              /* deep red text */
    border: 1px solid #fecaca;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
    animation: chasePulse 1.6s ease-in-out infinite;
}

.series-badge.chase-active::before {
    content: "🚨 ";
}

@keyframes chasePulse {
    0%   { box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18); }
    50%  { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.10); }
    100% { box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18); }
}

.series-market-insights{
  margin: 8px 0 0 0;
  padding: 10px 10px;
  background: #f7f9fc;
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.25;
  color: #334155;
}

.market-insights-title{
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f172a;
}

.series-value-range{
  margin: 0 0 8px 0;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

/* Right-side badge stack in series header */
.series-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* BET PLACED badge */
.series-badge.bet-placed {
  background: #c0392b;           /* strong red */
  color: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

/* CHASE ACTIVE badge (purple) */
.series-badge.chase-active {
  background: #6f42c1;           /* purple */
  color: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.16);
}

/* Optional: subtle pulse for CHASE ACTIVE */
.series-badge.chase-active {
  animation: chasePulse 1.6s ease-in-out infinite;
}
@keyframes chasePulse {
  0%   { transform: scale(1);   opacity: 1; }
  50%  { transform: scale(1.03); opacity: 0.9; }
  100% { transform: scale(1);   opacity: 1; }
}

.value-range-title{
  font-weight: 700;
  margin-bottom: 6px;
  color: #0f172a;
}

.market-insight-line{
  margin: 3px 0;
}

/* Button variants */
.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* Game count indicator */
.game-count {
    font-size: 0.85em;
    color: #666;
    margin-left: 8px;
}

.series-info {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9em;
}

.series-score {
    font-size: 1.1em;
    font-weight: 600;
    margin: 10px 0;
}

.series-value-range{
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f6f7f9;
    font-size: 0.9em;
    color: #333;
}

.series-value-range div{
    display: flex;
    gap: 6px;
    line-height: 1.25;
}

.series-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Games List */
.games-list {
    display: grid;
    gap: 15px;
}

.game-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.game-teams {
    font-size: 1.1em;
    font-weight: 600;
}

.game-score {
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 15px 0;
}

.team-score {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.score-value {
    font-size: 2em;
    font-weight: bold;
    color: #1e3c72;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #1e3c72;
    color: white;
}

.btn-primary:hover {
    background-color: #2a5298;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal h2 {
    margin-bottom: 20px;
    color: #1e3c72;
}

.modal-body {
    margin-top: 20px;
}

.notifications-modal-meta {
    margin-bottom: 12px;
    color: #666;
    font-size: 0.9em;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notifications-list .notification-item {
    background: #f8f9fb;
    border: 1px solid #dfe5ee;
    border-left: 4px solid #17a2b8;
    border-radius: 8px;
    padding: 10px 12px;
}

.notifications-list .notification-item.chase-active {
    border-left-color: #ff7b00;
}

.notifications-list .notification-item.chase-deposit {
    border-left-color: #ffc107;
}

.notifications-list .notification-item.read {
    opacity: 0.72;
}

.notifications-list .notification-title {
    font-size: 0.9em;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 4px;
}

.notifications-list .notification-message {
    font-size: 0.9em;
    color: #444;
    line-height: 1.4;
}

.notification-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.notification-pill {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #2d3748;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
}

.notification-pill:hover {
    background: #f2f5fa;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e3c72;
}

.score-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.calculation-preview {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border-left: 4px solid #1e3c72;
}

.calculation-preview h4 {
    margin-bottom: 10px;
    color: #1e3c72;
}

.calculation-preview p {
    margin: 5px 0;
}

.series-info-box,
.game-info-box {
    background-color: #e3f2fd;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #1e3c72;
}

.series-info-box h3,
.game-info-box h3 {
    margin: 0 0 10px 0;
    color: #1e3c72;
    font-size: 1.1em;
}

.series-info-box p,
.game-info-box p {
    margin: 5px 0;
    color: #333;
}

.game-info-highlight {
    background-color: #fff3cd;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: 600;
    color: #856404;
}

.bankroll-current {
    text-align: center;
    padding: 20px;
    background-color: #e3f2fd;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bankroll-current h3 {
    margin: 0 0 10px 0;
    color: #1e3c72;
}

.bankroll-amount {
    font-size: 2.5em;
    font-weight: bold;
    color: #1e3c72;
    margin: 0;
}

.bankroll-history {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.bankroll-history h3 {
    margin-bottom: 15px;
    color: #1e3c72;
}

.bankroll-transaction {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bankroll-transaction.deposit {
    border-left: 3px solid #28a745;
}

.bankroll-transaction.withdrawal {
    border-left: 3px solid #dc3545;
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    font-weight: 600;
    text-transform: capitalize;
}

.transaction-date {
    font-size: 0.9em;
    color: #666;
}

.transaction-amount {
    font-size: 1.2em;
    font-weight: bold;
}

.transaction-amount.deposit {
    color: #28a745;
}

.transaction-amount.withdrawal {
    color: #dc3545;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Activity List */
.activity-list {
    display: grid;
    gap: 8px;
}

.activity-item {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #1e3c72;
}

.compact-activity-list {
    max-height: 270px;
    overflow-y: auto;
    padding-right: 4px;
}

.activity-item.won {
    border-left-color: #28a745;
}

.activity-item.lost {
    border-left-color: #dc3545;
}

.activity-date {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.activity-details {
    font-weight: 600;
}

.activity-result {
    margin-top: 5px;
    font-size: 0.9em;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-stats {
        flex-direction: column;
        gap: 15px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .series-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .score-inputs {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .filters input {
        width: 100%;
    }
}

/* Utility Classes */
.text-success {
    color: #28a745;
}

.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #ffc107;
}

.text-muted {
    color: #6c757d;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

/* Ledger Styles */
.ledger-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ledger-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ledger-stat .label {
    font-size: 0.9em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ledger-stat .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #1e3c72;
}

.ledger-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.ledger-table thead {
    background-color: #1e3c72;
    color: white;
}

.ledger-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.ledger-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
}

.ledger-table tbody tr:hover {
    background-color: #f8f9fa;
}

.ledger-table tbody tr:last-child td {
    border-bottom: none;
}

.ledger-table .empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.ledger-bankroll-row {
    background-color: #fff9e6 !important;
    font-weight: 600;
}

.ledger-bankroll-row:hover {
    background-color: #fff3cd !important;
}

.ledger-result {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
}

.ledger-result.won {
    background-color: #d4edda;
    color: #155724;
}

.ledger-result.lost {
    background-color: #f8d7da;
    color: #721c24;
}

.ledger-result.pending {
    background-color: #fff3cd;
    color: #856404;
}

.ledger-result.abandoned {
    background-color: #d6d8db;
    color: #383d41;
}

/* EARLY PAYOUT badge */
.ledger-result.early_payout {
  background: #e6d6ff;   /* light mauve */
  color: #4b2a7a;        /* darker purple text */
  border: 1px solid #cbb3ff;
}

.btn-enter-score {
    padding: 4px 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-enter-score:hover {
    background-color: #218838;
}

.btn-enter-score:active {
    background-color: #1e7e34;
}

.balance-positive {
    color: #28a745;
    font-weight: 600;
}

.balance-negative {
    color: #dc3545;
    font-weight: 600;
}

@media (max-width: 768px) {
    .ledger-table {
        font-size: 0.85em;
    }
    
    .ledger-table th,
    .ledger-table td {
        padding: 8px 5px;
    }
}
/* ==================== STATS DASHBOARD STYLES (ADD TO END OF styles.css) ==================== */

/* Stats View Selector */
.stats-view-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.stats-view-selector .btn {
    flex: 1;
}

/* Stats Views */
.stats-view {
    display: none;
}

.stats-view.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Stats Controls */
.stats-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.stats-controls select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    min-width: 200px;
}

/* Stats Display Container */
.stats-display {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stats Season Section */
.stats-season-section {
    margin-bottom: 40px;
}

.stats-season-section h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    font-size: 1.5em;
    padding-bottom: 10px;
    border-bottom: 3px solid #1e3c72;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stats-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #1e3c72;
}

.stats-card h4 {
    color: #2a5298;
    margin: 0 0 15px 0;
    font-size: 1.1em;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-line:last-child {
    border-bottom: none;
}

.stat-line.highlight {
    background-color: #fff3cd;
    margin: 0 -10px;
    padding: 8px 10px;
    border-radius: 4px;
}

.stat-label {
    font-weight: 500;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: #1e3c72;
    font-size: 1.1em;
}

.stat-line.positive .stat-value {
    color: #28a745;
}

.stat-line.negative .stat-value {
    color: #dc3545;
}

/* Head-to-Head Comparison */
.h2h-comparison {
    max-width: 1000px;
    margin: 0 auto;
}

.h2h-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 10px;
}

.h2h-team {
    font-size: 1.5em;
    font-weight: bold;
}

.h2h-vs {
    font-size: 2em;
    font-weight: bold;
    opacity: 0.7;
}

.h2h-series-history {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.h2h-series-history h4 {
    margin: 0 0 10px 0;
    color: #1e3c72;
}

.h2h-stats-grid {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.h2h-stat-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
}

.h2h-stat-row:last-child {
    border-bottom: none;
}

.h2h-stat-row.highlight {
    background-color: #fff3cd;
}

.h2h-stat-cell {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    color: #1e3c72;
}

.h2h-stat-cell.advantage {
    color: #28a745;
}

.h2h-stat-label {
    font-weight: 600;
    color: #666;
    text-align: center;
}

/* Rankings Table */
.rankings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rankings-table thead {
    background: #1e3c72;
    color: white;
}

.rankings-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.rankings-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.rankings-table tbody tr:hover {
    background-color: #f8f9fa;
}

.rankings-table tbody tr:nth-child(-n+3) {
    background-color: #e8f5e9;
}

.rankings-table tbody tr:nth-child(-n+3):hover {
    background-color: #c8e6c9;
}

/* Head-to-Head Modal (Large) */
.modal-large .modal-content {
    max-width: 900px;
}

.h2h-modal-content {
    padding: 20px 0;
}

.h2h-team-header {
    text-align: center;
}

.h2h-team-header h3 {
    margin: 0;
    color: white; /* Fixed for visibility on dark background */
}

.team-record {
    font-size: 1.2em;
    color: #666;
    margin-top: 5px;
}

.h2h-vs-large {
    font-size: 3em;
    font-weight: bold;
    color: #ccc;
}

.h2h-matchup-history {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.h2h-matchup-history h4 {
    margin: 0 0 15px 0;
    color: #1e3c72;
}

.matchup-summary {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.matchup-stat {
    text-align: center;
}

.matchup-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.matchup-value {
    font-size: 2em;
    font-weight: bold;
    color: #1e3c72;
}

.h2h-comparison-grid {
    display: grid;
    gap: 20px;
}

.comparison-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.comparison-section h4 {
    margin: 0 0 15px 0;
    color: #2a5298;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table tr {
    border-bottom: 1px solid #dee2e6;
}

.comparison-table tr:last-child {
    border-bottom: none;
}

.comparison-table td {
    padding: 10px;
    text-align: center;
}

.comparison-table td:first-child,
.comparison-table td:last-child {
    font-weight: bold;
    color: #1e3c72;
    width: 30%;
}

.comparison-table td:nth-child(2) {
    font-weight: 600;
    color: #666;
    width: 40%;
}

.comparison-table td.advantage {
    color: #28a745;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Responsive Design for Stats */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-controls {
        flex-direction: column;
    }
    
    .stats-controls select {
        width: 100%;
    }
    
    .h2h-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .h2h-stat-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .h2h-stat-label {
        order: -1;
        font-size: 0.9em;
    }
    
    .matchup-summary {
        flex-direction: column;
        gap: 15px;
    }
    
    .stats-view-selector {
        flex-direction: column;
    }
}

/* Utility Classes for Stats */
.positive {
    color: #28a745;
}

.negative {
    color: #dc3545;
}

.neutral {
    color: #6c757d;
}
/* ==================== CONFIDENCE SCORE STYLES (ADD TO styles.css) ==================== */

/* Confidence Badge */
.confidence-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 60px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.confidence-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.confidence-badge.confidence-high {
    background-color: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.confidence-badge.confidence-medium {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
}

.confidence-badge.confidence-low {
    background-color: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

.confidence-score {
    font-size: 1.5em;
    font-weight: bold;
    line-height: 1;
}

.confidence-badge { cursor: pointer; }
.confidence-hint {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 4px;
}

.confidence-rating {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.confidence-loading {
    color: #999;
    font-style: italic;
}

.confidence-error {
    color: #dc3545;
    font-size: 0.85em;
}

/* Confidence Container on Series Cards */
.confidence-container {
    margin: 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #1e3c72;
}

.confidence-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.confidence-comparison {
    display: flex;
    gap: 20px;
    justify-content: space-around;
}

.confidence-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* Confidence Modal */
#confidenceModal {
    z-index: 1001;
}

#confidenceModal .modal-content {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.confidence-modal-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.confidence-modal-header h2 {
    margin: 0 0 10px 0;
    color: #1e3c72;
}

.confidence-rating-large {
    font-size: 1.5em;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    margin: 10px 0;
}

.confidence-rating-large.confidence-high {
    background-color: #d4edda;
    color: #155724;
}

.confidence-rating-large.confidence-medium {
    background-color: #fff3cd;
    color: #856404;
}

.confidence-rating-large.confidence-low {
    background-color: #f8d7da;
    color: #721c24;
}

/* Confidence Team Info */
.confidence-team-info {
    background-color: #e3f2fd;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.confidence-team-info p {
    margin: 5px 0;
}

/* Breakdown Section */
.confidence-breakdown-section {
    margin-bottom: 25px;
}

.confidence-breakdown-section h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.breakdown-grid {
    display: grid;
    gap: 15px;
}

/* Compact layout: 2–3 columns depending on modal width */
.breakdown-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

/* Tighten component cards a bit */
.breakdown-grid-compact .breakdown-item {
    padding: 12px;
}

.breakdown-grid-compact .breakdown-label {
    margin-bottom: 6px;
    font-size: 0.95em;
}

.breakdown-grid-compact .breakdown-details {
    gap: 6px;
    font-size: 0.85em;
}

.breakdown-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #1e3c72;
}

.breakdown-label {
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 8px;
    font-size: 1em;
}

.breakdown-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 0.9em;
}

.breakdown-value {
    font-weight: bold;
    color: #333;
}

.breakdown-score {
    color: #666;
}

.breakdown-weight {
    color: #666;
    font-style: italic;
}

.breakdown-contribution {
    font-weight: 600;
    color: #28a745;
}

/* Factors Section */
.confidence-factors-section {
    margin-bottom: 25px;
}

.confidence-factors-section h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.factors-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.factors-list li {
    padding: 10px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #28a745;
}

.factors-list li:before {
    content: "✓ ";
    color: #28a745;
    font-weight: bold;
    margin-right: 6px;
}

/* Final Score Display */
.confidence-final-score {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
    border-radius: 8px;
    margin-top: 20px;
}

.confidence-final-score h3 {
    margin: 0 0 15px 0;
    color: #1e3c72;
}

.final-score-display {
    font-size: 3em;
    font-weight: bold;
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    margin: 10px 0;
}

.final-score-display.confidence-high {
    background-color: #d4edda;
    color: #155724;
}

.final-score-display.confidence-medium {
    background-color: #fff3cd;
    color: #856404;
}

.final-score-display.confidence-low {
    background-color: #f8d7da;
    color: #721c24;
}

.final-score-explanation {
    color: #666;
    font-size: 0.9em;
    margin-top: 15px;
    line-height: 1.6;
}

/* Confidence-Ranked Series List */
.series-card.confidence-ranked {
    position: relative;
    padding-left: 60px;
}

.confidence-rank {
    position: absolute;
    left: 15px;
    top: 20px;
    font-size: 2em;
    font-weight: bold;
    color: #1e3c72;
    opacity: 0.3;
}

.series-card.confidence-ranked.confidence-high {
    border-left-width: 6px;
    border-left-color: #28a745;
}

.series-card.confidence-ranked.confidence-medium {
    border-left-width: 6px;
    border-left-color: #ffc107;
}

.series-card.confidence-ranked.confidence-low {
    border-left-width: 6px;
    border-left-color: #dc3545;
}

.best-bet-info {
    font-size: 1.1em;
    margin: 10px 0;
    padding: 10px;
    background-color: #e3f2fd;
    border-radius: 5px;
}

.confidence-factors-preview {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9em;
}

.factor-item {
    margin: 3px 0;
    color: #666;
}

/* Confidence Filter Controls */
.confidence-filter-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.confidence-filter-controls label {
    font-weight: 600;
    color: #333;
}

.confidence-filter-controls input,
.confidence-filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.confidence-filter-controls button {
    margin-left: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .confidence-comparison {
        flex-direction: column;
        gap: 10px;
    }
    
    .breakdown-details {
        grid-template-columns: 1fr;
    }
    
    .series-card.confidence-ranked {
        padding-left: 20px;
    }
    
    .confidence-rank {
        font-size: 1.5em;
        left: 5px;
        top: 10px;
    }
}

/* Confidence Score Legend */
.confidence-legend {
    display: flex;
    gap: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-badge {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.legend-badge.confidence-high {
    background-color: #d4edda;
    color: #155724;
}

.legend-badge.confidence-medium {
    background-color: #fff3cd;
    color: #856404;
}

.legend-badge.confidence-low {
    background-color: #f8d7da;
    color: #721c24;
}

.legend-text {
    font-size: 0.9em;
    color: #666;
}

.legend-text strong {
    display: block;
    color: #333;
}

/* ==================== NEW FEATURE STYLES ==================== */

/* Metric Card Subtext */
.metric-subtext {
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
    font-weight: normal;
}

/* Series Grid Layout for Bettor Dashboard */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.series-grid .series-card {
    margin-bottom: 0;
}

/* Compact series cards for grid */
.series-grid .series-card {
    padding: 15px;
}

.series-grid .series-header {
    margin-bottom: 10px;
}

.series-grid .series-teams {
    font-size: 1.1em;
}

.series-grid .series-info {
    font-size: 0.9em;
    margin-bottom: 10px;
}

.series-grid .series-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.series-grid .series-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 0.9em;
}

/* H2H Button Styling */
.btn-h2h {
    background-color: #17a2b8;
}

.btn-h2h:hover {
    background-color: #138496;
}

/* Responsive grid */
@media (max-width: 1200px) {
    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .series-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== GAME TYPE BADGES ==================== */

.game-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.game-type-badge.division {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.game-type-badge.league {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.game-type-badge.interleague {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #17a2b8;
}

/* For series header with game type */
.series-header-with-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.series-header-with-badge .series-teams {
    flex: 1;
    min-width: 200px;
}

/* ==================== STANDINGS STYLES ==================== */

.standings-league {
    margin-bottom: 50px;
}

.standings-league-title {
    color: #1e3c72;
    font-size: 2em;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 4px solid #1e3c72;
    text-align: center;
}

.standings-division {
    margin-bottom: 40px;
}

.standings-division-title {
    color: #2a5298;
    font-size: 1.5em;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 5px solid #2a5298;
    border-radius: 4px;
}

.standings-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
}

.standings-table thead {
    background: #1e3c72;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.standings-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.standings-table th:first-child {
    text-align: center;
    width: 50px;
}

.standings-table th:nth-child(2) {
    text-align: left;
    min-width: 150px;
}

.standings-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #f8f9fa;
}

.standings-table td:first-child {
    font-weight: bold;
    color: #666;
}

.standings-table td:nth-child(2) {
    text-align: left;
    font-weight: 600;
    color: #1e3c72;
}

.standings-table tbody tr:hover {
    background-color: #f8f9fa;
}

.standings-table .standings-playoff-spot {
    background-color: #e8f5e9;
}

.standings-table .standings-playoff-spot:hover {
    background-color: #c8e6c9;
}

/* Highlight key columns */
.standings-table td:nth-child(3),
.standings-table td:nth-child(4),
.standings-table td:nth-child(5) {
    font-weight: 600;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .standings-table {
        font-size: 0.75em;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 6px 4px;
    }
    
    .standings-league-title {
        font-size: 1.5em;
    }
    
    .standings-division-title {
        font-size: 1.2em;
    }
}

/* Historical Matchup Section */
.head-to-head-historical {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    color: #2c3e50;
}

.btn-refresh {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-refresh:hover {
    background: #2980b9;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Summary Stats */
.historical-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

/* Series Win Rates */
.series-win-rates {
    margin-bottom: 25px;
}

.series-win-rates h4 {
    margin-bottom: 5px;
    color: #2c3e50;
}

.explainer {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 15px;
    font-style: italic;
}

.team-rate-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.team-rate-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 12px;
}

.team-rate-row:last-child {
    margin-bottom: 0;
}

.team-name {
    font-weight: 600;
    color: #2c3e50;
}

.rate-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-bar {
    flex: 1;
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.rate-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
    width: 0;
}

.team1-fill {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.team2-fill {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.rate-value {
    min-width: 50px;
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
}

/* Overall Records */
.overall-records {
    margin-bottom: 25px;
}

.overall-records h4 {
    margin-bottom: 12px;
    color: #2c3e50;
}

.records-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.team-record {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-name-small {
    font-weight: 500;
    color: #2c3e50;
}

.record {
    font-weight: 700;
    color: #3498db;
    font-size: 16px;
}

/* Home/Away Splits */
.home-away-splits {
    margin-bottom: 25px;
}

.home-away-splits h4 {
    margin-bottom: 12px;
    color: #2c3e50;
}

.splits-table {
    width: 100%;
    border-collapse: collapse;
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
}

.splits-table th {
    background: #34495e;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.splits-table td {
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    color: #2c3e50;
}

.splits-table tr:hover {
    background: #ecf0f1;
}

/* Recent Games */
.recent-games h4 {
    margin-bottom: 12px;
    color: #2c3e50;
}

#recent-games-list {
    max-height: 200px;
    overflow-y: auto;
}

.recent-game-item {
    background: #f8f9fa;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    font-size: 13px;
}

.recent-game-date {
    color: #7f8c8d;
    font-size: 11px;
    margin-bottom: 4px;
}

.recent-game-score {
    color: #2c3e50;
}

.winner-badge {
    background: #2ecc71;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
}

/* Messages */
.no-data-message,
.error-message {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

.error-message {
    color: #e74c3c;
}

/* Historical data in modal */
.h2h-historical-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

.h2h-historical-section h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #2c3e50;
}

.historical-modal-stats {
    font-size: 14px;
}

.hist-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

.hist-series-rates {
    margin: 15px 0;
}

.hist-rate-row {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.hist-team-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

.hist-bar-container {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.hist-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.hist-pct {
    font-weight: 600;
    color: #2c3e50;
    text-align: right;
}

.hist-records {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    font-size: 13px;
}

.loading-small, .error-small, .no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 10px;
    font-size: 13px;
}

.error-small {
    color: #e74c3c;
}

.data-entry-calendar {
  margin-top: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.calendar-month-label {
  font-weight: 700;
  font-size: 1.05rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-cell {
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 8px;
  min-height: 86px;
  cursor: pointer;
  background: #fafafa;
}

.calendar-cell.empty {
  border: none;
  background: transparent;
  cursor: default;
}

.calendar-cell.today {
  outline: 2px solid #1e3c72;
  background: #f0f6ff;
}

.calendar-day-num {
  font-weight: 800;
  margin-bottom: 6px;
}

.calendar-metrics {
  font-size: 0.82rem;
  line-height: 1.25rem;
}

.calendar-metrics.muted {
  color: #9ca3af;
}

.calendar-metrics .metric.won { color: #15803d; }
.calendar-metrics .metric.lost { color: #b91c1c; }

.calendar-metrics .metric.scores a {
  color: #1e3c72;
  text-decoration: underline;
  font-weight: 600;
}

.calendar-options {
  margin-top: 8px;
  margin-bottom: 8px;
  color: #374151;
  font-size: 0.9rem;
}

/* Bankroll Analysis: header spacing */
#bankroll-analysis > h2 {
    padding-left: 20px;
    margin-top: 6px;
    margin-bottom: 14px;
}

.series-value-range{
  margin: 10px 0 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f3f5f7;
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 0.92em;
}

.series-value-range div{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  line-height: 1.25;
}

.series-value-range strong{
  font-weight: 700;
}

.series-value-range div + div{
  margin-top: 4px;
}

.game-type-badge{
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.h2h-hist-card{
  background:#fff;
  border:1px solid rgba(0,0,0,0.06);
  border-radius:12px;
  padding:14px;
}

.h2h-hist-top{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
  margin-bottom:12px;
}

.h2h-hist-stat{
  background:#f6f7f9;
  border:1px solid rgba(0,0,0,0.05);
  border-radius:10px;
  padding:10px;
  text-align:center;
}

.h2h-hist-stat-num{
  font-weight:800;
  font-size:1.05em;
  margin-bottom:2px;
}

.h2h-hist-stat-label{
  opacity:0.75;
  font-size:0.85em;
}

.h2h-hist-bars{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:10px;
}

.h2h-hist-bar-row{
  display:grid;
  grid-template-columns: 140px 1fr 60px;
  gap:10px;
  align-items:center;
}

.h2h-hist-team{
  font-weight:700;
  font-size:0.9em;
  opacity:0.9;
}

.h2h-hist-bar-track{
  height:14px;
  background:#e9ecef;
  border-radius:999px;
  overflow:hidden;
}

.h2h-hist-bar-fill{
  height:100%;
  border-radius:999px;
}

.h2h-hist-bar-fill.team1{ background:#2f80ed; }
.h2h-hist-bar-fill.team2{ background:#eb5757; }

.h2h-hist-pct{
  text-align:right;
  font-weight:700;
  font-size:0.9em;
  opacity:0.9;
}

.h2h-hist-records{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:0.9em;
  opacity:0.9;
  border-top:1px solid rgba(0,0,0,0.06);
  padding-top:10px;
}

/* optional: make the badge colors match the vibe you already have */
.game-type-badge.interleague{ background: #e6f7ff; color: #0b6b8f; border: 1px solid #bfe9ff; }
.game-type-badge.league{ background: #fff3cd; color: #7a5a00; border: 1px solid #ffe69c; }
.game-type-badge.division{ background: #e7f6ea; color: #1f6b2b; border: 1px solid #cdeed3; }

/* Risk borders */
/* Risk borders (bold + noticeable) */
.metric-card.risk-green  { border: 4px solid #2ecc71 !important; box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.18) !important; }
.metric-card.risk-yellow { border: 4px solid #f1c40f !important; box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.20) !important; }
.metric-card.risk-red    { border: 4px solid #e74c3c !important; box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.20) !important; }
.metric-card.risk-none   { border: 1px solid #e6e6e6 !important; box-shadow: none !important; }

.team-confidence-chart-wrap {
  height: 240px;
}

#teamConfidenceChart {
  display: block;
  width: 100% !important;
  height: 240px !important;
}
