/**
 * Dashboard Live - Slate Realtime Effect
 * Colores con contraste suficiente para que el glass/slate sea visible
 */

/* Container con efecto slate visible */


/* Patrón sutil de fondo para dar textura al glass */
.dashboard-live-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(71, 85, 105, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(100, 116, 139, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(51, 65, 85, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bg-shift 12s ease-in-out infinite alternate;
}

.dashboard-live-container > * {
    position: relative;
    z-index: 1;
}

@keyframes slate-breathe {
    0%, 100% {
        background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    }
    50% {
        background: linear-gradient(180deg, #cbd5e1 0%, #b0bec9 100%);
    }
}

@keyframes bg-shift {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Cards con efecto glass visible */
.card-live,
.chart-card-live {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.card-live:hover,
.chart-card-live:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

/* Chart cards específicos */
.chart-card-live {
    margin-bottom: 15px;
    animation: chart-subtle-pulse 6s ease-in-out infinite;
}

.chart-card-live:nth-child(2) { animation-delay: 1s; }
.chart-card-live:nth-child(3) { animation-delay: 2s; }

@keyframes chart-subtle-pulse {
    0%, 100% {
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 
            0 4px 16px rgba(71, 85, 105, 0.12),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
}

.chart-card-live .card-header {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 10px;
}

.chart-card-live .card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

.apex-chart {
    min-height: 280px;
}

/* Summary table con efecto glass */
.summary-table-live {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/*
.summary-table-live thead th {
    background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
    color: white !important;
    border-color: rgba(51, 65, 85, 0.3) !important;
}
*/

.border-10 {
    border-radius: 10px;
}

/* Animated values */
.animated-value {
    transition: background-color 0.6s ease, color 0.3s ease;
}

.animated-value.value-updated {
    animation: value-flash 1.2s ease;
}

@keyframes value-flash {
    0%, 100% {
        background-color: transparent;
    }
    40% {
        background-color: rgba(99, 102, 241, 0.15);
    }
}

/* Negative values */
.text-danger {
    color: #dc2626 !important;
    font-weight: 600;
}

/* Filter buttons */
.btn-group-toggle .btn.active {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border-color: #334155;
}

/* Category colors */
.border-beer { border-color: #112e5b !important; }
.text-beer { color: #112e5b !important; }
.border-liquor { border-color: #a2c662 !important; }
.text-liquor { color: #a2c662 !important; }
.border-wine { border-color: #ed1b24 !important; }
.text-wine { color: #ed1b24 !important; }
.border-draft { border-color: #be03fd !important; }
.text-draft { color: #be03fd !important; }

/* Accordion */
#accordion .card-live {
    border-radius: 10px;
    overflow: hidden;
}

#accordion .btn-primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border: none;
}

/* Scrollbar */
.btn-group-vertical[style*="overflow-y: scroll"] {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
}

.btn-group-vertical[style*="overflow-y: scroll"]::-webkit-scrollbar {
    width: 5px;
}

.btn-group-vertical[style*="overflow-y: scroll"]::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.btn-group-vertical[style*="overflow-y: scroll"]::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

/* Animación cuando un valor cambia */
.value-updated {
    animation: flash-highlight 1.5s ease-out;
}

@keyframes flash-highlight {
    0% {
        background-color: rgba(59, 130, 246, 0.25);
        color: #1e40af;
    }
    100% {
        background-color: transparent;
        color: inherit;
    }
}

/* DataTables transitions */
table.dataTable tbody tr {
    transition: background-color 0.3s;
}

table.dataTable tbody td {
    transition: color 0.3s;
}

/* DataTables sobre fondo glass: hacer rows semi-transparentes */
.summary-table-live tbody tr,
.dashboard-live-container table.dataTable tbody tr {
    background-color: rgba(255, 255, 255, 0.4);
}

.summary-table-live tbody tr:hover,
.dashboard-live-container table.dataTable tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

/* Footer de la summary table */
.summary-table-live tfoot tr {
    background-color: rgba(241, 245, 249, 0.8) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-live-container {
        padding: 10px;
    }
    
    .apex-chart {
        min-height: 220px;
    }
}

@media (max-width: 512px) {
    #summary_table_m {
        font-size: 0.55rem;
    }
    
    #summary_table_m thead th {
        font-size: 0.75rem;
    }
}

/* Print */
@media print {
    .dashboard-live-container {
        background: white !important;
        animation: none !important;
    }
    
    .dashboard-live-container::before {
        display: none !important;
    }
    
    .card-live,
    .chart-card-live {
        background: white !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }
    
    @page {
        size: landscape;
    }
}