/* Football Odds Table - Frontend Styles */

.fot-root {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    line-height: 1.3;
    width: 100%;
    overflow-x: auto;
}

/* ===== LOADING ===== */
.fot-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px;
    justify-content: center;
    color: #888;
}
.fot-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #e84545;
    border-radius: 50%;
    animation: fot-spin 0.7s linear infinite;
}
@keyframes fot-spin { to { transform: rotate(360deg); } }

/* ===== ERROR ===== */
.fot-error {
    padding: 16px;
    background: #fff3f3;
    border: 1px solid #ffc2c2;
    border-radius: 6px;
    color: #c00;
    font-size: 13px;
}

/* ===== TOOLBAR ===== */
.fot-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.fot-toolbar-title {
    font-size: 14px;
    font-weight: 600;
}
.fot-count {
    font-size: 11px;
    background: #e84545;
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
}
.fot-refresh-btn {
    margin-left: auto;
    padding: 4px 12px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: transparent;
    color: inherit;
    transition: background 0.15s;
}
.fot-refresh-btn:hover { background: rgba(0,0,0,0.06); }
.fot-last-update {
    font-size: 11px;
    color: #888;
}
.fot-countdown {
    font-size: 11px;
    color: #e84545;
}

/* ===== LEAGUE BLOCK ===== */
.fot-league {
    margin-bottom: 8px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ddd;
}
.fot-league-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
}
.fot-league-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.fot-league-name {
    font-weight: 600;
    font-size: 12px;
    flex: 1;
}
.fot-league-count {
    font-size: 11px;
    opacity: 0.7;
}
.fot-league-toggle {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
}
.fot-league.collapsed .fot-league-toggle { transform: rotate(-90deg); }
.fot-league.collapsed .fot-matches { display: none; }

/* ===== TABLE HEADER ===== */
.fot-table-head {
    display: grid;
    grid-template-columns: 58px 22px 62px 46px 1fr 120px 120px 90px 120px 120px 90px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    padding: 4px 2px;
    border-bottom: 1px solid #ddd;
}
.fot-th-group {
    text-align: center;
    border-left: 1px solid #ddd;
    padding: 0 2px;
}
.fot-th-sub {
    display: flex;
    justify-content: space-around;
    font-size: 10px;
    opacity: 0.75;
    padding-top: 2px;
}
.fot-th-period {
    font-size: 10px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding-bottom: 2px;
    margin-bottom: 1px;
}

/* ===== MATCH ROW ===== */
.fot-match {
    display: grid;
    grid-template-columns: 58px 22px 62px 46px 1fr 120px 120px 90px 120px 120px 90px;
    align-items: center;
    padding: 5px 2px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.1s;
}
.fot-match:hover { background: rgba(0,0,0,0.03); }
.fot-match:last-child { border-bottom: none; }

/* time col */
.fot-col-time {
    text-align: center;
    padding: 0 4px;
}
.fot-score-main {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
}
.fot-score-half {
    font-size: 10px;
    opacity: 0.6;
}
.fot-matchtime {
    font-size: 10px;
    color: #e84545;
    font-weight: 600;
}
.fot-matchtime.running { animation: fot-blink 1.2s step-end infinite; }
@keyframes fot-blink { 50% { opacity: 0.4; } }

/* live icon col */
.fot-col-live { text-align: center; }
.fot-live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    background: #e84545;
    border-radius: 50%;
    animation: fot-pulse 1.2s ease-in-out infinite;
}
@keyframes fot-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(232,69,69,0.5); }
    50% { box-shadow: 0 0 0 4px rgba(232,69,69,0); }
}

