/* Chess League Component - Frontend Styles */

.chessleague-standings,
.chessleague-schedule,
.chessleague-match {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cl-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #1a1a2e;
}

.cl-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* === STANDINGS TABLE === */
.cl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.cl-table thead {
    background: #1a1a2e;
    color: #fff;
}

.cl-table th {
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cl-table th.cl-team,
.cl-table td.cl-team {
    text-align: left;
}

.cl-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.cl-table tbody tr:hover {
    background: #f0f4ff;
}

.cl-table tbody tr.cl-top {
    background: #f0fdf0;
}

.cl-table tbody tr.cl-top:hover {
    background: #e0f5e0;
}

.cl-pos {
    width: 40px;
    font-weight: 700;
    color: #888;
}

.cl-pts {
    font-size: 1.05em;
}

.cl-team-logo {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    vertical-align: middle;
    border-radius: 2px;
}

/* === SCHEDULE === */
.cl-round {
    margin-bottom: 2rem;
}

.cl-round-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    padding: 8px 12px;
    background: #f5f5f5;
    border-left: 4px solid #1a1a2e;
    margin-bottom: 0.5rem;
}

.cl-round-date,
.cl-round-venue {
    font-weight: 400;
    font-size: 0.85rem;
    color: #888;
    margin-left: 12px;
}

.cl-matches-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cl-matches-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.cl-home-team {
    text-align: right;
    width: 40%;
    font-weight: 600;
}

.cl-away-team {
    text-align: left;
    width: 40%;
    font-weight: 600;
}

.cl-score {
    text-align: center;
    width: 20%;
}

.cl-score-link {
    text-decoration: none;
}

.cl-score-value {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    padding: 3px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.cl-score-link:hover .cl-score-value {
    background: #2d2d5e;
}

.cl-score-pending {
    color: #999;
    font-style: italic;
    font-size: 0.85rem;
}

/* === MATCH DETAIL === */
.cl-match-header {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
}

.cl-match-comp {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.cl-match-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cl-match-team {
    font-size: 1.2rem;
    font-weight: 700;
    min-width: 200px;
}

.cl-match-team.cl-home {
    text-align: right;
}

.cl-match-team.cl-away {
    text-align: left;
}

.cl-match-score {
    font-size: 2rem;
    font-weight: 900;
    background: #1a1a2e;
    color: #fff;
    padding: 8px 24px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.cl-match-date,
.cl-match-venue {
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Games table */
.cl-games-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.cl-games-table thead {
    background: #f5f5f5;
}

.cl-games-table th {
    padding: 8px 10px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 2px solid #ddd;
}

.cl-games-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
}

.cl-board-num {
    text-align: center;
    width: 50px;
    font-weight: 700;
    color: #888;
}

.cl-white {
    text-align: right;
}

.cl-black {
    text-align: left;
}

.cl-elo {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    width: 60px;
}

.cl-game-result {
    text-align: center;
    width: 80px;
}

.cl-result-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.85rem;
    background: #eee;
    color: #333;
}

.cl-result-badge.cl-win-white {
    background: #fff3e0;
    color: #e65100;
}

.cl-result-badge.cl-win-black {
    background: #e3f2fd;
    color: #1565c0;
}

.cl-result-badge.cl-draw {
    background: #f5f5f5;
    color: #666;
}

.cl-referee {
    margin-top: 1rem;
    color: #888;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .cl-match-result {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cl-match-team {
        text-align: center !important;
        min-width: auto;
    }

    .cl-table th,
    .cl-table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }

    .cl-home-team,
    .cl-away-team {
        width: 35%;
        font-size: 0.85rem;
    }
}

/* === TEAM DETAIL === */
.chessleague-team {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cl-team-header {
    margin-bottom: 1.5rem;
}

.cl-team-detail-logo {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.cl-team-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.cl-stat-box {
    text-align: center;
    padding: 12px 20px;
    background: #f5f5f5;
    border-radius: 6px;
    min-width: 80px;
}

.cl-stat-num {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a2e;
}

.cl-stat-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cl-stat-win { border-bottom: 3px solid #4caf50; }
.cl-stat-draw { border-bottom: 3px solid #ff9800; }
.cl-stat-loss { border-bottom: 3px solid #f44336; }

.cl-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 2rem 0 0.75rem 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #1a1a2e;
}

.fw-bold { font-weight: 700; }

.cl-table a:hover strong {
    text-decoration: underline;
}

/* === PLAYER PROFILE === */
.chessleague-player {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cl-player-info {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0.5rem 0 1rem;
}

.cl-player-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
}

.cl-table a:hover strong,
.cl-games-table a:hover {
    text-decoration: underline;
}

/* === FORM INDICATOR === */
.cl-form {
    white-space: nowrap;
}

.cl-form-dot {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    margin: 0 1px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.cl-form-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    color: #fff;
}

.cl-form-w { background: #4caf50; }
.cl-form-d { background: #ff9800; }
.cl-form-l { background: #f44336; }

/* Consistent result colors */
.cl-result-badge.cl-win-white { background: #e8f5e9; color: #2e7d32; }
.cl-result-badge.cl-win-black { background: #ffebee; color: #c62828; }
.cl-result-badge.cl-draw { background: #fff3e0; color: #e65100; }

a.cl-form-dot,
a.cl-form-dot:hover,
a.cl-form-dot:visited,
a.cl-form-dot:active,
a.cl-form-dot:focus {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none;
    outline: none;
}

.cl-form a {
    text-decoration: none !important;
    border-bottom: none !important;
}


    .cl-pg-opponent { flex: 1; }
}

/* === STAT BOX COLORS === */
.cl-stat-box.cl-stat-games {
    border-bottom: 3px solid #1a1a2e;
    background: #e8eaf6 !important;
}

.cl-stat-box.cl-stat-points {
    border-bottom: 3px solid #1565c0;
    background: #e3f2fd !important;
}

.cl-stat-box.cl-stat-win {
    background: #e8f5e9 !important;
}

.cl-stat-box.cl-stat-draw {
    background: #fff3e0 !important;
}

.cl-stat-box.cl-stat-loss {
    background: #ffebee !important;
}

/* === MATCH TABLE ALIGNMENT === */
.cl-table .cl-home-team {
    text-align: right;
}

.cl-table .cl-away-team {
    text-align: left;
}

.cl-table .cl-score {
    text-align: center;
}


/* === COMPACT TABLE FOR GAMES === */
.cl-table td, .cl-table th {
    padding: 5px 6px;
    font-size: 0.88rem;
}

.cl-table .cl-home-team,
.cl-table .cl-away-team {
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-team-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin: 0 3px;
}

/* === COMPACT SCORE === */
.cl-score-value {
    padding: 3px 8px !important;
    white-space: nowrap;
}

.cl-score {
    width: 80px;
    padding: 5px 4px !important;
}

/* === SCHEDULE COMPACT === */
.cl-schedule-match td {
    padding: 4px 5px !important;
}

.cl-schedule-match .cl-home {
    text-align: right;
    padding-right: 4px !important;
}

.cl-schedule-match .cl-away {
    text-align: left;
    padding-left: 4px !important;
}

.cl-schedule-match .cl-result {
    text-align: center;
    padding: 4px 2px !important;
    width: 70px;
}
