/* History Page Styling */

.history-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0.5rem 2rem 0.5rem;
}

/* Golden Theme Header Variant */
.history-header-gold {
    background: var(--gradient-gold) !important;
    border-bottom: 2px solid var(--accent-gold);
    padding: 2rem 1rem !important;
}

.history-header-gold .header-icon {
    color: var(--accent-gold);
}

.history-header-gold h1 {
    color: var(--accent-gold);
}

.history-header-gold .header-subtitle {
    color: var(--text-secondary);
}

/* History Grid */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.history-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.history-card.archived {
    opacity: 0.95;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.2) 100%);
    border-color: #fbbf24;
}

.history-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.history-card .card-header {
    margin-bottom: 1.5rem;
}

.history-card .card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
    margin: 0 0 0.5rem 0;
}

.history-card .card-date {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin: 0.25rem 0;
}

.history-card .card-ended {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0.25rem 0;
}

/* Card Stats */
.card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.card-stats .stat {
    text-align: center;
}

.card-stats .stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #60a5fa;
}

.card-stats .stat-label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Winner Banner */
.winner-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.winner-banner .trophy-icon {
    font-size: 2.5rem;
    color: var(--accent-gold);
}

.winner-banner .winner-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.winner-banner .winner-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #92400e;
    letter-spacing: 0.5px;
}

.winner-banner .winner-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.winner-banner .winner-points {
    font-size: 0.9rem;
    color: #78350f;
}

/* Card Footer */
.card-footer {
    margin-top: 1rem;
}

.btn-view-details {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-view-details:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state .empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    color: #94a3b8;
}

/* History Detail Page */
.history-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0.5rem;
}

/* Golden Theme Detail Header Variant */
.history-header-gold-detail {
    background: var(--gradient-gold) !important;
    border-bottom: 2px solid var(--accent-gold);
    text-align: center;
}

.history-header-gold-detail .header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.history-header-gold-detail h1 {
    color: var(--accent-gold);
}

.history-header-gold-detail .context-info,
.history-header-gold-detail .context-info-secondary {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0.25rem 0;
}

.archived-badge {
    padding: 0.5rem 1rem;
    background: #f59e0b;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-sm);
}

/* Winner Showcase */
.winner-showcase {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    border: 3px solid #f59e0b;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.winner-trophy {
    font-size: 5rem;
    color: var(--accent-gold);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.winner-content {
    flex: 1;
}

.winner-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 1rem 0;
}

.winner-team {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.team-color-indicator {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 3px solid rgba(0, 0, 0, 0.2);
}

.winner-team h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.winner-score {
    font-size: 1.25rem;
    font-weight: 600;
    color: #78350f;
    margin: 0;
}

/* Final Standings */
.final-standings {
    margin-bottom: 2rem;
}

.final-standings h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 1rem;
}

.standings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.standing-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.5);
    border: 2px solid rgba(100, 116, 139, 0.3);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.standing-item.winner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
    border-width: 3px;
}

.standing-item.winner .standing-team-name {
    color: #0f172a;
}

.standing-item.winner .standing-rank {
    color: #78350f;
}

.standing-item.winner .standing-points {
    color: #92400e;
}

