/* ==========================================================================
   Odds Tracker Page Styles
   Location: /styles/odds-tracker.css
   ========================================================================== */

/* --- Global overrides for front.css --- */
.odds-page button {
    background-color: transparent !important;
    margin-bottom: 0 !important;
}
.odds-page table tr:hover {
    background-color: transparent;
    cursor: default;
}
.odds-page table {
    margin-bottom: 0;
}

/* --- Layout --- */
.odds-page {
    padding-top: 80px;
    padding-bottom: 60px;
    max-width: 100%;
}

/* --- Controls Row --- */
.odds-controls {
    display: flex;
    align-items: center;
}
.odds-controls .btn-group .btn {
    min-width: 70px;
    font-weight: 600;
    font-size: 13px;
    height: 36px;
    line-height: 36px;
    padding: 0 14px;
}
.odds-controls .form-control {
    height: 36px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.odds-controls .gap-2 > * {
    margin-right: 8px;
}

/* --- Tabs --- */
.odds-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 0;
}
.odds-tabs .nav-link {
    font-weight: 600;
    font-size: 14px;
    color: #555;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.odds-tabs .nav-link:hover {
    color: #007bff;
    border-bottom-color: #007bff;
}
.odds-tabs .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: transparent;
}
.odds-attribution {
    display: flex;
    align-items: center;
    padding: 0 10px;
}
.odds-attribution span {
    font-size: 10px;
    color: #bbb;
}
.odds-attribution a {
    color: #bbb;
    text-decoration: underline;
}
.odds-attribution a:hover {
    color: #999;
}

/* --- Table Wrapper --- */
.odds-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e0e0e0;
    border-top: none;
    background: #fff;
}

/* --- Odds Table --- */
.odds-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
    table-layout: auto;
}
.odds-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #333;
    padding: 8px 10px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* =====================================================
   GAMES TABLE: Sticky columns order = time | rot | team
   Widths: time=70, rot=44, team=170  → total=284
   ===================================================== */
#games-table thead th.time-header {
    text-align: center;
    width: 70px;
    min-width: 70px;
    position: sticky;
    left: 0;
    z-index: 4;
    background: #f8f9fa;
}
#games-table thead th.rot-header {
    text-align: center;
    width: 44px;
    min-width: 44px;
    position: sticky;
    left: 70px;
    z-index: 4;
    background: #f8f9fa;
}
#games-table thead th.game-info-header {
    text-align: left;
    min-width: 170px;
    position: sticky;
    left: 114px;
    z-index: 4;
    background: #f8f9fa;
    border-right: 2px solid #dee2e6;
}
#games-table tbody td.time-cell {
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 1;
    width: 70px;
    min-width: 70px;
    padding: 6px 6px;
}
#games-table tbody td.rot-cell {
    text-align: center;
    background: #fff;
    position: sticky;
    left: 70px;
    z-index: 1;
    width: 44px;
    min-width: 44px;
    padding: 6px 4px;
}
#games-table tbody td.game-info {
    text-align: left;
    font-weight: 600;
    background: #fff;
    position: sticky;
    left: 114px;
    z-index: 1;
    min-width: 170px;
    border-right: 2px solid #dee2e6;
}

/* =====================================================
   PROPS TABLE: Sticky columns order = time | player
   Widths: time=70, player=200  → total=270
   ===================================================== */
#props-table thead th.time-header {
    text-align: center;
    width: 70px;
    min-width: 70px;
    position: sticky;
    left: 0;
    z-index: 4;
    background: #f8f9fa;
}
#props-table thead th.player-info-header {
    text-align: left;
    min-width: 200px;
    position: sticky;
    left: 70px;
    z-index: 4;
    background: #f8f9fa;
    border-right: 2px solid #dee2e6;
}
#props-table tbody td.time-cell {
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 1;
    width: 70px;
    min-width: 70px;
    padding: 6px 6px;
}
#props-table tbody td.player-info {
    text-align: left;
    font-weight: 600;
    background: #fff;
    position: sticky;
    left: 70px;
    z-index: 1;
    border-right: 2px solid #dee2e6;
    min-width: 200px;
}

/* Book header columns */
.odds-table thead th.book-header {
    min-width: 100px;
}

/* Body cells default */
.odds-table tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid #eee;
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.3s ease;
}

/* --- Time cell shared styles --- */
.time-date {
    font-size: 11px;
    font-weight: 600;
    color: #444;
    line-height: 1.4;
}
.time-clock {
    font-size: 10px;
    color: #888;
    line-height: 1.4;
}

