/**
 * Matches Schedule Styles
 *
 * Card-based layout - temporary, will be replaced later
 * All classes prefixed with 'oe-' for easy identification
 */

/* Container */
.oe-matches-schedule {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* No matches message */
.oe-no-matches {
    text-align: center;
    padding: 40px;
    background: #f5f5f5;
    border-radius: 8px;
    color: #666;
}

/* Date group */
.oe-date-group {
    margin-bottom: 30px;
}

.oe-date-header {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

/* Matches grid */
.oe-matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Match card link wrapper */
.oe-match-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Match card */
.oe-match-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
    transition: box-shadow 0.2s ease;
}

.oe-match-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* League header */
.oe-league-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.oe-league-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.oe-league-name {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Teams section */
.oe-teams-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Team */
.oe-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.oe-team-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 8px;
}

.oe-team-logo-placeholder {
    background: #f0f0f0;
    border-radius: 50%;
}

.oe-team-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    max-width: 100px;
    word-wrap: break-word;
}

/* Center section (VS and time) */
.oe-match-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
}

.oe-vs {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    margin-bottom: 4px;
}

.oe-time {
    font-size: 16px;
    font-weight: 700;
    color: #007bff;
}

/* X label under time */
.oe-odds-label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-top: 4px;
}

/* Odds row - mirrors teams-section layout */
.oe-odds-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    width: 100%;
}

.oe-odds-cell {
    flex: 1 1 33.33%;
    text-align: center;
    display: inline-block;
}

.oe-odds {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #28a745;
    padding: 5px 12px;
    border-radius: 4px;
}

/* ===========================================
   MATCHES WITH SIDEBAR LAYOUT
   =========================================== */

.oe-matches-layout {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.oe-matches-main {
    flex: 1;
    min-width: 0;
}

.oe-matches-main .oe-matches-schedule {
    max-width: none;
    padding: 0;
}

.oe-matches-aside {
    width: 280px;
    flex-shrink: 0;
}

/* ===========================================
   LEAGUE SIDEBAR STYLES
   =========================================== */

.oe-league-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    position: sticky;
    top: 20px;
}

.oe-league-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.oe-no-leagues {
    color: #666;
    font-size: 14px;
}

