/* stats.css - Specific styles for the stats page */

/* --- Main Layout --- */
.stats-header {
    text-align: left;
    margin-bottom: 1.5rem; /* Reduced margin */
}

/* --- NEW: Attribution Note --- */
.attribution-note {
    border-left: 4px solid #4ade80;
    background-color: rgba(31, 41, 55, 0.5);
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 2rem;
    color: #d1d5db;
    font-size: 0.875rem;
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

/* On large screens, make the fitness card span the full width */
@media (min-width: 1024px) {
    #fitness-card {
        grid-column: 1 / -1;
        order: -1; /* Puts the fitness card first visually */
    }
}

/* --- Card Styling --- */
.stat-card {
    background-color: rgba(31, 41, 55, 0.3);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.stat-card:hover {
    border-color: #4ade80;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stat-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 2px solid #4ade80;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.stat-subtitle {
    font-family: 'Roboto Mono', monospace;
    color: #9ca3af;
    margin-top: 0.5rem;
}

/* --- Fitness Card Header & Year Selector --- */
.fitness-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background-color: #1f2937;
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid #374151;
}

.year-selector {
    display: flex;
}

.year-button {
    background-color: transparent;
    color: #d1d5db;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.year-button.active {
    background-color: #4ade80;
    color: #111827;
}

.frequency-display {
    font-family: 'Roboto Mono', monospace;
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-right: 1px solid #374151;
}


/* --- Country Flags --- */
#country-flags .country-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05); padding: 0.75rem;
    border-radius: 0.5rem; width: 80px; transition: background-color 0.3s;
}
#country-flags .country-item:hover { background-color: rgba(74, 222, 128, 0.1); }
#country-flags img {
    width: 40px; height: 30px; object-fit: cover;
    border-radius: 0.25rem; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
#country-flags span { font-size: 0.75rem; color: #d1d5db; text-align: center; }

/* --- Fitness Heatmap --- */
.heatmap-wrapper {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.heatmap-scroll-area {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4ade80 #374151;
}
.heatmap-scroll-area::-webkit-scrollbar { height: 6px; }
.heatmap-scroll-area::-webkit-scrollbar-track { background: #374151; border-radius: 3px; }
.heatmap-scroll-area::-webkit-scrollbar-thumb { background: #4ade80; border-radius: 3px; }

#month-labels {
    display: flex;
    padding-left: 30px; /* Offset for weekday labels */
    padding-bottom: 5px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.month-label {
    text-align: left;
    padding-left: 4px;
    white-space: nowrap;
}

.heatmap-body {
    display: flex;
    gap: 5px;
}

#weekday-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    font-size: 0.75rem;
    color: #9ca3af;
    padding-right: 5px;
    flex-shrink: 0;
}

#gym-heatmap-container {
    padding-bottom: 8px; /* Space for scrollbar if needed */
}

.heatmap {
    display: inline-grid;
    grid-template-rows: repeat(7, 1fr);
    grid-auto-flow: column;
    gap: 4px;
}

.heatmap-day {
    width: 15px;
    height: 15px;
    background-color: #2d333b;
    border-radius: 3px;
    opacity: 0.8;
}
.heatmap-day[data-level="1"] { background-color: #0e4429; }
.heatmap-day[data-level="2"] { background-color: #006d32; }
.heatmap-day[data-level="3"] { background-color: #26a641; }
.heatmap-day[data-level="4"] { background-color: #39d353; }

/* --- Heatmap Legend --- */
.heatmap-legend {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; color: #9ca3af;
    margin-top: 0.5rem;
}
.heatmap-legend .legend-item { display: flex; align-items: center; gap: 0.25rem; }
.heatmap-legend .legend-color { width: 12px; height: 12px; border-radius: 2px; }

/* --- Music List --- */
.music-item {
    display: flex; align-items: center; gap: 1rem; padding: 0.5rem;
    border-radius: 0.375rem; transition: background-color 0.2s;
}
.music-item:hover { background-color: rgba(255, 255, 255, 0.05); }
.music-item-icon { 
    color: #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
}
.music-item-info { line-height: 1.2; }
.music-item-title { font-weight: 600; color: #e5e7eb; }
.music-item-artist { font-size: 0.875rem; color: #9ca3af; }
.music-item-genre {
    font-style: italic;
    color: #6b7280;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

/* --- Live Status Card --- */
.live-status-content {
    flex-grow: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center; gap: 0.5rem; font-family: 'Roboto Mono', monospace;
}
.location-info {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1.125rem; color: #fff;
}
.location-info svg { color: #4ade80; }
.time-weather-info {
    display: flex; align-items: center; gap: 0.75rem;
    color: #9ca3af;
}
