/* Stats Page Styles */

.stats-main {
    padding-top: 80px;
    min-height: 100vh;
}

/* Hero Section */
.stats-hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 60px 20px 40px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.stats-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, #27ae60 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.server-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 2px solid var(--accent);
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(46, 204, 113, 0.3); }
    50% { box-shadow: 0 0 30px rgba(46, 204, 113, 0.6); }
}

.status-icon {
    font-size: 1.5rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.last-update {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Stats Sections */
.stats-section {
    padding: 60px 20px;
    border-bottom: 1px solid var(--border);
}

.stats-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(46, 204, 113, 0.1), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-icon {
    font-size: 1.8rem;
}

.stat-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Courier New', monospace;
    text-align: center;
    margin: 10px 0;
}

/* Arma server name/map can be long; allow wrapping and shrink font */
.stat-value.arma-text {
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pulse-card .stat-value {
    animation: pulse 2s ease-in-out infinite;
}

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

.stat-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #27ae60);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Operation Detector */
.operation-detector {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.op-icon {
    font-size: 2rem;
    margin-right: 10px;
}

.op-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

/* Gaming Grid */
.gaming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.game-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px;
    transition: all 0.3s;
}

.game-card.featured {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--accent);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
}

.game-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.game-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.game-count {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.player-list {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.other-games-list {
    font-size: 0.95rem;
    line-height: 1.8;
}

.game-entry {
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

.game-entry:last-child {
    border-bottom: none;
}

/* Members Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.member-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.member-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid var(--border);
    transition: border-color 0.3s;
}

.member-card:hover .member-avatar {
    border-color: var(--accent);
}

.member-status {
    position: relative;
    display: inline-block;
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--bg-tertiary);
}

.status-dot.online { background: #2ecc71; }
.status-dot.idle { background: #f39c12; }
.status-dot.dnd { background: #e74c3c; }

.member-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.member-game {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Historical Stats */
.stat-card.historical {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

/* Charts */
.chart-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px;
    margin-top: 40px;
}

.chart-container h3 {
    margin-bottom: 20px;
    text-align: center;
}

/* Heatmap */
.heatmap-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px;
    margin-top: 30px;
}

.heatmap-container h3 {
    margin-bottom: 20px;
    text-align: center;
}

.heatmap {
    display: grid;
    gap: 4px;
    overflow-x: auto;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    min-width: 12px;
    min-height: 12px;
}

.heatmap-cell:hover {
    transform: scale(1.3);
    z-index: 10;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
}

.heatmap-cell.activity-0 { background: var(--bg-secondary); }
.heatmap-cell.activity-1 { background: rgba(46, 204, 113, 0.2); }
.heatmap-cell.activity-2 { background: rgba(46, 204, 113, 0.4); }
.heatmap-cell.activity-3 { background: rgba(46, 204, 113, 0.6); }
.heatmap-cell.activity-4 { background: rgba(46, 204, 113, 0.8); }
.heatmap-cell.activity-5 { background: rgba(46, 204, 113, 1); }

/* Engagement Metrics */
.engagement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.engagement-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
}

.engagement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent);
}

.engagement-card h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid var(--accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
    background: var(--bg-secondary);
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
}

.score-label {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.health-bar {
    width: 100%;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #27ae60);
    border-radius: 20px;
    transition: width 0.5s ease;
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    color: white;
    font-weight: 600;
}

.trend-indicator {
    font-size: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.trend-arrow {
    font-size: 3rem;
}

.trend-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.trend-indicator.up .trend-arrow { color: #2ecc71; }
.trend-indicator.down .trend-arrow { color: #e74c3c; }
.trend-indicator.stable .trend-arrow { color: #f39c12; }

/* Milestone Banner */
.milestone-banner {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    padding: 20px;
    text-align: center;
    z-index: 1000;
    animation: slideDown 0.5s ease-out;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.milestone-icon {
    font-size: 2rem;
    margin-right: 15px;
}

.milestone-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

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

    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

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

    .stat-value {
        font-size: 2rem;
    }

    .heatmap {
        overflow-x: scroll;
    }
    
    .heatmap-cell {
        min-width: 10px;
        min-height: 10px;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