/* --- Rotation numbers --- */
.rot-num {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    line-height: 1.6;
    min-width: 36px;
    text-align: center;
}

/* Game date separator row */
.odds-table .date-separator td {
    background: #f0f0f0;
    font-weight: 700;
    font-size: 12px;
    color: #333;
    padding: 6px 10px;
    text-align: left;
    border-bottom: 2px solid #ccc;
}

/* --- Team Logos --- */
.team-logo {
    vertical-align: middle;
    object-fit: contain;
    margin-right: 6px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- Player Headshots --- */
.player-headshot {
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Game team rows */
.game-team-row {
    display: flex;
    align-items: center;
    line-height: 1.6;
}
.team-name {
    font-size: 12px;
    color: #222;
    font-weight: 600;
}

/* Player info styling */
.player-info-row {
    display: flex;
    align-items: center;
}
.player-details {
    flex: 1;
    min-width: 0;
}
.player-name {
    font-weight: 600;
    font-size: 12px;
    color: #222;
}
.player-meta {
    font-size: 10px;
    color: #888;
    margin-top: 1px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.player-meta .team-logo {
    margin-right: 2px;
}

/* --- Odds Cell Formatting --- */
.odds-cell {
    min-width: 90px;
}
.odds-cell .odds-line {
    font-weight: 600;
    font-size: 12px;
    color: #222;
}
.odds-cell .odds-price {
    font-size: 11px;
    color: #777;
    margin-top: 1px;
}
.odds-cell .odds-price.positive {
    color: #00bd4c;
}
.odds-cell .odds-price.negative {
    color: #c0392b;
}
.odds-cell.no-data {
    color: #ccc;
}

/* Props: over/under stacked */
.prop-cell {
    min-width: 90px;
}
.prop-cell .prop-over,
.prop-cell .prop-under {
    font-size: 11px;
    line-height: 1.4;
}
.prop-cell .prop-over {
    color: #00bd4c;
}
.prop-cell .prop-under {
    color: #c0392b;
}
.prop-cell .prop-line {
    font-weight: 600;
    font-size: 12px;
    color: #222;
}

/* --- Flash Animation for Changed Odds --- */
@keyframes odds-flash {
    0% {
        background-color: rgba(255, 235, 59, 0.5);
    }
    83% {
        background-color: rgba(255, 235, 59, 0.5);
    }
    100% {
        background-color: transparent;
    }
}

.odds-changed {
    animation: odds-flash 6s ease-out forwards;
}

/* --- Empty / Loading States --- */
.odds-table .loading-row td,
.odds-table .empty-row td {
    text-align: center;
    padding: 30px 10px;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* --- Best Line Highlighting (per-line, not per-cell) --- */
.odds-cell .best-line,
.prop-cell .best-line {
    background-color: rgba(0, 189, 76, 0.10);
    border-left: 2px solid #00bd4c;
    padding-left: 4px;
    margin-left: -6px;
    border-radius: 2px;
}

/* --- Conversions Tab --- */
.conversions-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    padding: 20px;
}
.conversions-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-bottom: 4px;
}
.conversions-subtitle {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}
.conversion-table {
    width: auto;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 24px;
}
.conversion-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #333;
    padding: 8px 14px;
    text-align: center;
    white-space: nowrap;
}
.conversion-table tbody td {
    padding: 5px 14px;
    border-bottom: 1px solid #eee;
    text-align: center;
    font-size: 12px;
    color: #333;
    white-space: nowrap;
}
.conversion-table tbody tr:hover {
    background-color: #f5f8ff;
}
.conversion-table .col-spread {
    font-weight: 700;
    color: #222;
}
.conversion-table .col-dog {
    color: #00bd4c;
}
.conversion-table .col-fav {
    color: #c0392b;
}
.conversion-table .col-pct {
    color: #666;
    font-size: 11px;
}

/* MLB conversions layout */
.mlb-conversion-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}
.mlb-conversion-section {
    flex: 1;
    min-width: 250px;
}
.mlb-conversion-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: #444;
    margin-bottom: 10px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .odds-page {
        padding-top: 75px;
        padding-left: 5px;
        padding-right: 5px;
    }
    .odds-controls .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }
    .odds-controls .d-flex > * {
        margin-right: 0;
        margin-bottom: 6px;
        width: 100% !important;
    }
    #games-table thead th.game-info-header,
    #games-table tbody td.game-info {
        min-width: 130px;
    }
    #props-table thead th.player-info-header,
    #props-table tbody td.player-info {
        min-width: 160px;
    }
}
