/* Another Odds Board - Compact Table Layout */
/* Colors: black/grey/white/limegreen only - NO blue/purple */

.aob-container {
    background: #0a0a0a;
    min-height: 100vh;
    color: #f0f0f0;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
}

/* Filter Bar */
.aob-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #141414;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 200;
}

.aob-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dropdowns */
.aob-dropdown {
    position: relative;
}

.aob-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #f0f0f0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    transition: border-color .15s;
}

.aob-dropdown-btn:hover {
    border-color: limegreen;
}

.aob-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 120px;
    max-height: 400px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.6);
    z-index: 200;
    margin-top: 4px;
}

.aob-dropdown.open .aob-dropdown-menu {
    display: block;
}

.aob-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: background .15s;
}

.aob-dropdown-item:hover {
    background: #2a2a2a;
}

.aob-dropdown-item.active {
    background: limegreen;
    color: #000;
    font-weight: 600;
}

/* EV Book Selector Dropdown */
.aob-ev-menu {
    min-width: 220px;
    padding: 8px 0;
    max-height: 400px;
    overflow-y: auto;
}

.aob-ev-header {
    padding: 4px 12px 8px;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid #333;
    margin-bottom: 4px;
}

.aob-ev-book {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    transition: background .15s;
}

.aob-ev-book:hover {
    background: #2a2a2a;
}

.aob-ev-book label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    flex: 1;
}

.aob-ev-book input[type="checkbox"] {
    accent-color: limegreen;
    flex-shrink: 0;
}

.aob-ev-book-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.aob-ev-book.selected label span {
    color: limegreen;
}

.aob-ev-weight {
    width: 36px;
    padding: 2px 4px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 2px;
    color: #f0f0f0;
    font-size: 10px;
    font-family: 'Courier New', monospace;
    text-align: center;
    flex-shrink: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.aob-ev-weight::-webkit-outer-spin-button,
.aob-ev-weight::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.aob-ev-weight:disabled {
    opacity: .3;
}

.aob-ev-weight:focus {
    outline: none;
    border-color: limegreen;
}

.aob-ev-menu::-webkit-scrollbar {
    width: 4px;
}

.aob-ev-menu::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 2px;
}

/* Toggle Buttons */
.aob-toggle-group {
    display: flex;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.aob-toggle {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    transition: all .15s;
}

.aob-toggle:hover {
    color: #f0f0f0;
}

.aob-toggle.active {
    background: limegreen;
    color: #000;
    font-weight: 600;
}

/* Search */
.aob-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
}

.aob-search input {
    background: transparent;
    border: none;
    color: #f0f0f0;
    padding: 6px 0;
    width: 100px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.aob-search input::placeholder {
    color: #666;
}

.aob-search input:focus {
    outline: none;
    width: 140px;
}

.aob-search i {
    color: #666;
    font-size: 11px;
}

/* Icon Button */
.aob-icon-btn {
    padding: 9px 10px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    transition: all .15s;
}

.aob-icon-btn:hover {
    color: limegreen;
    border-color: limegreen;
}

a.aob-icon-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Preview Notice */
.aob-preview-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(50, 205, 50, .1);
    border-bottom: 1px solid limegreen;
    font-size: 12px;
}

.aob-preview-notice a {
    color: limegreen;
    text-decoration: underline;
}

/* Connection Status */
.aob-connection {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 10px;
    font-family: 'Courier New', monospace;
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: #141414;
    border: 1px solid #333;
    border-radius: 4px;
    z-index: 1000;
}

