/* Dashboard Statistics Component Styles - Universal Theme Compatible v2.0 */
/* Updated: 2026-01-14 - Colori neutri per tutti i temi */
.dashboard-container {
    padding: 1.5rem;
    background: transparent;
    min-height: 100%;
    color: inherit;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-title svg {
    color: #0d6efd;
    opacity: 0.9;
}

.last-update {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.7;
    font-size: 0.9rem;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(13, 110, 253, 0.5);
    background: transparent;
    color: #0d6efd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover:not(:disabled) {
    background: rgba(13, 110, 253, 0.1);
    border-color: #0d6efd;
}

.btn-refresh:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Alert Banners */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

.alert-banner.critical {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.5);
}

.alert-banner.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.5);
}

.alert-banner svg {
    flex-shrink: 0;
}

.alert-banner.critical svg {
    color: #dc3545;
}

.alert-banner.warning svg {
    color: #ffc107;
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-content strong {
    font-size: 1rem;
}

.alert-content span {
    font-size: 0.9rem;
    opacity: 0.85;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Ombra leggera base */
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15); /* Ombra pił pronunciata su hover */
    border-color: rgba(0, 0, 0, 0.2);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-card.users .kpi-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.kpi-card.devices .kpi-icon {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.kpi-card.sessions .kpi-icon {
    background: linear-gradient(135deg, #4fc3f7, #00bcd4);
}

.kpi-card.alerts .kpi-icon {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.kpi-card.alerts.has-alerts .kpi-icon {
    background: linear-gradient(135deg, #f44336, #c62828);
    animation: alertPulse 1.5s infinite;
}

@keyframes alertPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
}

.kpi-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: inherit;
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.kpi-sub {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

.kpi-sub .highlight {
    color: #0d6efd;
    font-weight: 600;
    opacity: 1;
}

.kpi-sub .highlight.online {
    color: #198754;
}

.kpi-sub .highlight.warning {
    color: #fd7e14;
}

/* Storage Section */
.storage-section {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.section-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title svg {
    color: #0d6efd;
    opacity: 0.9;
}

.storage-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 800px) {
    .storage-content {
        grid-template-columns: 1fr;
    }
}

/* Gauge */
.storage-gauge {
    flex: 1;
}

.gauge-outer {
    height: 24px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease, background 0.3s ease;
    position: relative;
}

.gauge-fill.normal {
    background: linear-gradient(90deg, #198754, #20c997);
}

.gauge-fill.moderate {
    background: linear-gradient(90deg, #20c997, #ffc107);
}

.gauge-fill.warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.gauge-fill.critical {
    background: linear-gradient(90deg, #fd7e14, #dc3545);
    animation: criticalPulse 1s infinite;
}

@keyframes criticalPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.gauge-current {
    font-weight: 600;
    color: inherit;
    opacity: 1;
}

/* Storage Details */
.storage-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    opacity: 0.7;
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 500;
    color: inherit;
}

.detail-value.highlight {
    color: #0d6efd;
    font-weight: 600;
}

.detail-value.warning {
    color: #fd7e14;
}

.detail-value.critical {
    color: #dc3545;
    font-weight: 700;
}

/* PCAP Retention */
.pcap-retention-grid {
    display: grid;
    grid-template-columns: 220px 1fr 260px;
    gap: 1.5rem;
    align-items: center;
}

.pcap-status-card {
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.pcap-status-card.normal {
    background: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.35);
}

.pcap-status-card.warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.35);
}

.pcap-status-card.critical {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.35);
}

.pcap-status-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.pcap-status-label,
.pcap-note {
    font-size: 0.8rem;
    opacity: 0.7;
}

.pcap-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 0 1.5rem;
}

.pcap-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 1000px) {
    .pcap-retention-grid {
        grid-template-columns: 1fr;
    }

    .pcap-detail-list {
        grid-template-columns: 1fr;
    }
}

/* Loading */
.loading-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}
