/* Shared styles for stats (both standalone and popup) */

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--backgroundColor);
    min-height: 100vh;
}

.stats-popup-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
}

.stats-header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--backgroundColor2), var(--secondaryColor));
    padding: 30px;
    border-radius: 15px;
    color: white;
}

.stats-popup-container .stats-header {
    margin-bottom: 20px;
    padding: 20px;
}

.stats-header h1 {
    margin: 0;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stats-popup-container .stats-header h1 {
    font-size: 1.8em;
}

.game-status {
    font-size: 1.2em;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-popup-container .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid var(--secondaryColor);
    text-align: center;
}

.stats-popup-container .stat-card {
    padding: 15px;
}

.stat-icon {
    font-size: 2.5em;
    color: var(--backgroundColor2);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--backgroundColor2);
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 8px;
}

.stats-popup-container .stat-label {
    font-size: 1em;
    margin-bottom: 6px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--secondaryColor);
    margin-top: 12px;
    margin-bottom: 5px;
}

.stats-popup-container .stat-number {
    font-size: 1.8em;
    margin-top: 8px;
}

.stat-sublabel {
    color: var(--textColor);
    font-size: 0.9em;
}

.stat-subtext {
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.85em;
}

.honors-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.honors-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--lightGray);
    border-radius: 8px;
    background: #f8fafc;
}

.honors-item .honor-label {
    font-weight: 700;
    color: var(--backgroundColor2);
}

.honors-item .honor-detail {
    color: #4b5563;
    font-size: 0.95em;
}

.stat-link {
    margin-top: 10px;
    background: transparent;
    border: none;
    color: var(--secondaryColor);
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    text-decoration: underline;
}

.stat-list-toggle-btn {
    background: linear-gradient(135deg, var(--backgroundColor2), var(--secondaryColor));
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stat-list-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.stat-list-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.stat-list-toggle-btn i {
    font-size: 0.95em;
}

.leaderboard {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stats-popup-container .leaderboard {
    padding: 15px;
    margin-bottom: 15px;
}

.leaderboard h3 {
    color: var(--backgroundColor2);
    margin-bottom: 15px;
    margin-top: 0;
    font-size: 1.3em;
    padding: 0;
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-popup-container .leaderboard h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
    margin-top: 0;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--lightGray);
    cursor: pointer;
    transition: background-color 0.2s;
}

.leaderboard-item:hover {
    background-color: #f8f9fa;
}

.stats-popup-container .leaderboard-item {
    padding: 8px 0;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.expand-icon {
    color: var(--secondaryColor);
    font-size: 0.8em;
    margin-left: 10px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.leaderboard-item.expanded .expand-icon {
    transform: rotate(90deg);
}

.leaderboard-details {
    margin-top: 10px;
    padding-left: 45px;
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 10px 15px 10px 45px;
    border-left: 3px solid var(--secondaryColor);
}

.stats-popup-container .leaderboard-details {
    padding: 8px 12px 8px 35px;
    margin-top: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 0.9em;
    color: #666;
}

.stats-popup-container .detail-item {
    padding: 3px 0;
    font-size: 0.85em;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-name {
    flex-grow: 1;
}

.detail-count {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    color: #495057;
    flex-shrink: 0;
}

.stats-popup-container .detail-count {
    padding: 1px 6px;
    font-size: 0.75em;
}

.rank {
    background: var(--secondaryColor);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.stats-popup-container .rank {
    width: 25px;
    height: 25px;
    margin-right: 10px;
}

.rank.gold { background: #ffd700; color: #333; }
.rank.silver { background: #c0c0c0; color: #333; }
.rank.bronze { background: #cd7f32; color: white; }

.item-name {
    flex-grow: 1;
    font-weight: 500;
}

.stats-popup-container .item-name {
    font-size: 0.9em;
}

.item-count {
    background: var(--lightGray);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    color: var(--textColor);
    flex-shrink: 0;
}

.stats-popup-container .item-count {
    padding: 3px 8px;
    font-size: 0.8em;
}

.analysis-section {
    display: none; /* Hidden until call is revealed */
}

.analysis-section.revealed {
    display: block;
}

.winner-spotlight {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.stats-popup-container .winner-spotlight {
    padding: 15px;
    margin-bottom: 15px;
}

.winner-spotlight h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.5em;
}

.stats-popup-container .winner-spotlight h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.winner-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.stats-popup-container .winner-name {
    font-size: 1.4em;
    margin-bottom: 5px;
}

.winner-details {
    color: #666;
    font-size: 1.1em;
}

.stats-popup-container .winner-details {
    font-size: 0.9em;
}

.accuracy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stats-popup-container .accuracy-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.accuracy-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stats-popup-container .accuracy-card {
    padding: 10px;
}

.accuracy-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.stats-popup-container .accuracy-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.accuracy-count {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-popup-container .accuracy-count {
    font-size: 1.2em;
}

.accuracy-label {
    color: var(--textColor);
    font-size: 0.9em;
}

.stats-popup-container .accuracy-label {
    font-size: 0.8em;
}

.map-placeholder {
    background: linear-gradient(135deg, #f0f4f8, #d6e8f5);
    height: 400px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2em;
    border: 2px dashed #ccc;
    margin: 20px 0;
}

.stats-popup-container .map-placeholder {
    height: 200px;
    font-size: 0.9em;
    margin: 10px 0;
}

.section-toggle {
    text-align: center;
    margin: 30px 0;
}

.toggle-btn {
    background: var(--secondaryColor);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-btn:hover {
    background: var(--backgroundColor2);
}

.stat-list-container {
    display: flex;
    gap: 20px;
    margin: 10px 0 20px 0;
}

.stat-list {
    flex: 1;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 12px;
    max-height: 240px;
    overflow-y: auto;
}

.stat-list h4 {
    margin: 0 0 8px 0;
    color: var(--backgroundColor2);
    font-size: 0.95em;
}

.stat-list-item {
    padding: 4px 0;
    border-bottom: 1px solid var(--lightGray);
    font-size: 0.9em;
}

.stat-list-item:last-child {
    border-bottom: none;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .stats-popup-container .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .accuracy-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .stats-popup-container .accuracy-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}
