/**
 * CyberSec Academy - Advanced Dashboard & Analytics
 * Glassmorphism widgets with neon accents
 */

/* ===== Dashboard Grid ===== */
.adv-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===== Widget Base - Glass Panel ===== */
.adv-widget {
    background: linear-gradient(
        135deg,
        rgba(18, 18, 26, 0.6) 0%,
        rgba(18, 18, 26, 0.3) 100%
    );
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-lg, 16px);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

/* Frost overlay */
.adv-widget::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glass, linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%));
    pointer-events: none;
}

.adv-widget:hover {
    border-color: rgba(0, 255, 136, 0.15);
    box-shadow: var(--neon-green-sm, 0 0 15px rgba(0, 255, 136, 0.08));
}

.adv-widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    position: relative;
    z-index: 1;
}

.adv-widget-title i {
    color: var(--primary);
    filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.4));
}

/* ===== Skill Radar Chart ===== */
.adv-radar-container {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    position: relative;
    z-index: 1;
}

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

/* ===== Activity Heatmap ===== */
.adv-heatmap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

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

.adv-heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
    border: 1px solid transparent;
}

.adv-heatmap-cell:hover {
    transform: scale(1.3);
    z-index: 1;
}

.adv-heatmap-cell.level-0 {
    background: rgba(26, 26, 46, 0.8);
    border-color: rgba(255, 255, 255, 0.03);
}

.adv-heatmap-cell.level-1 {
    background: rgba(0, 255, 136, 0.12);
    border-color: rgba(0, 255, 136, 0.08);
}

.adv-heatmap-cell.level-2 {
    background: rgba(0, 255, 136, 0.3);
    border-color: rgba(0, 255, 136, 0.15);
}

.adv-heatmap-cell.level-3 {
    background: rgba(0, 255, 136, 0.5);
    border-color: rgba(0, 255, 136, 0.25);
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.15);
}

.adv-heatmap-cell.level-4 {
    background: rgba(0, 255, 136, 0.75);
    border-color: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.adv-heatmap-cell.level-3:hover,
.adv-heatmap-cell.level-4:hover {
    box-shadow: var(--neon-green-sm, 0 0 15px rgba(0, 255, 136, 0.15));
}

.adv-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    justify-content: flex-end;
}

.adv-heatmap-legend-cell {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* ===== Comparison Widget ===== */
.adv-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.adv-comparison-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.adv-comparison-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 100px;
}

.adv-comparison-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.adv-comparison-bar {
    height: 8px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.adv-comparison-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    position: relative;
}

.adv-comparison-fill.user {
    background: var(--gradient, linear-gradient(135deg, #00ff88, #0ea5e9));
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.adv-comparison-fill.avg {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.6), rgba(168, 85, 247, 0.3));
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.2);
}

.adv-comparison-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.adv-comparison-values .user-val {
    color: var(--primary);
    font-weight: 600;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.adv-comparison-values .avg-val {
    color: #a855f7;
}

/* Percentile - Glass panel */
.adv-percentile {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius, 12px);
    margin-top: 0.5rem;
}

.adv-percentile-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    text-shadow: var(--neon-green-text, 0 0 20px rgba(0, 255, 136, 0.4));
}

.adv-percentile-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Learning Paths ===== */
.adv-paths-grid {
    grid-column: 1 / -1;
}

.adv-paths-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.adv-path-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius, 12px);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    position: relative;
    overflow: hidden;
}

/* Neon top accent on hover */
.adv-path-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary, #0ea5e9));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.adv-path-card:hover {
    border-color: rgba(14, 165, 233, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--neon-blue-sm, 0 0 15px rgba(14, 165, 233, 0.1));
}

.adv-path-card:hover::before {
    opacity: 1;
}

.adv-path-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 6px rgba(0, 255, 136, 0.3));
}

.adv-path-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.adv-path-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.adv-path-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.adv-path-meta i {
    color: var(--primary);
    margin-right: 0.2rem;
    filter: drop-shadow(0 0 3px rgba(0, 255, 136, 0.3));
}

/* Progress bar - Neon trail */
.adv-path-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.adv-path-progress-fill {
    height: 100%;
    background: var(--gradient, linear-gradient(135deg, #00ff88, #0ea5e9));
    border-radius: 2px;
    transition: width 0.8s var(--ease-out-expo, cubic-bezier(0.16, 1, 0.3, 1));
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.3);
    position: relative;
}

/* Glow tip on progress */
.adv-path-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary), 0 0 16px rgba(0, 255, 136, 0.3);
}

.adv-path-progress-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    text-align: right;
}

/* ===== Loading ===== */
.adv-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .adv-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .adv-paths-list {
        grid-template-columns: 1fr;
    }

    .adv-comparison-row {
        flex-direction: column;
        align-items: stretch;
    }

    .adv-widget {
        padding: 1.25rem;
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .adv-widget { background: rgba(18, 18, 26, 0.95); }
    .adv-path-card { background: rgba(0, 0, 0, 0.95); }
    .adv-percentile { background: rgba(0, 0, 0, 0.95); }
}
