/**
 * NexusAI Dashboard Visualization Styles
 * Styles for timing gauges, radar charts, success donut, and timeline
 */

/* ============================================================================
   Dashboard Section Container
   ============================================================================ */

.dashboard-section {
    background: #FFFFFF;
    border: 1px solid var(--vox-grey-100);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--vox-grey-900);
    margin: 0;
}

.dashboard-subtitle {
    font-size: 0.9rem;
    color: var(--vox-grey-500);
}

/* ============================================================================
   Metrics Grid (Gauges)
   ============================================================================ */

.dashboard-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gauge-card {
    background: var(--vox-grey-50);
    border: 1px solid var(--vox-grey-100);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.gauge-container {
    width: 100%;
    height: 100px;
    margin: 0 auto;
}

.gauge-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--vox-grey-600);
    margin-top: 0.5rem;
}

/* ============================================================================
   Performance Dashboard Grid
   ============================================================================ */

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .performance-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .performance-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   Radar Chart Container
   ============================================================================ */

.radar-card {
    background: var(--vox-grey-50);
    border: 1px solid var(--vox-grey-100);
    border-radius: 0.75rem;
    padding: 1rem;
}

.radar-card-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.radar-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vox-grey-800);
    margin: 0;
}

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

/* ============================================================================
   Success Donut Chart Container
   ============================================================================ */

.donut-card {
    background: var(--vox-grey-50);
    border: 1px solid var(--vox-grey-100);
    border-radius: 0.75rem;
    padding: 1rem;
}

.donut-card-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.donut-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vox-grey-800);
    margin: 0;
}

.donut-container {
    width: 100%;
    height: 180px;
}

.donut-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.donut-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--vox-grey-600);
}

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

.donut-stat-dot.success {
    background: var(--vox-success);
}

.donut-stat-dot.failed {
    background: var(--vox-danger);
}

.donut-stat-dot.pending {
    background: var(--vox-grey-300);
}

/* ============================================================================
   Execution Timeline
   ============================================================================ */

.timeline-card {
    background: var(--vox-grey-50);
    border: 1px solid var(--vox-grey-100);
    border-radius: 0.75rem;
    padding: 1rem;
}

.timeline-card-header {
    margin-bottom: 0.5rem;
}

.timeline-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vox-grey-800);
    margin: 0;
}

.timeline-container {
    width: 100%;
    height: 320px;
    min-height: 200px;
}

/* ============================================================================
   Quick Stats Bar
   ============================================================================ */

.quick-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(34, 211, 238, 0.05) 100%);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-stat-icon {
    font-size: 1.25rem;
}

.quick-stat-content {
    display: flex;
    flex-direction: column;
}

.quick-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--vox-grey-900);
}

.quick-stat-label {
    font-size: 0.75rem;
    color: var(--vox-grey-500);
}

/* ============================================================================
   Dashboard Animations
   ============================================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-section {
    animation: fadeInUp 0.4s ease-out;
}

.gauge-card,
.radar-card,
.donut-card,
.timeline-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gauge-card:hover,
.radar-card:hover,
.donut-card:hover,
.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ============================================================================
   Mobile Responsive - Smaller Charts
   ============================================================================ */

@media (max-width: 768px) {
    .dashboard-section {
        padding: 1rem;
    }

    .dashboard-title {
        font-size: 1.1rem;
    }

    .dashboard-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .gauge-container {
        height: 70px;
    }

    .gauge-card {
        padding: 0.75rem;
    }

    .gauge-label {
        font-size: 0.7rem;
    }

    .radar-container {
        height: 160px;
    }

    .radar-card {
        padding: 0.75rem;
    }

    .radar-card-title {
        font-size: 0.8rem;
    }

    .donut-container {
        height: 130px;
    }

    .donut-card {
        padding: 0.75rem;
    }

    .donut-card-title {
        font-size: 0.8rem;
    }

    .donut-stats {
        gap: 1rem;
    }

    .donut-stat {
        font-size: 0.65rem;
    }

    .timeline-container {
        height: 200px;
        min-height: 150px;
    }

    .timeline-card {
        padding: 0.75rem;
    }

    .timeline-card-title {
        font-size: 0.8rem;
    }

    .quick-stats-bar {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .quick-stat-value {
        font-size: 0.95rem;
    }

    .quick-stat-label {
        font-size: 0.65rem;
    }

    /* Scene shell (3D graph) smaller on mobile */
    .scene-shell {
        height: 280px;
        min-height: 200px;
    }

    .scene-shell-lg {
        height: 320px;
    }
}

@media (max-width: 480px) {
    .dashboard-metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gauge-container {
        height: 60px;
    }

    .radar-container {
        height: 140px;
    }

    .donut-container {
        height: 110px;
    }

    .timeline-container {
        height: 160px;
        min-height: 120px;
    }

    .scene-shell {
        height: 220px;
        min-height: 180px;
    }

    .scene-shell-lg {
        height: 260px;
    }
}

/* ============================================================================
   ADDITIONAL MOBILE FIXES - Chart Scroll & Spacing
   ============================================================================ */
@media (max-width: 768px) {

    /* Performance grid with horizontal scroll for charts */
    .performance-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    /* Ensure charts maintain minimum readable width */
    .radar-card,
    .donut-card,
    .timeline-card {
        min-width: 280px;
    }

    /* Timeline scrollable wrapper */
    .timeline-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Better section spacing */
    .dashboard-section {
        margin-bottom: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Quick stats compact */
    .quick-stats-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .quick-stat {
        width: 100%;
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 0.5rem;
    }
}

/* Small mobile extra fixes */
@media (max-width: 480px) {
    .dashboard-section {
        padding: 0.75rem;
        border-radius: 0.75rem;
    }

    .dashboard-title {
        font-size: 1rem;
    }

    .dashboard-subtitle {
        font-size: 0.8rem;
    }

    .gauge-label {
        font-size: 0.65rem;
    }

    .donut-stat {
        font-size: 0.6rem;
    }

    /* Cards minimum tap size */
    .gauge-card,
    .radar-card,
    .donut-card,
    .timeline-card {
        min-height: 44px;
    }
}