﻿/* Dashboard Main Styles */
:root {
    --primary-blue: #2E86C1;
    --light-blue: #85C1E9;
    --dark-blue: #1B4F72;
    --light-gray: #F8F9FA;
    --medium-gray: #6C757D;
    --dark-gray: #343A40;
    --success-green: #28A745;
    --warning-orange: #FD7E14;
    --danger-red: #DC3545;
    --admin-gold: #F39C12;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-gray);
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

    .dashboard-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    }

    .dashboard-card .card-header {
        background: transparent;
        border-bottom: 2px solid var(--light-blue);
        padding: 1.5rem;
        font-weight: 600;
        font-size: 1.1rem;
        color: var(--dark-blue);
    }

/* Metrics */
.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
}

.metric-label {
    color: var(--medium-gray);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.metrics-selection {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1rem;
}

.metric-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.form-check-label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Chart */
.chart-container {
    position: relative;
    height: 500px;
    padding: 20px;
}

.chart-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem;
    text-align: center;
    color: var(--medium-gray);
    font-size: 0.9rem;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-btn {
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--light-blue);
    color: var(--primary-blue);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .toolbar-btn:hover {
        background: var(--primary-blue);
        color: white;
    }

    .toolbar-btn.active {
        background: var(--primary-blue);
        color: white;
    }

/* Series Legend */
.series-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top:12px;
}

.series-legend-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.legend-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.legend-text {
    white-space: nowrap;
}

/* Statistics */
.statistic-item {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

    .statistic-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

.statistic-header {
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--medium-gray);
    margin-top: 2px;
}

/* Date Range */
.historic-values {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 1rem;
}

.date-input {
    border: 2px solid var(--light-blue);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s ease;
}

    .date-input:focus {
        border-color: var(--primary-blue);
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(46, 134, 193, 0.25);
    }

/* Loading States */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 2rem;
    color: var(--primary-blue);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
}

    .loading-spinner i {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

.performance-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: none;
    z-index: 100;
}

/* Buttons */
.btn-primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    transition: all 0.2s ease;
}

    .btn-primary:hover {
        background: var(--dark-blue);
        border-color: var(--dark-blue);
        transform: translateY(-1px);
    }

    .btn-primary:disabled {
        background: var(--medium-gray);
        border-color: var(--medium-gray);
        transform: none;
    }

.refresh-btn {
    background: var(--primary-blue);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

    .refresh-btn:hover {
        background: var(--dark-blue);
        transform: translateY(-1px);
    }

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(248, 215, 218, 0.5));
    color: #721c24;
    border-left: 4px solid var(--danger-red);
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(212, 237, 218, 0.5));
    color: #155724;
    border-left: 4px solid var(--success-green);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 243, 205, 0.5));
    color: #856404;
    border-left: 4px solid var(--warning-orange);
}

.alert-info {
    background: linear-gradient(135deg, rgba(46, 134, 193, 0.1), rgba(186, 225, 255, 0.5));
    color: var(--dark-blue);
    border-left: 4px solid var(--primary-blue);
}

.alert .btn-close {
    margin-left: auto;
    padding: 0.5rem;
}

/* Dashboard Alerts (Fixed position) */
.dashboard-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }

    .chart-container {
        height: 400px;
        padding: 10px;
    }

    .series-legend {
        margin-top: 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    .series-legend-item {
        margin-bottom: 5px;
    }

    .dashboard-alert {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 1rem;
        min-width: auto;
    }

    .metric-value {
        font-size: 2rem;
    }

    .toolbar-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .chart-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