.aob-connection.connecting i { color: #fc0; }
.aob-connection.connected i { color: limegreen; }
.aob-connection.disconnected i { color: #f44; }

/* Table Wrapper - scroll container for both axes */
.aob-table-wrapper {
    overflow: auto;
    max-height: calc(100vh - 45px);
}

/* Main Table */
.aob-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
}

.aob-table th,
.aob-table td {
    padding: 7px;
    border-right: 1px solid #222;
    border-bottom: 1px solid #222;
    text-align: center;
    vertical-align: middle;
}

/* Sticky cell borders */
.aob-th-time,
.aob-time-cell {
    border-right: none !important;
}

/* Header row - sticky within table wrapper */
.aob-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.aob-table thead th {
    background: #141414 !important;
    font-weight: 600;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
    font-family: 'Courier New', monospace;
    padding: 8px 4px;
    border-bottom: 2px solid #333;
}

.aob-th-time {
    text-align: center;
    white-space: nowrap;
}

.aob-th-teams {
    text-align: left;
    /*padding-left: 6px !important;*/
    white-space: nowrap;
}

.aob-th-best {
    background: #151a15 !important;
    white-space: nowrap;
}

.aob-th-open {
    background: #1a1816 !important;
    white-space: nowrap;
}

.aob-th-hold {
    white-space: nowrap;
}

.aob-th-consensus {
    background: #1a1a1a !important;
    white-space: nowrap;
}

.aob-th-ev {
    background: #161b16 !important;
    cursor: help;
    white-space: nowrap;
}

.aob-help-icon {
    font-size: 9px;
    color: #666;
    margin-left: 2px;
    vertical-align: middle;
}

.aob-th-ev:hover .aob-help-icon {
    color: limegreen;
}

.aob-th-book {
    padding: 6px 4px !important;
    vertical-align: middle;
    white-space: nowrap;
}

.aob-book-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.aob-book-logo {
    height: 18px;
    width: auto;
    object-fit: contain;
    opacity: 1;
}

.aob-book-name {
    font-size: 7px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0;
    white-space: nowrap;
}

/* Event Rows */
.aob-event {
    background: #0a0a0a;
}

.aob-event:nth-child(4n+3),
.aob-event:nth-child(4n+4) {
    background: #101010;
}

.aob-event:hover {
    background: #1a1a1a !important;
}

/* Time Cell (rowspan 2) */
.aob-time-cell {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #888;
    line-height: 1.3;
    /*padding: 4px !important;*/
    vertical-align: middle;
    background: inherit;
}

.aob-time-cell .date {
    color: #aaa;
    font-weight: 600;
}

.aob-time-cell .time {
    color: #666;
}

.aob-total-logos {
    display: inline-flex;
    gap: 2px;
}

.aob-total-logos .aob-team-logo {
    width: 16px;
    height: 16px;
}

.aob-time-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.aob-time-link:hover {
    color: limegreen;
}

.aob-time-link:hover .date,
.aob-time-link:hover .time {
    color: limegreen;
}

/* Team Cell */
.aob-team-cell {
    text-align: left;
    padding: 3px 6px !important;
    white-space: nowrap;
}

.aob-team-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.aob-team-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.aob-team-name {
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
}

/* Best Line Cell */
.aob-best-cell {
    background: rgba(50, 205, 50, .05) !important;
    font-family: 'Courier New', monospace;
}

.aob-best-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 3px 4px;
    white-space: nowrap;
}

/* Open/Opening Odds Cell */
.aob-open-cell {
    background: rgba(180, 140, 80, .05) !important;
    font-family: 'Courier New', monospace;
}

.aob-open-row {
    font-size: 11px;
    color: #999;
    padding: 3px 4px;
    white-space: nowrap;
    text-align: center;
}

.aob-edge {
    font-size: 9px;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 600;
}

.aob-edge.positive {
    background: limegreen;
    color: #000;
}

.aob-edge.negative {
    background: #f44;
    color: #fff;
}

.aob-edge.neutral {
    color: #666;
}

.aob-best-line {
    font-weight: 600;
    font-size: 11px;
    color: limegreen;
}

.aob-best-logo {
    height: 14px;
    width: auto;
    max-width: 20px;
    object-fit: contain;
    opacity: .8;
}

/* Hold Cell (rowspan 2) */
.aob-hold-cell {
    font-size: 10px;
    font-family: 'Courier New', monospace;
    vertical-align: middle;
}

.aob-hold-value {
    padding: 4px;
}

