/* Team Heatmaps Specific Styles */

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    border: 1px solid #00d4ff33;
}

.stat-card .stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    display: block;
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section Description */
.section-desc {
    color: #888;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Heatmap Stats Row */
.heatmap-stats {
    background: #0f3460;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.heatmap-stats .stat-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.heatmap-stats span {
    color: #ddd;
}

.heatmap-stats strong {
    color: #00d4ff;
}

/* Heatmap Grid */
.heatmap-grid-wrapper {
    position: relative;
    background: #0a0a1a;
    border-radius: 8px;
    padding: 20px;
    overflow: hidden;
}

#heatmap-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Heatmap Legend */
.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.legend-label {
    font-size: 0.85rem;
    color: #888;
}

.legend-gradient {
    width: 200px;
    height: 20px;
    background: linear-gradient(to right,
        #1a1a2e 0%,
        #0d47a1 25%,
        #00d4ff 50%,
        #ffeb3b 75%,
        #ff5722 100%
    );
    border-radius: 4px;
}

/* Matchups Grid */
.matchups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.matchup-card {
    background: linear-gradient(135deg, #0f3460 0%, #1a2a4e 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #00d4ff22;
    transition: all 0.3s ease;
}

.matchup-card:hover {
    border-color: #00d4ff66;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.15);
}

.matchup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.matchup-teams {
    display: flex;
    align-items: center;
    gap: 10px;
}

.matchup-teams .team-abbrev {
    font-size: 1.3rem;
    font-weight: 700;
    color: #00d4ff;
}

.matchup-teams .vs {
    color: #666;
    font-size: 0.9rem;
}

.matchup-rank {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 20px;
}

.matchup-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.matchup-stats-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.matchup-stats-4 .matchup-stat {
    flex: none;
}

.matchup-stat {
    flex: 1;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
}

.matchup-stat .value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.matchup-stat .label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 3px;
    text-transform: uppercase;
}

.matchup-stat .zscore-raw {
    display: block;
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
    font-style: italic;
}

.matchup-names {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ffffff15;
    font-size: 0.85rem;
    color: #aaa;
}

.matchup-context {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(0, 212, 255, 0.08);
    border-left: 3px solid #00d4ff55;
    border-radius: 0 6px 6px 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #ccc;
    font-style: italic;
}

/* Z-Score Coloring (legacy) */
.zscore-excellent { color: #00ff88; }
.zscore-good { color: #00d4ff; }
.zscore-neutral { color: #888; }
.zscore-poor { color: #ff8888; }

/* 1-5 Score Coloring */
.score-elite { color: #ffd700; }
.score-excellent { color: #00ff88; }
.score-good { color: #00d4ff; }
.score-neutral { color: #888; }
.score-poor { color: #ff8888; }

/* Star icons */
.star-icon {
    width: 12px;
    height: 12px;
    display: inline-block;
    vertical-align: middle;
}

/* Matchup Badges */
.matchup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.matchup-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
    transition: all 0.2s ease;
}

.matchup-badge:hover {
    transform: scale(1.05);
}

.badge-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-icon svg {
    width: 100%;
    height: 100%;
}

.badge-label {
    white-space: nowrap;
}

/* Badge variants */
.badge-elite {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.badge-elite .badge-icon {
    color: #1a1a2e;
}

.badge-excellent {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.3);
}

.badge-excellent .badge-icon {
    color: #1a1a2e;
}

.badge-good {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.badge-good .badge-icon {
    color: #1a1a2e;
}

.badge-fire {
    background: linear-gradient(135deg, #ff6b35 0%, #ff4444 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.badge-fire .badge-icon {
    color: #fff;
}

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

.badge-warning .badge-icon {
    color: #fff;
}

.badge-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse-danger 2s ease-in-out infinite;
}

.badge-danger .badge-icon {
    color: #fff;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

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

.badge-neutral .badge-icon {
    color: #fff;
}

.badge-active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-active .badge-icon {
    color: #1a1a2e;
}

.badge-poor {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}

.badge-poor .badge-icon {
    color: #cbd5e1;
}

/* Team Logo in Cards (if used) */
.team-logo-small {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Loading state for matchups */
.matchups-grid .loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
}

/* Finder Section */
#finder-results h3 {
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .matchups-grid {
        grid-template-columns: 1fr;
    }

    .matchup-stats {
        flex-wrap: wrap;
    }

    .heatmap-stats .stat-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Glossary Section */
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.glossary-card {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #00d4ff22;
}

.glossary-card h4 {
    color: #00d4ff;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.glossary-card p {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 10px;
}

.glossary-card p:last-child {
    margin-bottom: 0;
}

.glossary-formula {
    background: rgba(0, 212, 255, 0.1);
    border-left: 3px solid #00d4ff;
    padding: 8px 12px;
    font-style: italic;
    color: #00d4ff !important;
}

.zscore-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.85rem;
}

.zscore-legend span {
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
}

#glossary-section h2 {
    border-bottom: 2px solid #00d4ff33;
    padding-bottom: 10px;
}

/* Badge Legend in Glossary */
.badge-legend-card {
    grid-column: span 2;
}

.badge-legend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.badge-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-legend-item .badge-desc {
    font-size: 0.85rem;
    color: #aaa;
}

.badge-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00d4ff;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-divider {
    border: none;
    border-top: 1px solid #00d4ff33;
    margin: 16px 0;
}

@media (max-width: 768px) {
    .badge-legend-card {
        grid-column: span 1;
    }

    .badge-legend-grid {
        grid-template-columns: 1fr;
    }
}

/* Sample Size Warning */
.sample-warning {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    border-radius: 0 6px 6px 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #f87171;
}

.sample-warning.sample-low {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #fbbf24;
}

/* Division Tags */
.division-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.division-tag.division {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid #22c55e55;
}

.division-tag.conference {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid #3b82f655;
}

/* Games Played Counter */
.games-played {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 8px;
}

/* Matchup Header Right side */
.matchup-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Filter row adjustments for more filters */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .sample-warning {
        font-size: 0.72rem;
    }
}

/* Today's Games Section */
.today-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.today-game-card {
    background: linear-gradient(135deg, #0f3460 0%, #1a2a4e 100%);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #00d4ff22;
    transition: all 0.3s ease;
}

.today-game-card:hover {
    border-color: #00d4ff55;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.12);
}

.game-time {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    font-weight: 500;
}

.game-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
}

.game-team {
    flex: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.game-team.team-advantage {
    border-color: #00d4ff55;
    background: rgba(0, 212, 255, 0.08);
}

/* Gold Edge Indicator for team with matchup advantage */
.game-team.team-edge {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 140, 0, 0.08) 100%);
    position: relative;
}

.edge-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 10px;
    z-index: 10;
}

.edge-indicator.edge-elite {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.6);
    animation: pulse-gold 1.5s ease-in-out infinite;
}

.edge-indicator.edge-strong {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.5);
}

.edge-indicator.edge-slight {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 6px rgba(0, 212, 255, 0.4);
}

@keyframes pulse-gold {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(255, 215, 0, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 2px 20px rgba(255, 215, 0, 0.9);
        transform: scale(1.05);
    }
}

/* Edge Legend */
.edge-legend {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #ffffff10;
}

.edge-legend-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #aaa;
}

.edge-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #ccc;
}

.edge-sample {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 8px;
}

.edge-sample.edge-elite {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #1a1a2e;
    box-shadow: 0 1px 6px rgba(255, 215, 0, 0.5);
}

.edge-sample.edge-strong {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #1a1a2e;
}

.edge-sample.edge-slight {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a2e;
}

.game-team .team-abbrev {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 2px;
}

.game-team .team-name {
    display: block;
    font-size: 0.75rem;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.game-team .team-ml {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.game-vs {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.game-total {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    display: inline-block;
    width: 100%;
}

.game-exploits {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ffffff15;
}

.exploit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.exploit-row:last-child {
    margin-bottom: 0;
}

.exploit-label {
    font-size: 0.78rem;
    color: #888;
    min-width: 75px;
}

.exploit-score {
    font-size: 1rem;
    font-weight: 700;
    min-width: 35px;
}

.exploit-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.exploit-badges .matchup-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* Detailed exploits for today's games */
.game-exploits-detailed {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ffffff15;
}

.team-exploit-section {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.team-exploit-section:last-child {
    margin-bottom: 0;
}

.matchup-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.team-exploit-section .matchup-stat {
    flex: 1;
    min-width: 60px;
    text-align: center;
}

.team-exploit-section .matchup-stat .value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

.team-exploit-section .matchup-stat .label {
    display: block;
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
}

.team-exploit-section .matchup-badges {
    margin-top: 6px;
}

.team-exploit-section .no-data {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

/* Percentile Badges for Today's Games */
.percentile-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    cursor: help;
    transition: all 0.2s ease;
}

.percentile-badge:hover {
    transform: scale(1.05);
}

.percentile-label {
    white-space: nowrap;
}

/* Percentile tier colors */
.percentile-elite {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    animation: glow-elite 2s ease-in-out infinite;
}

@keyframes glow-elite {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 2px 16px rgba(255, 215, 0, 0.8); }
}

.percentile-excellent {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.4);
}

.percentile-good {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.4);
}

.percentile-above {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(148, 163, 184, 0.3);
}

.percentile-below {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #d1d5db;
}

.percentile-poor {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
}

.percentile-unknown {
    background: rgba(255, 255, 255, 0.1);
    color: #888;
}

/* Team exploit header with percentile */
.team-exploit-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.no-games-message,
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1rem;
}

.error-message {
    color: #ff6b6b;
}

/* Today section responsive */
@media (max-width: 768px) {
    .today-games-grid {
        grid-template-columns: 1fr;
    }

    .game-matchup {
        flex-direction: column;
    }

    .game-team {
        width: 100%;
    }

    .game-vs {
        margin: 5px 0;
    }
}
