/**
 * Team Matches Widget - Styles
 * Inspirowane betside.pl - ciemny motyw z zielonymi akcentami
 */

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

/* Sekcja ligi */
.tmw-league-section {
    border-bottom: 1px solid #2a2f3a;
}

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

/* Nagłówek ligi */
.tmw-league-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background-color: #232830;
    border-bottom: 1px solid #2a2f3a;
}

.tmw-league-flag,
.tmw-league-logo {
    width: 20px;
    height: 14px;
    object-fit: contain;
    border-radius: 2px;
}

.tmw-league-logo {
    width: 20px;
    height: 20px;
}

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

/* Pojedynczy mecz */
.tmw-match {
    display: grid;
    grid-template-columns: 50px 1fr 50px 40px;
    align-items: center;
    padding: 12px 16px;
    background-color: #1a1d24;
    border-bottom: 1px solid #252930;
    transition: background-color 0.2s ease;
}

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

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

/* Data meczu */
.tmw-match-date {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

/* Drużyny */
.tmw-match-teams {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.tmw-team-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

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

/* Wyróżnienie naszej drużyny */
.tmw-our-team .tmw-team-name {
    color: #ffffff;
    font-weight: 600;
}

/* Link do drużyny */
.tmw-team-link {
    text-decoration: none;
    transition: color 0.2s ease;
}

.tmw-team-link:hover {
    color: #22c55e !important;
    text-decoration: underline;
}

.tmw-our-team .tmw-team-link:hover {
    color: #4ade80 !important;
}

/* Wynik */
.tmw-match-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tmw-score-home,
.tmw-score-away {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Badge wyniku (Z/R/P) */
.tmw-match-result {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    margin-left: auto;
}

/* Wygrana - zielony (styl betside) */
.tmw-result-win {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

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

/* Porażka - czerwony */
.tmw-result-loss {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Komunikaty błędów */
.tmw-error {
    background-color: #2d1f1f;
    color: #fca5a5;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
    font-size: 14px;
    margin: 10px 0;
}

.tmw-no-matches {
    background-color: #1f2937;
    color: #9ca3af;
    padding: 24px;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
}

/* Responsywność */
@media (max-width: 480px) {
    .tmw-widget {
        border-radius: 0;
        margin: 0 -15px;
    }

    .tmw-match {
        grid-template-columns: 40px 1fr 40px 36px;
        padding: 10px 12px;
    }

    .tmw-team-name {
        font-size: 12px;
        max-width: 140px;
    }

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

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

    .tmw-match-result {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* Animacje ładowania */
@keyframes tmw-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.tmw-loading {
    animation: tmw-pulse 1.5s ease-in-out infinite;
}

/* Dodatkowe style dla motywu jasnego (opcjonalne) */
.tmw-widget.tmw-light {
    background-color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.tmw-widget.tmw-light .tmw-league-header {
    background-color: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.tmw-widget.tmw-light .tmw-league-name {
    color: #1e293b;
}

.tmw-widget.tmw-light .tmw-match {
    background-color: #ffffff;
    border-bottom-color: #f1f5f9;
}

.tmw-widget.tmw-light .tmw-match:hover {
    background-color: #f8fafc;
}

.tmw-widget.tmw-light .tmw-team-name {
    color: #475569;
}

.tmw-widget.tmw-light .tmw-our-team .tmw-team-name {
    color: #1e293b;
}

.tmw-widget.tmw-light .tmw-score-home,
.tmw-widget.tmw-light .tmw-score-away {
    color: #1e293b;
}