.aob-hold-value.good { color: limegreen; }
.aob-hold-value.bad { color: #f44; }
.aob-hold-value.neutral { color: #888; }

/* Consensus Cell */
.aob-consensus-cell {
    background: rgba(150, 150, 150, .03) !important;
    font-family: 'Courier New', monospace;
}

.aob-consensus-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 4px;
    gap: 0;
}

.aob-consensus-odds {
    font-size: 11px;
    font-weight: 600;
    color: #ddd;
}

.aob-consensus-count {
    font-size: 8px;
    color: #777;
}

/* EV Cell */
.aob-ev-cell {
    background: rgba(50, 205, 50, .03) !important;
    font-family: 'Courier New', monospace;
}

.aob-ev-row {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 2px;
}

.aob-ev-positive { color: limegreen; }
.aob-ev-slight { color: #9f9; }
.aob-ev-neutral { color: #888; }
.aob-ev-negative { color: #f66; }

/* Odds Cell */
.aob-odds-cell {
    cursor: pointer;
    transition: background .1s;
    font-family: 'Courier New', monospace;
}

.aob-odds-cell:hover {
    background: #1a1a1a !important;
}

.aob-odds-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    padding: 3px 4px;
    white-space: nowrap;
    position: relative;
}

.aob-line {
    font-weight: 600;
    font-size: 13px;
    color: #f0f0f0;
    padding-right: 5px;
}

.aob-odds {
    font-size: 15px;
    color: #ffffff;
}

.aob-odds-empty {
    color: #333;
    font-size: 10px;
}

/* Best odds highlight */
.aob-odds-cell.is-best {
    background: rgba(50, 205, 50, .12) !important;
}

.aob-odds-cell.is-best .aob-line,
.aob-odds-cell.is-best .aob-odds {
    color: limegreen;
    font-weight: 700;
}

/* Row hover gradient for odds comparison */
.aob-odds-cell.gradient-active {
    background: var(--gradient-bg) !important;
}

.aob-event:hover .aob-odds-cell.is-best {
    box-shadow: inset 0 0 8px rgba(50, 205, 50, .4);
}

.aob-event:hover .aob-odds-cell.is-best .aob-line,
.aob-event:hover .aob-odds-cell.is-best .aob-odds {
    color: limegreen;
    text-shadow: 0 0 4px rgba(50, 205, 50, .4);
}

/* Age indicator */
.aob-age {
    font-size: 8px;
    color: #444;
    text-align: center;
    line-height: 1;
    padding-bottom: 2px;
}

.aob-odds-cell.stale .aob-age {
    color: #f66;
}

/* Movement indicators */
.aob-movement {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    font-weight: bold;
    animation: aob-arrow-pulse 1s ease-in-out infinite;
}

.aob-movement.up { color: limegreen; text-shadow: 0 0 4px rgba(50, 205, 50, .8); }
.aob-movement.down { color: #f44; text-shadow: 0 0 4px rgba(255, 68, 68, .8); }

@keyframes aob-arrow-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Stale odds */
.aob-odds-cell.stale {
    opacity: .9;
}

/* Flash animation for updates */
@keyframes aob-flash-green {
    0% { background: rgba(50, 205, 50, .4); }
    70% { background: rgba(50, 205, 50, .15); }
    100% { background: transparent; }
}

@keyframes aob-flash-red {
    0% { background: rgba(255, 68, 68, .4); }
    70% { background: rgba(255, 68, 68, .15); }
    100% { background: transparent; }
}

.aob-flash-up { animation: aob-flash-green 2.5s ease-out; }
.aob-flash-down { animation: aob-flash-red 2.5s ease-out; }

/* Loading & Empty States */
.aob-loading,
.aob-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
    gap: 12px;
}

.aob-loading i,
.aob-empty i {
    font-size: 32px;
    opacity: .4;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .aob-filters {
        padding: 6px 8px;
        position: static;
    }

    .aob-table-wrapper {
        max-height: calc(100vh - 40px);
    }

    .aob-filter-group {
        flex-wrap: wrap;
    }

    .aob-team-logo {
        height: 14px;
    }
}

/* Sticky columns for horizontal scroll */
.aob-th-time,
.aob-time-cell,
.aob-th-teams,
.aob-team-cell {
    position: sticky;
    border-left: none !important;
}

.aob-th-time,
.aob-time-cell {
    left: 0;
    z-index: 4;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
}

.aob-th-teams,
.aob-team-cell {
    left: 54px;
    z-index: 3;
}

.aob-th-time,
.aob-th-teams {
    z-index: 12;
    background: #141414 !important;
}

.aob-time-cell,
.aob-team-cell {
    background: #0a0a0a !important;
}

/* Alt row backgrounds for sticky cells */
.aob-event:nth-child(4n+3) .aob-time-cell,
.aob-event:nth-child(4n+3) .aob-team-cell,
.aob-event:nth-child(4n+4) .aob-time-cell,
.aob-event:nth-child(4n+4) .aob-team-cell {
    background: #101010 !important;
}

.aob-event:hover .aob-time-cell,
.aob-event:hover .aob-team-cell {
    background: #1a1a1a !important;
}

/* Shadow on rightmost sticky column to hide content behind */
.aob-th-teams,
.aob-team-cell {
    box-shadow: 4px 0 8px rgba(0,0,0,.6);
}

/* Scrollbar */
.aob-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.aob-table-wrapper::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.aob-table-wrapper::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.aob-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Live indicator */
.aob-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 4px;
    background: #f44;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    border-radius: 2px;
    text-transform: uppercase;
}

.aob-live-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

/* Game separator line */
.aob-event-home td {
    /*border-bottom: 2px solid #333 !important;*/
}

/* Book fallback text */
.aob-book-fallback {
    font-family: 'Courier New', monospace;
}

/* Total type styling */
.aob-event[data-type="t"] .aob-team-name {
    font-style: italic;
    color: #aaa;
}

/* Ensure proper table structure */
.aob-table td[rowspan] {
    vertical-align: middle;
}

/* Dropdown divider & section label */
.aob-dropdown-divider {
    height: 1px;
    background: #333;
    margin: 4px 0;
}

.aob-dropdown-section-label {
    padding: 4px 12px 2px;
    font-size: 9px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: 'Courier New', monospace;
}

/* Game separator row */
.aob-game-sep {
    background: #181818 !important;
}

.aob-game-sep-cell {
    padding: 6px 12px !important;
    border-bottom: 2px solid #333 !important;
}

.aob-game-sep-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: #ccc;
}

.aob-game-sep-at {
    color: #555;
    font-size: 10px;
}

.aob-game-sep-time {
    margin-left: auto;
    color: #666;
    font-size: 10px;
    font-weight: 400;
}

/* Props direction badge */
.aob-prop-dir {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
    flex-shrink: 0;
}

.aob-prop-dir.over {
    color: limegreen;
    background: rgba(50, 205, 50, .12);
}

.aob-prop-dir.under {
    color: #f66;
    background: rgba(255, 102, 102, .12);
}

/* Props row - empty time cell */
.aob-prop-row .aob-time-cell {
    border-right: none !important;
}

/* Alt lines button */
.aob-alt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    padding: 2px 5px;
    background: transparent;
    border: 1px solid #444;
    border-radius: 3px;
    color: #555;
    cursor: pointer;
    font-size: 8px;
    transition: all .15s;
    opacity: 0.5;
}