.oe-league-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.oe-league-country-header {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 15px 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.oe-league-country-header:first-child {
    margin-top: 0;
}

.oe-league-country-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.oe-league-item {
    margin: 0;
}

.oe-league-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.oe-league-link:hover {
    background: #f5f5f5;
}

.oe-league-item-active .oe-league-link {
    background: #007bff;
    color: #fff;
}

.oe-league-sidebar-logo-wrapper {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.oe-league-sidebar-logo {
    max-width: 24px;
    max-height: 24px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.oe-league-sidebar-logo-placeholder {
    width: 24px;
    height: 24px;
    background: #f0f0f0;
    border-radius: 4px;
}

.oe-league-sidebar-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===========================================
   LEAGUE PAGE STYLES
   =========================================== */

.oe-league-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.oe-league-page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #007bff;
}

.oe-league-page-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.oe-league-page-info {
    flex: 1;
}

.oe-league-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 5px 0;
}

.oe-league-page-country {
    font-size: 14px;
    color: #666;
}

.oe-league-page .oe-matches-schedule {
    max-width: none;
    padding: 0;
}

/* Error message */
.oe-error {
    text-align: center;
    padding: 40px;
    background: #fff3f3;
    border-radius: 8px;
    color: #cc0000;
    border: 1px solid #ffcccc;
}

/* ===========================================
   RESPONSIVE STYLES
   =========================================== */

@media (max-width: 992px) {
    .oe-matches-layout {
        flex-direction: column-reverse;
    }

    .oe-matches-aside {
        width: 100%;
    }

    .oe-league-sidebar {
        position: static;
    }

    .oe-league-country-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .oe-matches-schedule {
        padding: 10px;
    }

    .oe-matches-layout {
        padding: 10px;
        gap: 20px;
    }

    .oe-matches-grid {
        grid-template-columns: 1fr;
    }

    .oe-team-logo {
        width: 40px;
        height: 40px;
    }

    .oe-team-name {
        font-size: 11px;
    }

    .oe-league-page-header {
        gap: 15px;
    }

    .oe-league-page-logo {
        width: 45px;
        height: 45px;
    }

    .oe-league-page-title {
        font-size: 22px;
    }

    .oe-league-country-list {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===========================================
   STANDINGS TABLE STYLES
   =========================================== */

.oe-standings {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 12px;
    margin-bottom: 15px;
}

.oe-standings-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

.oe-no-standings {
    color: #666;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.oe-standings-table-wrapper {
    overflow-x: auto;
}

.oe-standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.oe-standings-table thead {
    background: #f8f9fa;
}

.oe-standings-table th {
    padding: 5px 4px;
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid #ddd;
}

.oe-standings-table th.oe-col-team {
    text-align: left;
}

.oe-standings-table td {
    padding: 4px 4px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.2;
    vertical-align: middle;
}

.oe-standings-table td.oe-col-team {
    text-align: left;
}

.oe-standings-table td.oe-col-pos {
    font-weight: 600;
    color: #666;
    width: 20px;
}

.oe-standings-table td.oe-col-points {
    color: #007bff;
}

.oe-standings-row {
    height: 28px;
}

.oe-standings-row:hover {
    background: #f8f9fa;
}

.oe-team-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.oe-standings-team-logo {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    min-width: 16px;
    min-height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.oe-standings-table img {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
}

.oe-standings-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Form badges */
.oe-form-badges {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.oe-form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    font-size: 9px;
    font-weight: 600;
    color: #fff;
}

.oe-form-win {
    background: #28a745;
}

.oe-form-draw {
    background: #6c757d;
}

.oe-form-loss {
    background: #dc3545;
}

/* Responsive standings */
@media (max-width: 768px) {
    .oe-standings {
        padding: 10px;
    }

    .oe-standings-table {
        font-size: 10px;
    }

    .oe-standings-table th,
    .oe-standings-table td {
        padding: 3px 2px;
    }

    .oe-standings-team-logo {
        width: 14px;
        height: 14px;
    }

    .oe-team-cell {
        gap: 4px;
    }

    .oe-form-badge {
        width: 12px;
        height: 12px;
        font-size: 8px;
    }

    /* Hide some columns on mobile */
    .oe-col-wins,
    .oe-col-draws,
    .oe-col-losses {
        display: none;
    }
}

/* ===========================================
   SEASON TABS
   =========================================== */

.oe-season-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.oe-season-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.oe-season-tab:hover {
    color: #333;
}

.oe-season-tab.oe-tab-active {
    color: #007bff;
}

.oe-season-tab.oe-tab-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #007bff;
}

.oe-season-content {
    display: none !important;
}

.oe-season-content.oe-content-active {
    display: block !important;
}

/* Winner highlight for previous season */
.oe-standings-row.oe-winner {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
}

.oe-standings-row.oe-winner td.oe-col-pos {
    color: #d4af37;
}

.oe-winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    font-size: 10px;
    color: #d4af37;
}

/* ===========================================
   PLAYED MATCHES STYLES
   =========================================== */

.oe-played-matches {
    margin-top: 25px;
}

.oe-played-matches-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.oe-played-matches .oe-date-header-small {
    font-size: 14px;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.oe-played-matches-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.oe-played-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.oe-played-match:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    background: #fafafa;
}

.oe-played-match-team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.oe-played-match-home {
    justify-content: flex-start;
}

.oe-played-match-away {
    justify-content: flex-end;
}

.oe-played-match-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.oe-played-match-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oe-played-match-score {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 15px;
    flex-shrink: 0;
}

.oe-score-home,
.oe-score-away {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    min-width: 20px;
    text-align: center;
}

.oe-score-separator {
    font-size: 14px;
    color: #999;
}

/* Responsive played matches */
@media (max-width: 768px) {
    .oe-played-match {
        padding: 8px 10px;
    }

    .oe-played-match-logo {
        width: 20px;
        height: 20px;
    }

    .oe-played-match-name {
        font-size: 12px;
    }

    .oe-played-match-score {
        padding: 0 10px;
    }

    .oe-score-home,
    .oe-score-away {
        font-size: 14px;
    }
}

/* ===========================================
   PLAYER STATS (SORTABLE TABLE) STYLES
   =========================================== */

.oe-player-stats {
    margin-top: 20px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 12px;
}

.oe-player-stats-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

/* Sort buttons */
.oe-player-stats-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.oe-sort-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.oe-sort-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.oe-sort-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.oe-sort-btn.oe-sort-active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

/* Stats table */
.oe-player-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.oe-player-stats-table thead {
    background: #f8f9fa;
}

.oe-player-stats-table th {
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid #ddd;
}

.oe-player-stats-table th.oe-col-player {
    text-align: left;
}

.oe-player-stats-table td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.oe-player-stats-table td.oe-col-player {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.oe-player-stats-table td.oe-col-rank {
    font-weight: 600;
    color: #666;
    width: 30px;
}

.oe-player-stats-table tr:hover {
    background: #f8f9fa;
}

/* Card styling */
.oe-col-cards {
    white-space: nowrap;
}

.oe-card {
    display: inline-block;
    min-width: 18px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 2px;
    font-weight: 600;
    font-size: 11px;
    margin: 0 1px;
}

.oe-card-yellow {
    background: #ffc107;
    color: #000;
}

.oe-card-yellowred {
    background: linear-gradient(135deg, #ffc107 50%, #dc3545 50%);
    color: #000;
}

.oe-card-red {
    background: #dc3545;
    color: #fff;
}

.oe-no-cards {
    color: #ccc;
}

/* Responsive player stats */
@media (max-width: 768px) {
    .oe-player-stats-table td.oe-col-player {
        max-width: 100px;
    }

    .oe-player-stats-sort {
        justify-content: center;
    }
}

/* ===========================================
   TOURNAMENT PAGE STYLES
   Isolated from regular league pages
   =========================================== */

.oe-tournament-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Tournament season content */
.oe-tournament-season-content {
    display: none !important;
}

.oe-tournament-season-content.oe-content-active {
    display: block !important;
}

/* Phase tabs (Qualification, League, Knockout) */
.oe-phase-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.oe-phase-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.oe-phase-tab:hover {
    color: #333;
    background: rgba(0, 123, 255, 0.05);
}

.oe-phase-tab.oe-tab-active {
    background: #007bff;
    color: #fff;
}

/* Phase content */
.oe-phase-content {
    display: none !important;
}

.oe-phase-content.oe-content-active {
    display: block !important;
}

/* Tournament group styling */
.oe-tournament-group {
    margin-bottom: 25px;
}

.oe-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

/* No data message */
.oe-no-data {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* ===========================================
   KNOCKOUT BRACKET STYLES
   =========================================== */

.oe-knockout-bracket {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Knockout stage */
.oe-ko-stage {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

.oe-ko-stage-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

/* Final stage highlight */
.oe-ko-final {
    background: linear-gradient(135deg, #fff9e6 0%, #fff 50%);
    border: 2px solid #ffd700;
}

.oe-ko-final .oe-ko-stage-title {
    color: #b8860b;
    border-bottom-color: #ffd700;
}

/* Semi-finals styling */
.oe-ko-semi {
    border-left: 4px solid #007bff;
}

/* Knockout matches container */
.oe-ko-matches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Individual knockout match */
.oe-ko-match {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.oe-ko-match:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.oe-ko-finished {
    background: #fff;
}

.oe-ko-upcoming {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9f5ff 100%);
}

/* Match header with date/time */
.oe-ko-match-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.oe-ko-date {
    font-size: 12px;
    font-weight: 600;
    color: #007bff;
}

.oe-ko-time {
    font-size: 12px;
    color: #666;
}

/* Teams in knockout match */
.oe-ko-teams {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oe-ko-team {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #fff;
    border-radius: 4px;
}

.oe-ko-team-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

/* VS / Score in center */
.oe-ko-versus {
    display: flex;
    justify-content: center;
    padding: 4px 0;
}

.oe-ko-vs {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
}

.oe-ko-score {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

/* Winner highlight */
.oe-ko-winner {
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
    border-color: #28a745;
}

.oe-ko-winner .oe-ko-team-name {
    color: #28a745;
    font-weight: 600;
}

/* Responsive knockout */
@media (max-width: 768px) {
    .oe-phase-tabs {
        flex-direction: column;
        gap: 4px;
    }

    .oe-phase-tab {
        text-align: center;
    }

    .oe-ko-stage {
        padding: 15px;
    }

    .oe-ko-matches {
        grid-template-columns: 1fr;
    }

    .oe-ko-stage-title {
        font-size: 16px;
    }
}
