/* ═══════════════════════════════════════════════════════
   LOKLU Dashboard v1.0 — Phase 14
   Enhanced charts, 3D map controls, interactive panels
   ═══════════════════════════════════════════════════════ */

/* ── Dashboard Grid ──────────────────────────────── */
.loklu-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 20px 0;
    padding: 0 4px;
}
.loklu-dashboard .dash-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}
.loklu-dashboard .dash-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.loklu-dashboard .dash-card.full-width {
    grid-column: 1 / -1;
}
.loklu-dashboard .dash-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.loklu-dashboard .dash-card-title .icon {
    font-size: 16px;
}

/* ── Radar Chart ──────────────────────────────────── */
.radar-container {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}
.radar-container canvas {
    width: 100% !important;
    height: auto !important;
}
.radar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: center;
    margin-top: 10px;
    font-size: 11px;
}
.radar-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.radar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ── Score vs Average Bar Chart ──────────────────── */
.compare-bar-container {
    position: relative;
    width: 100%;
    height: 360px;
}

/* ── Donut Charts ─────────────────────────────────── */
.donut-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}
.mini-donut {
    text-align: center;
}
.mini-donut canvas {
    width: 120px !important;
    height: 120px !important;
}
.mini-donut-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
    font-weight: 600;
}

/* ── Map Controls Panel ──────────────────────────── */
.map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.map-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: background 0.15s, transform 0.1s;
}
.map-ctrl-btn:hover { background: #f1f5f9; }
.map-ctrl-btn.active { background: #ff7828; color: #fff; border-color: #ff7828; }
.map-ctrl-btn:active { transform: scale(0.92); }

/* ── Layer Toggles ────────────────────────────────── */
.layer-panel {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    max-width: 180px;
    display: none;
}
.layer-panel.show { display: block; }
.layer-panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 8px;
}
.layer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
}
.layer-toggle input[type="checkbox"] {
    accent-color: #ff7828;
    width: 15px;
    height: 15px;
}

/* ── Radius Slider ────────────────────────────────── */
.radius-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}
.radius-control label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}
.radius-control input[type="range"] {
    width: 140px;
    accent-color: #ff7828;
}
.radius-val {
    font-size: 12px;
    font-weight: 700;
    color: #ff7828;
    min-width: 40px;
    text-align: right;
}

/* ── Score Gauge ──────────────────────────────────── */
.score-gauge-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}
.score-ring-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
}
.score-stats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}
.stat-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.stat-val {
    font-weight: 700;
    margin-left: auto;
}

/* ── Competitor Table ─────────────────────────────── */
.comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.comp-table th {
    text-align: left;
    padding: 6px 8px;
    font-weight: 600;
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f1f5f9;
}
.comp-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f8fafc;
    color: #334155;
}
.comp-table tr:hover td {
    background: #f8fafc;
}
.comp-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}
.comp-distance {
    font-size: 11px;
    color: #94a3b8;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .loklu-dashboard {
        grid-template-columns: 1fr;
    }
    .radar-container {
        max-width: 320px;
    }
    .compare-bar-container {
        height: 300px;
    }
    .radius-control {
        width: calc(100% - 32px);
    }
}