.aob-team-row:hover .aob-alt-btn,
.aob-alt-btn:hover,
.aob-alt-btn.active {
    opacity: 1;
}

.aob-alt-btn:hover,
.aob-alt-btn.active {
    border-color: limegreen;
    color: limegreen;
}

/* Alt line rows */
.aob-alt-row {
    background: #0d0d0d !important;
}

.aob-alt-row .aob-team-name {
    opacity: 0.5;
    font-size: 10px;
}

.aob-alt-row .aob-odds {
    font-size: 13px;
    opacity: 0.8;
}

.aob-alt-row .aob-open-row {
    color: #666;
    font-style: italic;
}

/* Chart Expansion */
.aob-chart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 5px;
    background: transparent;
    border: 1px solid #444;
    border-radius: 3px;
    color: #555;
    cursor: pointer;
    font-size: 9px;
    transition: all .15s;
    opacity: 0.6;
}

.aob-team-row:hover .aob-chart-btn,
.aob-chart-btn:hover,
.aob-chart-btn.active {
    opacity: 1;
}

.aob-chart-btn:hover,
.aob-chart-btn.active {
    border-color: limegreen;
    color: limegreen;
}

.aob-chart-row td {
    padding: 0 !important;
    background: #0d0d0d !important;
}

.aob-chart-container {
    position: relative;
    height: 200px;
    border-top: 1px solid #222;
    border-bottom: 2px solid #333;
}

.aob-chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: limegreen;
    font-size: 18px;
}

.aob-chart-canvas {
    width: 100%;
    height: 100%;
}
