/**
 * Football Widgets - Styles
 * Ciemny motyw inspirowany betside.pl
 */

/* =========================================================================
   BAZOWE STYLE
   ========================================================================= */

.fw-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #1a1d24;
    border-radius: 12px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* =========================================================================
   LINKI - KOLOR #FBAF08
   ========================================================================= */

.fw-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.fw-link:hover {
    color: #FBAF08 !important;
    text-decoration: none !important;
}

.fw-our-team.fw-link:hover {
    color: #FBAF08 !important;
}

/* =========================================================================
   NAGŁÓWEK LIGI
   ========================================================================= */

.fw-league-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background-color: #232830;
    border-bottom: 1px solid #2a2f3a;
}

.fw-league-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.fw-league-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.fw-league-name {
    color: #e8e8e8;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* =========================================================================
   SEKCJA LIGI
   ========================================================================= */

.fw-league-section {
    border-bottom: 1px solid #2a2f3a;
}

.fw-league-section:last-child {
    border-bottom: none;
}

/* =========================================================================
   WIERSZ MECZU - KOMPAKTOWY
   ========================================================================= */

.fw-match-row {
    display: grid;
    grid-template-columns: 45px 1fr 40px 36px;
    align-items: center;
    padding: 6px 14px;
    background-color: #1a1d24;
    border-bottom: 1px solid #252930;
    transition: background-color 0.2s ease;
}

.fw-match-row:hover {
    background-color: #22262e;
}

.fw-match-row:last-child {
    border-bottom: none;
}

.fw-upcoming .fw-match-row {
    grid-template-columns: 45px 1fr 40px;
}

/* =========================================================================
   DATA MECZU
   ========================================================================= */

.fw-match-date {
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fw-match-time {
    color: #9ca3af;
    font-size: 10px;
}

/* =========================================================================
   DRUŻYNY - KOMPAKTOWE
   ========================================================================= */

.fw-match-teams {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fw-team-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fw-team-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.fw-team-logo-sm {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.fw-team-name {
    color: #d1d5db;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.fw-our-team {
    color: #ffffff;
    font-weight: 600;
}

/* =========================================================================
   WYNIK MECZU - KOMPAKTOWY
   ========================================================================= */

.fw-match-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.fw-match-score span {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.fw-match-vs {
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

/* =========================================================================
   BADGE WYNIKU (Z/R/P) - KOMPAKTOWY
   ========================================================================= */

.fw-result-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    margin-left: auto;
}

.fw-win {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.fw-draw {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.fw-loss {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* =========================================================================
   BADGE LIVE
   ========================================================================= */

.fw-live-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: fw-pulse 2s ease-in-out infinite;
}

.fw-live-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background-color: #1f2328;
    border-bottom: 1px solid #2a2f3a;
    font-size: 12px;
    color: #9ca3af;
}

@keyframes fw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* =========================================================================
   HEAD TO HEAD - KOMPAKTOWY
   ========================================================================= */

.fw-h2h-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background-color: #232830;
    border-bottom: 1px solid #2a2f3a;
}

.fw-h2h-team {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fw-h2h-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.fw-h2h-score {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    min-width: 26px;
    text-align: center;
}

.fw-h2h-score.fw-win {
    background: none;
    box-shadow: none;
    color: #22c55e;
}

.fw-h2h-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.fw-h2h-draws {
    font-size: 18px;
    font-weight: 700;
    color: #9ca3af;
}

.fw-h2h-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
}

.fw-h2h .fw-matches-list {
    padding: 0;
}

.fw-h2h .fw-match-row {
    grid-template-columns: 65px 1fr 40px auto;
}

.fw-match-info {
    color: #6b7280;
    font-size: 10px;
    text-align: right;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================================
   TABELA LIGOWA - KOMPAKTOWA
   ========================================================================= */

.fw-league-table .fw-league-header {
    padding: 10px 14px;
}

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

.fw-table thead {
    background-color: #232830;
}

.fw-table th {
    color: #9ca3af;
    font-weight: 600;
    padding: 6px 4px;
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid #2a2f3a;
}

.fw-table th.fw-col-team {
    text-align: left;
    padding-left: 12px;
}

.fw-table th.fw-col-pos {
    width: 30px;
}

.fw-table tbody tr {
    border-bottom: 1px solid #252930;
    transition: background-color 0.2s ease;
}

.fw-table tbody tr:hover {
    background-color: #22262e;
}

.fw-table tbody tr:last-child {
    border-bottom: none;
}

.fw-table td {
    padding: 5px 4px;
    text-align: center;
    color: #d1d5db;
}

.fw-table td.fw-col-pos {
    color: #9ca3af;
    font-weight: 600;
}

.fw-table td.fw-col-team {
    text-align: left;
    padding-left: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fw-table td.fw-col-pts {
    color: #ffffff;
    font-weight: 700;
}

/* Kolory promocji/spadku */
.fw-promo-champ td.fw-col-pos {
    border-left: 3px solid #ffd700;
}

.fw-promo-cl td.fw-col-pos {
    border-left: 3px solid #22c55e;
}

.fw-promo-el td.fw-col-pos {
    border-left: 3px solid #3b82f6;
}

.fw-promo-ecl td.fw-col-pos {
    border-left: 3px solid #06b6d4;
}

.fw-promo-down td.fw-col-pos {
    border-left: 3px solid #ef4444;
}

/* =========================================================================
   BŁĘDY
   ========================================================================= */

.fw-error {
    background-color: #2d1f1f;
    color: #fca5a5;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
    font-size: 14px;
    margin: 10px 0;
}

/* =========================================================================
   RESPONSYWNOŚĆ GŁÓWNA
   ========================================================================= */

@media (max-width: 600px) {
    .fw-widget {
        border-radius: 0;
        margin: 0 -15px;
    }

    .fw-match-row {
        grid-template-columns: 40px 1fr 40px 32px;
        padding: 10px 12px;
    }

    .fw-upcoming .fw-match-row {
        grid-template-columns: 40px 1fr 40px;
    }

    .fw-team-name {
        font-size: 12px;
        max-width: 130px;
    }

    .fw-team-logo {
        width: 18px;
        height: 18px;
    }

    .fw-match-date {
        font-size: 11px;
    }

    .fw-result-badge {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .fw-table {
        font-size: 11px;
    }

    .fw-table th,
    .fw-table td {
        padding: 8px 4px;
    }

    .fw-table td.fw-col-team {
        padding-left: 8px;
        gap: 6px;
    }

    .fw-team-logo-sm {
        width: 14px;
        height: 14px;
    }

    .fw-h2h-summary {
        padding: 12px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .fw-h2h-logo {
        width: 28px;
        height: 28px;
    }

    .fw-h2h-score {
        font-size: 16px;
    }

    .fw-h2h .fw-match-row {
        grid-template-columns: 55px 1fr 36px;
    }

    .fw-match-info {
        display: none;
    }
}

/* =========================================================================
   KOMPAKTOWY WIDOK KOLEJKI - PEŁNA SZEROKOŚĆ BLOKOWA
   ========================================================================= */

.fw-round-compact {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 12px;
}

.fw-round-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background-color: #232830;
    border-bottom: 1px solid #2a2f3a;
}

.fw-league-icon-sm {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.fw-round-title {
    color: #e8e8e8;
    font-size: 15px;
    font-weight: 600;
}

/* Selector kolejki */
.fw-round-select-wrap {
    margin-left: auto;
}

.fw-round-select {
    background-color: #1a1d24;
    color: #e8e8e8;
    border: 1px solid #3a3f4a;
    border-radius: 6px;
    padding: 8px 32px 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.2s, background-color 0.2s;
}

.fw-round-select:hover {
    border-color: #FBAF08;
    background-color: #22262e;
}

.fw-round-select:focus {
    outline: none;
    border-color: #FBAF08;
}

.fw-round-select option {
    background-color: #1a1d24;
    color: #e8e8e8;
}

/* Loading & no matches */
.fw-loading {
    padding: 30px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.fw-no-matches {
    padding: 30px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.fw-round-matches {
    padding: 0;
}

/* Wiersz meczu w kolejce - szeroki układ */
.fw-compact-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 1fr;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #252930;
    font-size: 14px;
    transition: background-color 0.2s;
}

.fw-compact-row:hover {
    background-color: #22262e;
}

.fw-compact-row:last-child {
    border-bottom: none;
}

.fw-compact-date {
    display: flex;
    flex-direction: column;
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
}

.fw-compact-date span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
}

.fw-compact-home {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    text-align: right;
    padding-right: 10px;
}

.fw-compact-home .fw-team-name,
.fw-compact-home .fw-link {
    font-size: 14px;
    color: #e8e8e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.fw-compact-away {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding-left: 10px;
}

.fw-compact-away .fw-team-name,
.fw-compact-away .fw-link {
    font-size: 14px;
    color: #e8e8e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.fw-team-logo-xs {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.fw-compact-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 100px;
    background-color: #232830;
    padding: 8px 16px;
    border-radius: 6px;
}

.fw-score-num {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.fw-score-sep {
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
}

.fw-score-vs {
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}

/* Responsywność kompaktowego widoku */
@media (max-width: 768px) {
    .fw-compact-row {
        grid-template-columns: 60px 1fr 80px 1fr;
        padding: 10px 14px;
        font-size: 13px;
    }

    .fw-compact-home,
    .fw-compact-away {
        gap: 8px;
        padding: 0 5px;
    }

    .fw-compact-home .fw-team-name,
    .fw-compact-home .fw-link,
    .fw-compact-away .fw-team-name,
    .fw-compact-away .fw-link {
        font-size: 13px;
    }

    .fw-team-logo-xs {
        width: 20px;
        height: 20px;
    }

    .fw-compact-score {
        padding: 6px 12px;
        min-width: 70px;
    }

    .fw-score-num {
        font-size: 15px;
    }

    .fw-compact-date {
        font-size: 11px;
    }

    .fw-compact-date span {
        font-size: 10px;
    }
}

@media (max-width: 500px) {
    .fw-round-compact {
        margin: 0 -15px;
        border-radius: 0;
    }

    .fw-round-header {
        padding: 12px 15px;
    }

    .fw-round-title {
        font-size: 13px;
    }

    .fw-compact-row {
        grid-template-columns: 50px 1fr 65px 1fr;
        padding: 8px 12px;
        font-size: 12px;
    }

    .fw-compact-home .fw-team-name,
    .fw-compact-home .fw-link,
    .fw-compact-away .fw-team-name,
    .fw-compact-away .fw-link {
        font-size: 11px;
    }

    .fw-team-logo-xs {
        width: 16px;
        height: 16px;
    }

    .fw-compact-date {
        font-size: 10px;
    }

    .fw-compact-date span {
        font-size: 9px;
    }

    .fw-score-num {
        font-size: 13px;
    }

    .fw-compact-score {
        padding: 5px 8px;
        min-width: 55px;
        gap: 6px;
    }
}
