/**
 * team-page.css
 * Team entertainment rankings page styles
 * Includes podium layout and team-specific card styling
 */

/* ========================================
   TEAM CARDS GRID
   ======================================== */

.team-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 0;
    background: #fafafa;
    padding: 15px;
    border-radius: 0;
    align-items: start;
}

/* Team card styling - matches game-card from cards.css */
.team-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    transition: transform 0.2s, box-shadow 0.2s, border 0.2s;
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
    isolation: isolate;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border-color: var(--accent-color);
}

/* Staggered animation */
.team-card:nth-child(1) { animation-delay: 0.05s; }
.team-card:nth-child(2) { animation-delay: 0.1s; }
.team-card:nth-child(3) { animation-delay: 0.15s; }
.team-card:nth-child(4) { animation-delay: 0.2s; }
.team-card:nth-child(5) { animation-delay: 0.25s; }
.team-card:nth-child(6) { animation-delay: 0.3s; }

/* Team logo */
.team-card-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
    margin: 0 auto 8px;
}

.team-card:hover .team-card-logo {
    transform: scale(1.1);
}

.team-card-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    transition: filter 0.2s ease;
}

.team-card:hover .team-card-logo img {
    filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* Rank badge */
.team-card-rank {
    position: absolute;
    top: 6px;
    left: 6px;
    font-weight: 700;
    font-size: 0.85em;
    color: #6b7280;
}

.team-card-rank.medal {
    font-size: 1.2em;
}

/* Rating badge */
.team-card-rating {
    position: absolute;
    top: 6px;
    right: 6px;
    font-weight: 700;
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 12px;
    color: white;
    text-align: right;
    white-space: normal;
    word-wrap: break-word;
}

.team-card-rating.excellent { background: #22c55e; }
.team-card-rating.good { background: #3b82f6; }
.team-card-rating.average { background: #f59e0b; }
.team-card-rating.poor { background: #ef4444; }

/* Team name */
.team-card-name {
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    color: #1f2937;
    margin-bottom: 8px;
}

/* Quick stats grid */
.team-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 0.75em;
}

.team-stat {
    background: #f9fafb;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
}

.team-stat-label {
    color: #6b7280;
    font-size: 0.85em;
    display: block;
}

.team-stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1em;
}

/* Expandable details */
.team-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
    padding-top: 0;
}

.team-card.expanded .team-card-details {
    max-height: 800px;
    margin-top: 8px;
    padding-top: 8px;
}

.team-details-content {
    font-size: 0.85em;
}

.team-details-section {
    margin-bottom: 12px;
}

.team-details-title {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.team-details-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.85em;
}

.team-details-label {
    color: #6b7280;
}

.team-details-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* ========================================
   PODIUM LAYOUT FOR TOP 3
   ======================================== */

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    padding: 35px 20px 15px;
    background: linear-gradient(135deg, #335B7B 0%, #4A7BA7 100%);
    margin-bottom: 20px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.podium-container::before {
    content: '🏆 Elite Entertainment';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1em;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.podium-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    order: 2;
}

.podium-team.rank-1 {
    order: 2;
}

.podium-team.rank-2 {
    order: 1;
}

.podium-team.rank-3 {
    order: 3;
}

.podium-card {
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    width: 200px;
    animation: podiumRise 0.6s ease-out forwards;
    opacity: 0;
}

/* Medal gradient backgrounds */
.podium-team.rank-1 .podium-card {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    border: 2px solid #ffed4e;
    animation-delay: 0.2s;
}

.podium-team.rank-2 .podium-card {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #c0c0c0 100%);
    border: 2px solid #e8e8e8;
    animation-delay: 0.1s;
}

.podium-team.rank-3 .podium-card {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a664 50%, #cd7f32 100%);
    border: 2px solid #e6a664;
    animation-delay: 0.3s;
}

@keyframes podiumRise {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.podium-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.podium-medal {
    font-size: 1.5em;
    margin: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    position: absolute;
    top: 4px;
    left: 4px;
}

.podium-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.podium-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.podium-team-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
    text-align: center;
}

.podium-rating {
    font-size: 0.9em;
    font-weight: 700;
    color: white;
    background: #22c55e;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 6px;
    text-align: right;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
    white-space: normal;
    word-wrap: break-word;
}

.podium-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    font-size: 0.75em;
}

.podium-stat {
    background: #f9fafb;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
}

.podium-stat-label {
    color: #6b7280;
    font-size: 0.85em;
    display: block;
}

.podium-stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1em;
}

.podium-platform {
    width: 200px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    border-radius: 8px 8px 0 0;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.3);
}

.podium-team.rank-1 .podium-platform {
    height: 40px;
    font-size: 1em;
}

.podium-team.rank-2 .podium-platform {
    height: 30px;
    font-size: 0.9em;
}

.podium-team.rank-3 .podium-platform {
    height: 25px;
    font-size: 0.85em;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .team-cards-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 10px;
        gap: 8px;
    }

    .team-card-logo {
        width: 48px;
        height: 48px;
    }

    .team-card-logo img {
        width: 38px;
        height: 38px;
    }

    .team-card-rating {
        max-width: 50%;
        font-size: 0.7em;
        padding: 2px 6px;
    }

    .podium-container {
        display: none;
    }
}