.standing-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.standing-rank {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

/* Medal Icons with Colors */
.rank-medal {
    font-size: 1.5rem;
}

.rank-medal.gold {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.rank-medal.silver {
    color: #cbd5e1;
    text-shadow: 0 0 10px rgba(203, 213, 225, 0.5);
}

.rank-medal.bronze {
    color: #d97706;
    text-shadow: 0 0 10px rgba(217, 119, 6, 0.5);
}

.standing-team-name {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
}

.standing-points {
    font-size: 1.25rem;
    font-weight: 700;
    color: #60a5fa;
}

/* Games Recap */
.games-recap {
    margin-bottom: 2rem;
}

.games-recap h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 1rem;
}

.games-recap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.game-recap-card {
    background: rgba(30, 41, 59, 0.5);
    border: 2px solid rgba(100, 116, 139, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.game-recap-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.game-recap-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(100, 116, 139, 0.3);
}

.game-recap-header .game-number {
    font-size: 1rem;
    font-weight: 700;
    color: #94a3b8;
}

.game-recap-header h3 {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

.game-type-badge {
    padding: 0.25rem 0.75rem;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.game-recap-scores {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recap-score-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
}

.recap-team-name {
    flex: 1;
    font-weight: 600;
    color: #e2e8f0;
}

.recap-score-values {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recap-raw-score {
    font-size: 0.9rem;
    color: #94a3b8;
}

.score-arrow {
    color: #64748b;
}

.recap-points {
    font-weight: 700;
    color: #60a5fa;
}

/* Archive Notice */
.archive-notice {
    text-align: center;
    padding: 1.5rem;
    background: rgba(30, 41, 59, 0.5);
    border: 2px solid rgba(203, 213, 225, 0.2);
    border-radius: 12px;
    margin-top: 2rem;
}

.archive-notice p {
    font-size: 1rem;
    color: #94a3b8;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .history-container {
        padding: 0 0.35rem 1rem 0.35rem;
    }

    .history-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .history-header-gold {
        margin-bottom: 1.5rem;
        padding: 1.5rem 0.75rem !important;
    }

    .history-header-gold h1 {
        font-size: 1.5rem;
    }

    .history-header-gold .header-subtitle {
        font-size: 0.95rem;
    }

    .history-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .history-card .card-header h2 {
        font-size: 1.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .history-card .card-date,
    .history-card .card-ended {
        font-size: 0.85rem;
    }

    .card-stats {
        gap: 0.5rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .card-stats .stat-value {
        font-size: 1.5rem;
    }

    .card-stats .stat-label {
        font-size: 0.7rem;
    }

    .winner-banner {
        gap: 0.75rem;
        padding: 0.75rem;
        flex-wrap: wrap;
    }

    .winner-banner .trophy-icon {
        font-size: 2rem;
    }

    .winner-banner .winner-name {
        font-size: 1.1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .winner-banner .winner-points {
        font-size: 0.85rem;
    }

    .btn-view-details {
        padding: 0.625rem;
        font-size: 0.95rem;
    }

    /* Detail page mobile */
    .history-detail-container {
        padding: 1rem 0.35rem;
    }

    .history-header-gold-detail {
        padding: 1.5rem 1rem;
    }

    .history-header-gold-detail h1 {
        font-size: 1.75rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .archived-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .history-header-gold-detail .context-info {
        font-size: 1rem;
    }

    .winner-showcase {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
        gap: 1rem;
    }

    .winner-trophy {
        font-size: 3.5rem;
    }

    .winner-content h2 {
        font-size: 1.25rem;
        margin: 0 0 0.75rem 0;
    }

    .winner-team {
        justify-content: center;
        flex-wrap: wrap;
    }

    .winner-team h3 {
        font-size: 1.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        width: 100%;
        text-align: center;
    }

    .team-color-indicator {
        width: 32px;
        height: 32px;
    }

    .winner-score {
        font-size: 1.1rem;
    }

    .final-standings h2,
    .games-recap h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .standing-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .standing-rank {
        font-size: 1.25rem;
        min-width: 35px;
    }

    .standing-team-name {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .standing-points {
        font-size: 1.1rem;
    }

    .games-recap-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .game-recap-card {
        padding: 1.25rem;
    }

    .game-recap-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .game-recap-header h3 {
        font-size: 1.1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .game-recap-header .game-number {
        font-size: 0.9rem;
    }

    .game-type-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .recap-score-row {
        padding: 0.4rem;
    }

    .recap-team-name {
        font-size: 0.95rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .recap-raw-score {
        font-size: 0.85rem;
    }

    .recap-points {
        font-size: 0.95rem;
    }

    .archive-notice {
        padding: 1rem;
        margin-top: 1.5rem;
    }
}

@media (max-width: 480px) {
    .history-container {
        padding: 0 0.25rem 0.75rem 0.25rem;
    }

    .history-header-gold {
        padding: 1.25rem 0.5rem !important;
    }

    .history-header-gold h1 {
        font-size: 1.35rem;
    }

    .history-header-gold .header-content {
        gap: 0.5rem;
    }

    .history-header-gold .header-icon {
        font-size: 1.75rem;
    }

    .history-card {
        padding: 1rem;
    }

    .history-card .card-header h2 {
        font-size: 1.1rem;
    }

    .card-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
        padding: 0.5rem;
    }

    .card-stats .stat-value {
        font-size: 1.25rem;
    }

    .card-stats .stat-label {
        font-size: 0.65rem;
    }

    .winner-banner {
        padding: 0.5rem;
    }

    .winner-banner .trophy-icon {
        font-size: 1.75rem;
    }

    .winner-banner .winner-name {
        font-size: 1rem;
    }

    .history-header-gold-detail h1 {
        font-size: 1.5rem;
    }

    .winner-trophy {
        font-size: 3rem;
        color: var(--accent-gold);
    }

    .winner-team h3 {
        font-size: 1.25rem;
    }

    .standing-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .standing-rank {
        font-size: 1.1rem;
        min-width: 30px;
    }

    .standing-team-name {
        font-size: 0.9rem;
    }

    .standing-points {
        font-size: 1rem;
    }

    .game-recap-card {
        padding: 1rem;
    }

    .game-recap-header h3 {
        font-size: 1rem;
    }
}
