/* ============================================
   GradeFlow - Analytics Page Styles
   ============================================ */

.analytics-header {
    margin-bottom: 1.5rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .material-symbols-outlined {
    font-size: 1rem;
}

.time-filter {
    display: flex;
    padding: 0.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: fit-content;
    margin-bottom: 1.5rem;
    margin-left: auto;
}

.time-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.time-btn:hover {
    color: var(--text-primary);
}

.time-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Chart Cards */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.primary {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(19, 127, 236, 0.6);
}

.legend-dot.gray {
    background: var(--text-muted);
}

/* Chart Container */
.chart-container {
    height: 256px;
    position: relative;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background-image: radial-gradient(circle at 1px 1px, var(--bg-card) 1px, transparent 0);
    background-size: 24px 24px;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    font-size: 0.625rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Heatmap */
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.heatmap-scale {
    display: flex;
    gap: 0.25rem;
}

.scale-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.level-0 { background: var(--bg-input); }
.level-1 { background: var(--primary-20); }
.level-2 { background: var(--primary-40); }
.level-3 { background: rgba(19, 127, 236, 0.7); }
.level-4 { background: var(--primary); }

.heatmap-container {
    overflow-x: auto;
}

.heatmap-months {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding-left: 2rem;
    margin-bottom: 0.5rem;
}

.heatmap-wrapper {
    display: flex;
    gap: 0.5rem;
}

.heatmap-days {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.5625rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    height: 128px;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(52, 1fr);
    gap: 3px;
    flex: 1;
}

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

.heatmap-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    min-width: 10px;
    min-height: 10px;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Radar Chart */
.radar-container {
    position: relative;
    aspect-ratio: 1;
    max-width: 320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-container canvas {
    width: 100%;
    height: 100%;
}

/* Donut Chart */
.donut-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.donut-chart {
    position: relative;
    width: 192px;
    height: 192px;
}

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

.circle-bg {
    fill: none;
    stroke: var(--bg-input);
    stroke-width: 2;
}

.circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 300;
}

.donut-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Engagement Stats */
.engagement-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.engagement-stat {
    padding: 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.es-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.es-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.es-bar {
    height: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.es-fill {
    height: 100%;
    border-radius: var(--radius-full);
}

.es-fill.primary {
    background: var(--primary);
}

.es-fill.gray {
    background: var(--text-muted);
}

/* Insight Card */
.insight-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--primary-10);
    border: 1px solid var(--primary-20);
    border-radius: var(--radius-xl);
}

.insight-icon {
    color: var(--primary);
    font-size: 1.5rem;
}

.insight-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.insight-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.insight-text .highlight {
    color: var(--primary);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .time-filter {
        margin-left: 0;
    }
}