/* score col */
.fot-col-score { text-align: center; }
.fot-score-live { font-size: 14px; font-weight: 700; color: #e84545; letter-spacing: 1px; }

/* corner col */
.fot-col-corner { text-align: center; font-size: 11px; color: #ff7f00; font-weight: 600; }

/* teams col */
.fot-col-teams { padding: 0 6px; }
.fot-team { display: flex; align-items: center; gap: 5px; padding: 1px 0; }
.fot-team img { width: 16px; height: 16px; object-fit: contain; }
.fot-team-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }

/* odds cells */
.fot-col-hdp,
.fot-col-ou,
.fot-col-1x2 {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-left: 1px solid rgba(0,0,0,0.06);
    padding: 0 3px;
}
.fot-odds-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1px 2px;
    border-radius: 2px;
    font-size: 11px;
}
.fot-odds-label { color: #999; font-size: 10px; min-width: 24px; }
.fot-odds-val { font-weight: 600; font-size: 11px; }
.fot-odds-type { font-size: 10px; color: #888; }

/* odds color states */
.fot-odds-row.up .fot-odds-val { color: #e84545; }
.fot-odds-row.down .fot-odds-val { color: #1e90ff; }
.fot-odds-row.normal .fot-odds-val { color: inherit; }

/* 1x2 special layout */
.fot-1x2-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.fot-1x2-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 1px 2px;
}
.fot-1x2-lbl {
    font-size: 10px;
    color: #999;
    width: 12px;
}
.fot-1x2-val { font-weight: 600; }
.fot-1x2-row.up .fot-1x2-val { color: #e84545; }
.fot-1x2-row.down .fot-1x2-val { color: #1e90ff; }

/* ===== THEME: DARK ===== */
.fot-theme-dark {
    color: #d4d4d4;
}
.fot-theme-dark .fot-league { border-color: #333; background: #1a1a1a; }
.fot-theme-dark .fot-league-head { background: #222; border-bottom: 1px solid #333; }
.fot-theme-dark .fot-table-head { background: #1e1e1e; color: #aaa; border-bottom-color: #333; }
.fot-theme-dark .fot-match { border-bottom-color: #2a2a2a; }
.fot-theme-dark .fot-match:hover { background: rgba(255,255,255,0.04); }
.fot-theme-dark .fot-col-hdp,
.fot-theme-dark .fot-col-ou,
.fot-theme-dark .fot-col-1x2 { border-left-color: #333; }
.fot-theme-dark .fot-th-group { border-left-color: #333; }
.fot-theme-dark .fot-odds-row.normal .fot-odds-val { color: #d4d4d4; }
.fot-theme-dark .fot-1x2-row:not(.up):not(.down) .fot-1x2-val { color: #d4d4d4; }
.fot-theme-dark .fot-error { background: #2a1010; border-color: #5a2020; color: #f77; }
.fot-theme-dark .fot-refresh-btn { border-color: #444; color: #ccc; }
.fot-theme-dark .fot-refresh-btn:hover { background: rgba(255,255,255,0.06); }
.fot-theme-dark .fot-th-period { border-bottom-color: rgba(255,255,255,0.08); }
.fot-theme-dark .fot-th-sub { opacity: 0.55; }

/* ===== THEME: LIGHT ===== */
.fot-theme-light {
    color: #222;
}
.fot-theme-light .fot-league { border-color: #ddd; background: #fff; }
.fot-theme-light .fot-league-head { background: #f4f6f9; border-bottom: 1px solid #ddd; }
.fot-theme-light .fot-table-head { background: #eef0f4; color: #666; }
.fot-theme-light .fot-match:hover { background: #f8f9fb; }
.fot-theme-light .fot-odds-row.normal .fot-odds-val { color: #222; }
.fot-theme-light .fot-1x2-row:not(.up):not(.down) .fot-1x2-val { color: #222; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .fot-table-head,
    .fot-match {
        grid-template-columns: 52px 0 52px 38px 1fr 100px 100px 78px;
    }
    .fot-th-h1, .fot-col-h1-hdp, .fot-col-h1-ou, .fot-col-h1-1x2 { display: none; }
}
@media (max-width: 480px) {
    .fot-table-head,
    .fot-match {
        grid-template-columns: 50px 0 48px 0 1fr 100px 90px 76px;
    }
    .fot-col-corner { display: none; }
    .fot-th-corner { display: none; }
    .fot-col-live { display: none; }
    .fot-th-live { display: none; }
}
