/* ============================================================
   Shared wrapper styles – only inside shortcode containers
   ============================================================ */

.cf-agg-wrapper,
.cf-agg-1x2-wrapper,
.cf-agg-ou-wrapper,
.cf-agg-btts-wrapper,
.cf-league-wrapper,
.cf-global-wrapper {
    background: #1B3A62 !important;
    border-radius: 5px !important;
    padding: 20px !important;
    margin: 20px 0 !important;
    border: 1px solid #1e4a76 !important;
    overflow-x: auto;
}

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

/* ============================================================
   Grid layout – common for all prefixes
   ============================================================ */

[class*="-grid-container"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 20px 0;
}

[class*="-grid-item"] {
    background: #0a1c2f;
    border: 1px solid #1e4a76;
    border-radius: 5px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[class*="-market-title"] {
    font-size: 1.2rem;
    font-weight: 600;
    color: #FE7E07;
    margin-bottom: 12px;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e4a76;
}

[class*="-stats-top"] {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

[class*="-stats-bottom"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

[class*="-stat-item"] {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 6px 4px;
    text-align: center;
}

[class*="-stat-label"] {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #aaa;
    letter-spacing: 0.3px;
}

[class*="-stat-value"] {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
}

/* Chart canvas */
[class*="-chart-container"] {
    background: transparent;
    padding: 4px 0;
    margin: 8px 0;
}

[class*="-chart-canvas"] {
    width: 100% !important;
    height: auto !important;
    max-height: 180px;
}

/* Action buttons */
[class*="-stats-actions"] {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #1e4a76;
    margin-top: 4px;
}

[class*="-action-button"] {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    background: #1976d2;
    color: #fff;
    border: none;
    cursor: pointer;
}

[class*="-action-button"]:hover {
    background: #1565c0;
    color: #fff;
    text-decoration: none;
}

[class*="-action-button"].today-button {
    background: #f57c00;
}

[class*="-action-button"].today-button:hover {
    background: #e65100;
}

[class*="-action-button"].disabled {
    background: #555;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   League headers – fix title/description spacing
   ============================================================ */

[class*="-league-header"] {
    background: #0a1c2f;
    padding: 18px 16px !important;
    border: 1px solid #1e4a76;
    border-bottom: none !important;
    border-radius: 5px 5px 0 0;
}

[class*="-title-wrap"] {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

[class*="-title-text"] {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;  /* stack title and description vertically */
}

[class*="-title-text"] h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #FE7E07;
}

[class*="-stats-description"] {
    font-size: 1.0rem;
    color: #d1d1d1;
    margin-top: 4px;         /* space between title and description */
    margin-bottom: 0;
    display: block;
    clear: both;
}

[class*="-header-flag"] {
    width: 80px;
    height: 80px;
    border-radius: 2px;
    object-fit: cover;
    border: 2px solid #999;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    flex-shrink: 0;
}

/* ============================================================
   Prefix-specific overrides (optional)
   ============================================================ */

.cf-agg-1x2-league-header {
    padding: 18px 16px !important;
    border: 1px solid #1e4a76;
    border-bottom: none !important;
    border-radius: 5px 5px 0 0;
}
.cf-agg-1x2-title-text h1 {
    color: #FFB74D;
	padding: 18px 16px !important;
}

.cf-agg-ou-league-header {
    background: #0a2a2a;
    border-color: #2a7a7a;
}
.cf-agg-ou-title-text h1 {
    color: #4DD0E1;
}

.cf-agg-btts-league-header {
    background: #2a0a2a;
    border-color: #7a2a7a;
}
.cf-agg-btts-title-text h1 {
    color: #CE93D8;
}

.cf-league-title-text h1 {
    color: #F5C542;
}

.cf-global-league-header {
    background: #1a1a2e;
    border-color: #3a3a5e;
}
.cf-global-title-text h1 {
    color: #FF6F00;
}

/* ============================================================
   Single-market table – each row as a block (card)
   ============================================================ */

[class*="-leagues-table"] {
    width: 100%;
    border-collapse: separate;      
    border-spacing: 0 8px;         
    background: transparent; 	
    margin-top: 20px;
    font-size: 0.85rem;
}

[class*="-leagues-table"] thead tr {
    background: transparent;        /* header row stays transparent */
}

[class*="-leagues-table"] th {
    background: #0f2a44;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 10px 6px;
    border: none;                  /* no border on header */
    text-align: center;
}

[class*="-leagues-table"] tbody tr {
    background: #0f2a44;           /* row background = card background */
    border-radius: 5px;            /* will be applied via cell radii */
}

[class*="-leagues-table"] td {
    padding: 10px 6px;
    background: #0f2a44;           /* same as row background */
    color: #ccc;
    text-align: center;
    border: none;                  /* no borders – we use the row background */
}

/* Rounded corners for each row (card effect) */
[class*="-leagues-table"] tbody tr td:first-child {
    border-radius: 5px 0 0 5px;
}
[class*="-leagues-table"] tbody tr td:last-child {
    border-radius: 0 5px 5px 0;
}


[class*="-leagues-table"] tbody tr:hover td:first-child {
    border-radius: 5px 0 0 5px;
}
[class*="-leagues-table"] tbody tr:hover td:last-child {
    border-radius: 0 5px 5px 0;
}

/* Column widths – give the Win Rate column the most space */
[class*="-leagues-table"] th:nth-child(1),
[class*="-leagues-table"] td:nth-child(1) { /* League name + flag */
    width: 22%;
    text-align: left;
}
[class*="-leagues-table"] th:nth-child(2),
[class*="-leagues-table"] td:nth-child(2) { /* Matches */
    width: 7%;
}
[class*="-leagues-table"] th:nth-child(3),
[class*="-leagues-table"] td:nth-child(3) { /* Wins */
    width: 7%;
}
[class*="-leagues-table"] th:nth-child(4),
[class*="-leagues-table"] td:nth-child(4) { /* Losses */
    width: 7%;
}
[class*="-leagues-table"] th:nth-child(5),
[class*="-leagues-table"] td:nth-child(5) { /* Win Rate (progress bar) */
    width: 28%;
}
[class*="-leagues-table"] th:nth-child(6),
[class*="-leagues-table"] td:nth-child(6) { /* Profit */
    width: 9%;
}
[class*="-leagues-table"] th:nth-child(7),
[class*="-leagues-table"] td:nth-child(7) { /* ROI */
    width: 8%;
}
[class*="-leagues-table"] th:nth-child(8),
[class*="-leagues-table"] td:nth-child(8) { /* Avg Odds */
    width: 8%;
}
[class*="-leagues-table"] th:nth-child(9),
[class*="-leagues-table"] td:nth-child(9) { /* Details */
    width: 6%;
}

[class*="-league-cell"] {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    padding-left: 6px;
}

[class*="-flag-icon"] {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #999;
    flex-shrink: 0;
}

[class*="-league-name"] {
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    font-size: 0.8rem;
}

/* Progress bar – expands to fill its cell */
[class*="-progress-bar"] {
    width: 100% !important;
    max-width: 100% !important;
    background: #1e4a76;
    border-radius: 2px;
    overflow: hidden;
    height: 26px;
    position: relative;
    margin: 0 auto;
}

[class*="-progress-fill"] {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.4s ease;
    border-radius: 2px;
    min-width: 30px;
}

[class*="-progress-text"] {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 4px rgba(0,0,0,0.5);
    white-space: nowrap;
}

[class*="-details-btn"] {
    padding: 3px 12px;
    border-radius: 20px;
    background: #1976d2;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}
[class*="-details-btn"]:hover {
    background: #1565c0;
    color: #fff;
    text-decoration: none;
}
[class*="-details-btn"].disabled {
    background: #444;
    color: #888;
    cursor: default;
    pointer-events: none;
}

.cf-common-header {
    /* στυλ που ισχύουν για ΟΛΑ τα headers */
    border-radius: 10px;
    padding: 20px;
}

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

@media (max-width: 992px) {
    [class*="-grid-container"] {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    [class*="-leagues-table"] {
        font-size: 0.7rem;
        border-spacing: 0 6px;
    }
    [class*="-leagues-table"] th,
    [class*="-leagues-table"] td {
        padding: 6px 3px;
    }
    [class*="-flag-icon"] {
        width: 20px;
        height: 20px;
    }
    [class*="-progress-bar"] {
        height: 20px;
    }
    [class*="-progress-text"] {
        font-size: 0.6rem;
    }
    [class*="-league-name"] {
        font-size: 0.7rem;
    }
    [class*="-details-btn"] {
        padding: 2px 8px;
        font-size: 0.6rem;
    }
}

@media (max-width: 600px) {
    [class*="-grid-container"] {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    [class*="-leagues-table"] {
        font-size: 0.6rem;
        border-spacing: 0 4px;
    }
    [class*="-leagues-table"] th,
    [class*="-leagues-table"] td {
        padding: 4px 2px;
    }
    [class*="-flag-icon"] {
        width: 16px;
        height: 16px;
    }
    [class*="-progress-bar"] {
        height: 16px;
    }
    [class*="-progress-text"] {
        font-size: 0.5rem;
    }
    [class*="-details-btn"] {
        padding: 2px 6px;
        font-size: 0.5rem;
    }
}

/* Header with title and buttons side-by-side */
[class*="-title-wrap"] {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

[class*="-title-text"] {
    flex: 1 1 auto;
    min-width: 200px;
}

[class*="-header-buttons"] {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: 20px;
}

[class*="-tab-btn"] {
    padding: 8px 18px;
    background: transparent;
    border: 2px solid #1e4a76;
    color: #ccc;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

[class*="-tab-btn"]:hover {
    background: #1e4a76;
    color: #fff;
    border-color: #1e4a76;
}

[class*="-tab-btn"].active {
    background: #FE7E07;
    border-color: #FE7E07;
    color: #fff;
    cursor: default;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    [class*="-title-wrap"] {
        flex-direction: column;
        align-items: stretch;
    }
    [class*="-header-buttons"] {
        margin-left: 0;
        justify-content: center;
    }
}

/* ============================================================
   Color classes for stats (shared)
   ============================================================ */

.wins-positive { color: #4ade80 !important; font-weight: 700; }
.losses-negative { color: #f87171 !important; font-weight: 700; }
.winrate-positive { color: #4ade80 !important; font-weight: 700; }
.winrate-negative { color: #f87171 !important; font-weight: 700; }
.profit-positive { color: #4ade80 !important; font-weight: 700; }
.profit-negative { color: #f87171 !important; font-weight: 700; }
.roi-text-positive { color: #4ade80 !important; font-weight: 700; }
.roi-text-negative { color: #f87171 !important; font-weight: 700; }