@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Lato:wght@400;700&display=swap');

* {
    font-family: "Lato", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* ------ Γενικά containers ------ */
.cf-agg-wrapper {
    background: #1B3A62 !important;
    border-radius: 5px !important;
    padding: 20px !important;
    margin: 20px 0 !important;
    border: 1px solid #1e4a76 !important;
    overflow-x: auto;
}

/* ------ Μπλοκ λίγκας (κάθε λίγκα ξεχωριστά) ------ */
.cf-agg-league-block {
    background: #0A1C2F;
    border-radius: 5px;
    border: 1px solid #1e4a76;
    padding: 10px;
    margin-top: 10px;
}

.cf-agg-league-block-first {
    margin-top: 0 !important;
}

/* ------ Τίτλος λίγκας (για τις μη-πρώτες) ------ */
.cf-agg-league-title {
    color: #F5C542;
    font-size: 18px;
    font-weight: 600;
    padding: 8px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #1e4a76;
    margin-bottom: 10px;
}

.cf-agg-league-title .cf-agg-flag-icon {
    margin-right: 6px;
}

/* ------ Πίνακας (εντός μπλοκ) – χωρίς δικά του borders (τα δίνουν τα κελιά) ------ */
.cf-agg-table {
    width: 100%;
    border-collapse: collapse !important;
    background: #0F2A44;
    border-radius: 5px !important;
    overflow: hidden;
    font-size: 15px;
    border: none !important;
    margin-bottom: 0 !important;
}

.cf-agg-table thead tr,
.cf-agg-table tbody tr:first-child {
    border-top: 1px solid #1e4a76 !important;
}

/* ------ Κελιά: αριστερά και δεξιά σύνορα ------ */
.cf-agg-table th,
.cf-agg-table td {
    border-left: 1px solid #1e4a76 !important;
    border-right: 1px solid #1e4a76 !important;
}

.cf-agg-table th {
    background: #9E9E9E !important;
    color: #000 !important;
    padding: 12px 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: center;
    border-bottom: 1px solid #1e4a76;
}

.cf-agg-table th:last-child {
    border-right: 1px solid #1e4a76 !important;
}

.cf-agg-table td {
    padding: 5px 5px !important;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #1e4a76;
    background: #0F2A44;
    color: #ffffff;
    font-size: 14px !important;
}

.cf-agg-table td:last-child {
    border-right: 1px solid #1e4a76 !important;
}

/* ------ Στυλ για όλες τις σειρές (κοινό) ------ */
.cf-agg-table td.cf-agg-league-name-cell {
    padding-left: 15px !important;
    white-space: normal;
    word-break: break-word;
    vertical-align: middle;
    color: #F5C542 !important;
    font-size: 16px !important;
}

/* ------ Εσωτερικό wrapper (flex) ------ */
.cf-agg-table td.cf-agg-league-name-cell .cf-agg-cell-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ------ Σειρά 1 (1X2) – αριστερή στοίχιση ------ */
.cf-agg-table td.cf-agg-row-left {
    text-align: left !important;
}
.cf-agg-table td.cf-agg-row-left .cf-agg-cell-content {
    justify-content: flex-start;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

/* ------ Σειρά 2 και 3 – κεντρική στοίχιση (O/U και BTTS) ------ */
.cf-agg-table td.cf-agg-row-center {
    text-align: center !important;
    padding-left: 0 !important;
}
.cf-agg-table td.cf-agg-row-center .cf-agg-cell-content {
    justify-content: center;
    padding-left: 4px !important;
    padding-right: 0px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

/* ------ Σημαία: σταθερό κενό από το κείμενο ------ */
.cf-agg-flag-icon {
    margin-right: 10px;
    width: 40px !important;
    height: 30px !important;
    border-radius: 2px !important;
    object-fit: cover !important;
    border: 2px solid #999 !important;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    vertical-align: middle;
    flex-shrink: 0;
}

.cf-agg-th-wins {
    background-color: #4ade80 !important;
    color: #155724 !important;
}
.cf-agg-th-losses {
    background-color: #f87171 !important;
    color: #721c24 !important;
}

/* ------ Στήλη σκορ (μόνο για history) ------ */
.cf-agg-score-header {
    background-color: #4ADE80 !important;
    color: #0F2A44 !important;
    font-weight: 700;
}

/* ------ Γραμμές πιθανοτήτων (3 ράβδοι) ------ */
.cf-agg-prob-bars {
    display: flex;
    height: 30px;
    border-radius: 2px !important;
    overflow: hidden;
    min-width: 150px;
    margin: 0 auto;
}

.cf-agg-bar-home,
.cf-agg-bar-draw,
.cf-agg-bar-away {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 14px;
}
.cf-agg-bar-home { background-color: #4CAF50; }
.cf-agg-bar-draw { background-color: #FFC107; color: #000; }
.cf-agg-bar-away { background-color: #F44336; }

/* ------ Γραμμές 2 ράβδοι (O/U, BTTS) ------ */
.cf-agg-two-bars {
    display: flex;
    flex-direction: row;
    height: 28px;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.cf-agg-bar-first,
.cf-agg-bar-second {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    padding: 0 4px;
    flex: 1;
}
.cf-agg-bar-first { background-color: #2196F3; }
.cf-agg-bar-second { background-color: #FF9800; color: #000; }

/* ------ Prediction badge ------ */
.cf-agg-pred-badge {
    background: #FE7E07;
    color: #ffffff;
    font-weight: 800;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 0.8rem;
    display: inline-block;
}

.cf-agg-match-time,
.cf-agg-pred-score {
    color: #FE7E07;
    font-weight: 500;
}

/* ------ Match cell ------ */
.cf-agg-match-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px !important;
}

.cf-agg-team-home {
    text-align: right;
    flex: 1;
    white-space: normal;
    word-break: break-word;
}

.cf-agg-match-vs {
    color: #FE7E07;
    font-weight: 700;
    flex-shrink: 0;
    text-align: center;
    min-width: 20px !important;
}

.cf-agg-team-away {
    text-align: left;
    flex: 1;
    white-space: normal;
    word-break: break-word;
}

/* ------ League header row (μόνο για την πρώτη λίγκα) ------ */
.cf-agg-league-header-row {
    background: #0a1c2f !important;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 12px 16px;
    margin-bottom: 10px;
}

/* ----- League header content (flex) ----- */
.cf-agg-league-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
}

.cf-agg-league-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cf-agg-league-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cf-agg-league-country,
.cf-agg-league-name {
    font-weight: 600;
    font-size: 20px !important;
    margin-left: 4px !important;
}
.cf-agg-league-name {
    color: #FE7E07;
}
.cf-agg-league-separator {
    margin: 0 2px;
}

/* ------ Win Rate Badge ------ */
.cf-agg-winrate-badge {
    background: #0a1c2f;
    padding: 4px 14px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85rem;

    color: #F5C542;
    display: inline-block;
    white-space: nowrap;
}

.cf-agg-winrate-badge.cf-agg-winrate-positive {

    color: #4ade80;
}
.cf-agg-winrate-badge.cf-agg-winrate-negative {

    color: #f87171;
}

/* ------ League buttons (για την πρώτη λίγκα) ------ */
.cf-agg-league-btn {
    padding: 4px 14px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    cursor: pointer;
    white-space: nowrap;
}
.cf-agg-league-btn:hover {
    color: #999;
}

.cf-agg-stats-btn {
    background: #0A1C2F;
    color: #d1d1d1;
    border: 1px solid #1B3A62;
}
.cf-agg-stats-btn:hover {
    background: #0A1C2F;
    color: #F5C542;
    border-color: #868585;
    border: 1px solid #1B3A62;
}

.cf-agg-history-btn {
    background: #0A1C2F;
    color: #B7B6B6;
    border: 1px solid #B7B6B6;
}
.cf-agg-history-btn:hover {
    background: #0A1C2F;
    color: #868585;
    border-color: #868585;
    border: 1px solid #868585;
}

/* ------ Stats grid (history cards) – αν χρησιμοποιηθεί ------ */
.cf-agg-stats-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 20px;
    margin-bottom: 5px;
    padding: 20px;
    border-radius: 3px;
}

.cf-agg-stat-card {
    background: #0a1c2f;
    border-radius: 5px;
    border: 1px solid #1e4a76;
    padding: 12px 6px;
    text-align: center;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cf-agg-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    font-weight: 600;
    margin-bottom: 6px;
}

.cf-agg-stat-value {
    font-size: 0.9em;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.cf-agg-stat-positive { color: #4ade80 !important; }
.cf-agg-stat-negative { color: #f87171 !important; }

/* ------ League header (global) ------ */
.cf-agg-league-header {
    background: #0a1c2f;
    padding: 18px 16px !important;
    border: 1px solid #1e4a76;
    border-bottom: none !important;
    border-radius: 5px 5px 0 0;
    display: block;
}

.cf-agg-title-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.cf-agg-title-text {
    flex: 1;
    min-width: 180px;
}

.cf-agg-title-text h1 {
    margin: 0;
    display: block;
    font-size: 1.5rem !important;
    font-weight: 700;
    color: #FE7E07;
    background: transparent;
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.cf-agg-stats-description {
    font-size: 1.0rem !important;
    color: #d1d1d1;
    line-height: 1.2;
    margin-bottom: 0;
    padding: 0;
}

.cf-agg-league-logo {
    height: 80px !important;
    width: auto;
    max-width: 100px !important;
    object-fit: contain;
    background: transparent;
    padding: 0;
    margin-right: 12px;
    vertical-align: middle;
    display: inline-block;
    border: 2px solid #999999;
    border-radius: 3px !important;
}

/* ------ Trophy / chart icons ------ */
.cf-agg-trophy-header {
    font-size: 1.3rem;
    line-height: 1;
}

.cf-agg-stats-chart-icon {
    color: #f5c542 !important;
    margin-right: 6px;
}

/* ------ Result icons ------ */
.cf-agg-result-win {
    color: #4ade80;
    font-size: 1.4rem;
}
.cf-agg-result-loss {
    color: #f87171;
    font-size: 1.4rem;
}
.cf-agg-result-pending {
    color: #cccccc;
    font-size: 1.2rem;
}

/* ------ Ειδικές κλάσεις για χρώματα στατιστικών ------ */
.cf-agg-winrate-positive { color: #4ade80 !important; font-weight: bold; }
.cf-agg-winrate-negative { color: #f87171 !important; font-weight: bold; }
.cf-agg-winrate-neutral { color: #cccccc !important; font-weight: normal; }

.cf-agg-wins-positive { color: #4ade80 !important; font-weight: bold; }
.cf-agg-losses-negative { color: #f87171 !important; font-weight: bold; }

.cf-agg-profit-positive { color: #4ade80; font-weight: bold; }
.cf-agg-profit-negative { color: #f87171; font-weight: bold; }
.cf-agg-profit-neutral { color: #cccccc; font-weight: normal; }

.cf-agg-roi-text-positive { color: #4ade80; }
.cf-agg-roi-text-negative { color: #f87171; }
.cf-agg-roi-text-neutral { color: #cccccc; }

.cf-agg-overall-positive { color: #81c784; font-weight: bold; }
.cf-agg-overall-negative { color: #e57373; font-weight: bold; }
.cf-agg-overall-neutral { color: #cccccc; }

/* ------ Performance Stats button ------ */
.cf-agg-perf-button {
    display: inline-block;
    padding: 3px 10px;
    background: #f57c00;
    color: #fff;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.cf-agg-perf-button:hover {
    background: #5a6268;
}

/* ------ Today's buttons group – χωρίς justify-content, κληρονομεί από τον γονέα ------ */
.cf-agg-today-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.cf-agg-today-button {
    display: inline-block;
    padding: 3px 10px;
    background: #f57c00;
    color: #fff;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.cf-agg-today-button:hover {
    background: #e65100;
    color: #fff;
    text-decoration: none;
}

.cf-agg-details-button {
    display: inline-block;
    padding: 4px 14px;
    background: #1976d2;
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.cf-agg-details-button:hover {
    background: #1565c0;
    color: #fff;
    text-decoration: none;
}

/* ------ Single league sections (στο world_league_stats) – αν χρησιμοποιηθούν ------ */
.cf-agg-market-section {
    margin-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 30px;
}
.cf-agg-market-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    padding-left: 5px;
}
.cf-agg-table-wrapper {
    width: 100%;
    overflow-x: auto;
}
.cf-agg-single-market-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto 15px auto;
    font-size: 0.9rem;
}
.cf-agg-single-market-table th,
.cf-agg-single-market-table td {
    text-align: center;
    padding: 8px 6px;
    white-space: nowrap;
}
.cf-agg-single-market-table th {
    background: #f0f2f5;
    font-weight: 600;
}
.cf-agg-single-market-table .cf-agg-th-wins,
.cf-agg-single-market-table .cf-agg-th-losses {
    text-align: center;
}
.cf-agg-chart-fullwidth {
    width: 100%;
    background: #f9fafc;
    border-radius: 8px;
    padding: 15px 0 5px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.cf-agg-chart-fullwidth canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
    display: block;
}

/* ------ Notice (no predictions) ------ */
.cf-agg-prediction-notice {
    background: #fef9e3;
    border-left: 4px solid #facc15;
    padding: 15px 20px;
    margin: 15px 0;
    color: #1e293b;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
}
.cf-agg-prediction-notice .cf-agg-notice-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #b45309;
}
.cf-agg-prediction-notice .cf-agg-notice-title strong {
    color: #1e293b;
}
.cf-agg-prediction-notice .cf-agg-notice-subtitle {
    margin: 5px 0 0 0;
    font-size: 0.85rem;
    color: #475569;
    opacity: 1;
}

/* ------ Error messages ------ */
.cf-agg-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

/* ------ Γραφήματα (single league) – αποκατάσταση λευκού φόντου ------ */
.cf-chart-fullwidth {
    width: 100%;
    background: #f9fafc !important;
    border-radius: 8px;
    padding: 15px 0 5px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.cf-chart-fullwidth canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 250px;
    display: block;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 768px) {
    .cf-agg-flag-icon {
        width: 24px !important;
        height: 24px !important;
        margin-right: 4px;
    }
    .cf-agg-stats-chart-icon {
        margin-right: 4px;
        font-size: 0.9rem;
    }
    .cf-agg-stats-description {
        font-size: 0.75rem !important;
    }
    .cf-agg-title-text h1 {
        font-size: 1rem !important;
    }

    .cf-agg-league-header-content {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .cf-agg-league-right {
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .cf-agg-league-btn {
        font-size: 0.7rem !important;
        padding: 4px 12px !important;
    }
    .cf-agg-winrate-badge {
        font-size: 0.75rem !important;
        padding: 3px 10px !important;
    }
}

@media (max-width: 1200px) {
    .cf-agg-stats-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
        padding: 15px;
    }
}

@media (max-width: 900px) {
    .cf-agg-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .cf-agg-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px;
    }
    .cf-agg-stat-card {
        padding: 8px 4px;
    }
    .cf-agg-stat-value {
        font-size: 1rem;
    }
    .cf-agg-stat-label {
        font-size: 0.65rem;
    }
    .cf-agg-table th,
    .cf-agg-table td {
        font-size: 11px !important;
        padding: 5px 2px !important;
    }
    .cf-agg-match-vs {
        min-width: 25px;
    }
    .cf-agg-flag-icon {
        width: 32px !important;
        height: 24px !important;
        margin-right: 6px;
    }
    .cf-agg-league-logo {
        height: 50px !important;
        max-width: 60px !important;
    }
    .cf-agg-stats-description {
        font-size: 0.7rem;
    }
}

@media (max-width: 600px) {
    .cf-agg-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}