/**
 * OddsEkspert V2 - League Page Styles
 *
 * Exact visual recreation of legacy league page styles
 * using BEM naming convention with oev2- prefix
 */

/* ===========================================
   LEAGUE PAGE LAYOUT
   =========================================== */

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

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

.oev2-league-page__logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.oev2-league-page__info {
    flex: 1;
}

.oev2-league-page__title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 5px 0;
}

.oev2-league-page__country {
    font-size: 14px;
    color: #666;
}

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

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

.oev2-season-tabs__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;
}

.oev2-season-tabs__tab:hover {
    color: #333;
}

.oev2-season-tabs__tab--active {
    color: #007bff;
}

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

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

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

/* ===========================================
   SUB-TABS (Overview, Standings, Matches, etc.)
   =========================================== */

.oev2-sub-tabs,
.oev2-league-sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.oev2-sub-tabs__tab,
.oev2-league-sub-tabs__tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #ddd;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.oev2-sub-tabs__tab:hover,
.oev2-league-sub-tabs__tab:hover {
    color: #007bff;
    border-color: #007bff;
}

.oev2-sub-tabs__tab--active,
.oev2-league-sub-tabs__tab--active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.oev2-sub-content,
.oev2-league-sub-content {
    display: none;
}

.oev2-sub-content--active,
.oev2-league-sub-content--active {
    display: block;
}

/* ===========================================
   AI LEAGUE OVERVIEW
   =========================================== */

.oev2-league-overview {
    position: relative;
}

.oev2-league-overview__content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    padding-top: 28px;
}

.oev2-league-overview__content p {
    margin: 0 0 16px 0;
}

.oev2-league-overview__content p:last-child {
    margin-bottom: 0;
}

.oev2-league-overview__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    position: absolute;
    top: 0;
    right: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oev2-league-overview__badge::before {
    content: '\2728';
}

.oev2-league-overview__placeholder {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.oev2-league-overview__placeholder-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.oev2-league-overview__placeholder-text {
    font-size: 14px;
}

/* ===========================================
   SEASON FINISHED NOTICE
   =========================================== */

.oev2-season-finished,
.oev2-season-finished-notice {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #495057;
}

.oev2-season-finished__icon,
.oev2-season-finished-notice__icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.oev2-season-finished__text,
.oev2-season-finished-notice__text {
    font-size: 15px;
    line-height: 1.6;
}

.oev2-season-finished__text small,
.oev2-season-finished-notice__text small {
    color: #6c757d;
}

/* ===========================================
   NO DATA MESSAGE
   =========================================== */

.oev2-no-data {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

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

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

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

.oev2-standings__wrapper {
    overflow-x: auto;
}

.oev2-standings__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.oev2-standings__table thead {
    background: #f8f9fa;
}

.oev2-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;
}

.oev2-standings__table th.oev2-col-team {
    text-align: left;
}

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

.oev2-standings__table td.oev2-col-team {
    text-align: left;
}

.oev2-standings__table td.oev2-col-pos {
    font-weight: 600;
    color: #666;
    width: 20px;
}

.oev2-standings__table td.oev2-col-points {
    color: #007bff;
    font-weight: 600;
}

.oev2-standings__row {
    height: 28px;
}

.oev2-standings__row:hover {
    background: #f8f9fa;
}

.oev2-standings__team-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.oev2-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;
}

.oev2-standings__team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.oev2-standings__row--winner td.oev2-col-pos {
    color: #d4af37;
}

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

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

.oev2-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;
}

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

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

.oev2-form-badge--loss {
    background: #dc3545;
}

/* ===========================================
   MATCHES GRID (UPCOMING)
   =========================================== */

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

.oev2-date-group {
    margin-bottom: 30px;
}

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

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

.oev2-match-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.oev2-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;
}

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

.oev2-match-card__header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.oev2-match-card__time {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oev2-match-card__teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.oev2-match-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.oev2-match-card__team-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 8px;
}

.oev2-match-card__team-logo-placeholder {
    width: 50px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 50%;
    margin-bottom: 8px;
}

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

.oev2-match-card__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 10px;
}

.oev2-match-card__vs {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    margin-bottom: 4px;
}

.oev2-match-card__odds-label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    margin-top: 4px;
}

.oev2-match-card__odds {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    width: 100%;
}

.oev2-match-card__odds-cell {
    flex: 1;
    text-align: center;
}

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

.oev2-match-card__round {
    text-align: center;
    padding: 6px 0 2px;
    border-top: 1px solid #f0f0f0;
    margin-top: 6px;
}

