/**
 * IK Sirius Matches Plugin Styles
 * Version: 1.0.5
 * Author: Edvin Unneberg - Agenci AB
 * Author URI: https://agenci.se
 */

/* Color variables - Sirius colors */
:root {
    --sirius-blue: #1D1D39;
    --sirius-navy: #1f2642;
    --sirius-light-blue: #4a90e2;
    --color-white: #ffffff;
    --color-light-gray: #f5f5f5;
    --color-border: #e0e0e0;
    --color-text-dark: #333333;
    --color-text-light: #666666;
    --color-success: #2e7d32;
    --color-warning: #e65100;
}

/* Container */
.sirius-matches-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Match Card */
.sirius-match-card {
    background: var(--color-white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-border);
}

/* Highlighted match (current match) */
.sirius-match-card.highlighted {
    border: 2px solid var(--sirius-blue);
    background: #E8F4FD;
}

/* Past matches - muted appearance */
.sirius-match-card.past-match {
    opacity: 0.7;
    background: var(--color-light-gray);
}

/* Match Header */
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
}

.round-badge {
    background: var(--sirius-blue);
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.match-date {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-text-dark);
}

.match-time {
    font-size: 0.95em;
    color: var(--color-text-light);
}

/* Match Teams */
.match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin: 24px 0;
}

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

.team-home {
    flex-direction: row;
}

.team-away {
    flex-direction: row-reverse;
    text-align: right;
}

.team-emblem {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-name {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--color-text-dark);
    line-height: 1.3;
}

/* VS / Score */
.match-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.vs-text {
    font-size: 1.8em;
    font-weight: 300;
    color: var(--color-text-light);
}

.match-score {
    font-size: 2em;
    font-weight: 700;
    color: var(--sirius-blue);
}

/* Match Info */
.match-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--color-border);
}

.arena {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-light);
    font-size: 0.95em;
}

.arena-icon {
    font-size: 1.2em;
}

/* Badge wrapper for multiple badges */
.badges-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Location Badge */
.location-badge {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-badge.home {
    background: #e8f5e9;
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.location-badge.away {
    background: #fff3e0;
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
}

/* Result Badges */
.result-badge {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-badge.result-win {
    background: #e8f5e9;
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.result-badge.result-loss {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #c62828;
}

.result-badge.result-draw {
    background: #fff9c4;
    color: #f57f17;
    border: 1px solid #f57f17;
}

/* Current Match Special Styling */
.sirius-current-match .sirius-match-card {
    padding: 32px;
}

.sirius-current-match .team-emblem {
    width: 80px;
    height: 80px;
}

.sirius-current-match .team-name {
    font-size: 1.5em;
}

.sirius-current-match .match-vs {
    min-width: 80px;
}

.sirius-current-match .vs-text,
.sirius-current-match .match-score {
    font-size: 2.5em;
}

/* Error Message */
.sirius-matches-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* Responsive Design */

/* Tablets */
@media (max-width: 768px) {
    .sirius-matches-container {
        padding: 16px;
    }

    .sirius-match-card {
        padding: 20px;
    }

    .match-header {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .match-datetime {
        align-items: center;
    }

    .match-teams {
        gap: 16px;
    }

    .team-emblem {
        width: 50px;
        height: 50px;
    }

    .team-name {
        font-size: 1.1em;
    }

    .match-vs {
        min-width: 50px;
    }

    .vs-text {
        font-size: 1.5em;
    }

    .match-score {
        font-size: 1.8em;
    }

    .match-info {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .badges-wrapper {
        justify-content: center;
    }

    /* Current match adjustments */
    .sirius-current-match .team-emblem {
        width: 70px;
        height: 70px;
    }

    .sirius-current-match .team-name {
        font-size: 1.3em;
    }

    .sirius-current-match .vs-text,
    .sirius-current-match .match-score {
        font-size: 2em;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .sirius-matches-container {
        padding: 12px;
    }

    .sirius-match-card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .round-badge {
        font-size: 0.8em;
        padding: 6px 12px;
    }

    .match-header {
        align-items: center;
    }

    .match-datetime {
        align-items: center;
    }

    .match-date {
        font-size: 1em;
    }

    .match-time {
        font-size: 0.85em;
    }

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

    .team-home {
        order: 1;
    }

    .match-vs {
        order: 2;
        min-width: auto;
        padding: 12px 0;
        border-top: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
    }

    .team-away {
        order: 3;
    }

    .team {
        gap: 10px;
    }

    .team-emblem {
        width: 45px;
        height: 45px;
    }

    .team-name {
        font-size: 1em;
    }

    .vs-text {
        font-size: 1.3em;
    }

    .match-score {
        font-size: 1.5em;
    }

    .match-info {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .arena {
        font-size: 0.9em;
    }

    .location-badge,
    .result-badge {
        font-size: 0.75em;
        padding: 5px 10px;
    }

    .badges-wrapper {
        justify-content: center;
    }

    /* Current match mobile adjustments */
    .sirius-current-match .sirius-match-card {
        padding: 20px;
    }

    .sirius-current-match .team-emblem {
        width: 55px;
        height: 55px;
    }

    .sirius-current-match .team-name {
        font-size: 1.1em;
    }

    .sirius-current-match .vs-text,
    .sirius-current-match .match-score {
        font-size: 1.6em;
    }
}

/* Print Styles */
@media print {
    .sirius-match-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }

    .round-badge {
        background: #000;
        color: #fff;
    }
}

/* Accessibility */
.team-emblem:focus {
    outline: 2px solid var(--sirius-blue);
    outline-offset: 2px;
}

/* Loading State */
.sirius-matches-loading {
    text-align: center;
    padding: 40px;
    color: var(--color-text-light);
}

.sirius-matches-loading::after {
    content: "...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}
