/* ========================================
   Charts & Visualizations
   ======================================== */

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.excellent { background: linear-gradient(90deg, #00ff88, #00cc6a); }
.progress-fill.good { background: linear-gradient(90deg, #7fff00, #5fcc00); }
.progress-fill.average { background: linear-gradient(90deg, #ffd700, #ccaa00); }
.progress-fill.below { background: linear-gradient(90deg, #ff8c00, #cc6f00); }
.progress-fill.poor { background: linear-gradient(90deg, #ff4444, #cc3535); }

/* Circular Progress */
.circular-progress {
    position: relative;
    width: 80px;
    height: 80px;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 8;
}

.circular-progress .bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.circular-progress .progress {
    stroke: var(--accent-gold);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.circular-progress .value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Radar Chart Container */
.radar-chart-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* Horizontal Bar Chart */
.h-bar-chart {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.h-bar-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.h-bar-label {
    width: 80px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
}

.h-bar-track {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.h-bar-fill {
    height: 100%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--spacing-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    min-width: 30px;
    transition: width 0.5s ease;
}

/* Sparkline */
.sparkline-container {
    position: relative;
    height: 40px;
    width: 100%;
}

.sparkline-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Weekly Progress Grid */
.weekly-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 2px;
    padding: var(--spacing-sm);
}

.week-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    transition: transform 0.2s ease;
}

.week-cell:hover {
    transform: scale(1.5);
    z-index: 10;
}

.week-cell.level-0 { background: rgba(255, 255, 255, 0.05); }
.week-cell.level-1 { background: rgba(0, 255, 136, 0.2); }
.week-cell.level-2 { background: rgba(0, 255, 136, 0.4); }
.week-cell.level-3 { background: rgba(0, 255, 136, 0.6); }
.week-cell.level-4 { background: rgba(0, 255, 136, 0.8); }
.week-cell.level-5 { background: rgba(0, 255, 136, 1); }

/* Stats Comparison */
.stats-comparison {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.comparison-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.comparison-label {
    width: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comparison-bars {
    flex: 1;
    display: flex;
    height: 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.comparison-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    transition: width 0.5s ease;
}

.comparison-bar.student {
    background: var(--accent-gold);
    color: var(--primary-color);
}

.comparison-bar.average {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* Rating Stars */
.rating-stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.2);
}

.star.filled {
    color: var(--accent-gold);
}

.star.half {
    position: relative;
}

.star.half::before {
    content: '★';
    position: absolute;
    overflow: hidden;
    width: 50%;
    color: var(--accent-gold);
}

/* Trend Indicator */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.trend-indicator.up {
    color: var(--rating-excellent);
    background: rgba(0, 255, 136, 0.1);
}

.trend-indicator.down {
    color: var(--rating-poor);
    background: rgba(255, 68, 68, 0.1);
}

.trend-indicator.stable {
    color: var(--rating-average);
    background: rgba(255, 215, 0, 0.1);
}

/* Gauge Chart */
.gauge-container {
    position: relative;
    width: 150px;
    height: 75px;
    overflow: hidden;
}

.gauge-bg {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(
        from 180deg,
        var(--rating-poor) 0deg,
        var(--rating-below) 36deg,
        var(--rating-average) 72deg,
        var(--rating-good) 108deg,
        var(--rating-excellent) 144deg,
        transparent 180deg
    );
    mask: radial-gradient(circle at center, transparent 60%, black 60%);
    -webkit-mask: radial-gradient(circle at center, transparent 60%, black 60%);
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 60px;
    background: var(--text-primary);
    border-radius: 2px;
    transform-origin: bottom center;
    transition: transform 0.5s ease;
}

.gauge-value {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Heatmap */
.heatmap-grid {
    display: grid;
    gap: 2px;
}

.heatmap-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
    border-radius: 2px;
    transition: transform 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* Month Progress Chart */
.month-progress {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.month-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.month-label {
    width: 60px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.month-bar-container {
    flex: 1;
    position: relative;
}

.month-bar {
    height: 24px;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.month-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding-left: var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    transition: width 0.5s ease;
}

.month-change {
    position: absolute;
    right: var(--spacing-sm);
    font-size: 0.7rem;
}

/* Leaderboard Position */
.leaderboard-position {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.position-rank {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.position-rank.gold { color: var(--accent-gold); }
.position-rank.silver { color: #c0c0c0; }
.position-rank.bronze { color: #cd7f32; }

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

/* Category Tags */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.category-tag {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-tag.linguistic { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }
.category-tag.logical { background: rgba(78, 205, 196, 0.2); color: #4ecdc4; }
.category-tag.musical { background: rgba(150, 111, 214, 0.2); color: #966fd6; }
.category-tag.bodily { background: rgba(255, 159, 67, 0.2); color: #ff9f43; }
.category-tag.visual { background: rgba(84, 160, 255, 0.2); color: #54a0ff; }
.category-tag.interpersonal { background: rgba(255, 107, 181, 0.2); color: #ff6bb5; }
.category-tag.intrapersonal { background: rgba(95, 39, 205, 0.2); color: #5f27cd; }
.category-tag.naturalistic { background: rgba(0, 210, 91, 0.2); color: #00d25b; }
.category-tag.existential { background: rgba(253, 203, 110, 0.2); color: #fdcb6e; }

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 400px;
}

.skeleton-text {
    height: 20px;
    margin-bottom: var(--spacing-sm);
}

.skeleton-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}