.oev2-match-card__round-text {
    font-size: 11px;
    color: #888;
    font-weight: 500;
}

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

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

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

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

.oev2-played-matches__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.oev2-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;
}

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

.oev2-played-match__team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.oev2-played-match__team--home {
    justify-content: flex-start;
}

.oev2-played-match__team--away {
    justify-content: flex-end;
}

.oev2-played-match__logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

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

.oev2-played-match__score {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 15px;
    flex-shrink: 0;
}

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

.oev2-played-match__score-separator {
    font-size: 14px;
    color: #999;
}

/* ===========================================
   PLAYER STATS (TOPSCORERS)
   =========================================== */

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

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

.oev2-player-stats__sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.oev2-player-stats__sort-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.oev2-player-stats__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;
}

.oev2-player-stats__sort-btn:hover {
    border-color: #007bff;
    color: #007bff;
}

.oev2-player-stats__sort-btn--active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.oev2-player-stats__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.oev2-player-stats__table thead {
    background: #f8f9fa;
}

.oev2-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;
}

.oev2-player-stats__table th.oev2-col-player {
    text-align: left;
}

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

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

.oev2-player-stats__table td.oev2-col-rank {
    font-weight: 600;
    color: #666;
    width: 30px;
}

.oev2-player-stats__table tr:hover {
    background: #f8f9fa;
}

/* Card styling */
.oev2-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;
}

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

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

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

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

/* ===========================================
   TOURNAMENT PAGE
   =========================================== */

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

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

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

/* Unified Tabs (Overview | Qualification | Groups | Knockout || Upcoming | Played | TopScorer) */
.oev2-unified-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.oev2-unified-tabs__tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #ddd;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.oev2-unified-tabs__tab:hover {
    color: #007bff;
    border-color: #007bff;
}

.oev2-unified-tabs__tab--active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.oev2-unified-tabs__separator {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 8px;
}

.oev2-unified-content {
    display: none;
}

.oev2-unified-content--active {
    display: block;
}

/* Tournament group title */
.oev2-tournament-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;
}

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

.oev2-phase-tabs__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;
}

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

.oev2-phase-tabs__tab--active {
    background: #007bff;
    color: #fff;
}

.oev2-phase-content {
    display: none !important;
}

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

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

.oev2-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;
}

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

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

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

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

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

.oev2-ko-stage--final .oev2-ko-stage__title {
    color: #b8860b;
    border-bottom-color: #ffd700;
}

.oev2-ko-stage--semi {
    border-left: 4px solid #007bff;
}

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

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

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

.oev2-ko-match--finished {
    background: #fff;
}

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

.oev2-ko-match__header {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

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

.oev2-ko-match__time {
    font-size: 12px;
    color: #666;
}

.oev2-ko-match__teams {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

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

.oev2-ko-match__versus {
    display: flex;
    justify-content: center;
    padding: 4px 0;
}

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

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

.oev2-ko-match__team--winner {
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
    border-color: #28a745;
}

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

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

@media (max-width: 768px) {
    .oev2-league-page {
        padding: 10px;
    }

    .oev2-league-page__header {
        gap: 15px;
    }

    .oev2-league-page__logo {
        width: 45px;
        height: 45px;
    }

    .oev2-league-page__title {
        font-size: 22px;
    }

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

    .oev2-match-card__team-logo {
        width: 40px;
        height: 40px;
    }

    .oev2-match-card__team-name {
        font-size: 11px;
    }

    .oev2-standings__table {
        font-size: 10px;
    }

    .oev2-standings__table th,
    .oev2-standings__table td {
        padding: 3px 2px;
    }

    .oev2-standings__team-logo {
        width: 14px;
        height: 14px;
    }

    .oev2-standings__team-cell {
        gap: 4px;
    }

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

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

    .oev2-played-match {
        padding: 8px 10px;
    }

    .oev2-played-match__logo {
        width: 20px;
        height: 20px;
    }

    .oev2-played-match__name {
        font-size: 12px;
    }

    .oev2-played-match__score {
        padding: 0 10px;
    }

    .oev2-played-match__score-home,
    .oev2-played-match__score-away {
        font-size: 14px;
    }

    .oev2-player-stats__table td.oev2-col-player {
        max-width: 100px;
    }

    .oev2-player-stats__sort {
        justify-content: center;
    }

    .oev2-phase-tabs {
        flex-direction: column;
        gap: 4px;
    }

    .oev2-phase-tabs__tab {
        text-align: center;
    }

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

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

    .oev2-ko-stage__title {
        font-size: 16px;
    }
}
