/* ============================================================
   Glassmorphism + Animations — Lineasec Pannello
   Applies to all 3 panels (Admin/Agente/Veterinario)
   ============================================================ */

/* --- CSS Custom Properties per pannello --- */
:root {
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.35);
    --glass-blur: 12px;
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --glass-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
    --accent-gradient: none;
    --accent-border: rgba(229, 231, 235, 0.6);
}

/* Agente panel (Blue) */
[data-panel-id="agente"] {
    --accent-gradient: none;
    --accent-border: rgba(229, 231, 235, 0.6);
}

/* Veterinario panel (Teal) */
[data-panel-id="veterinario"] {
    --accent-gradient: none;
    --accent-border: rgba(229, 231, 235, 0.6);
}

/* --- Glass Card base: Stat cards, chart containers, sections --- */
.fi-wi-stats-overview-stat,
.fi-wi-chart,
.filament-apex-charts-widget,
.fi-section {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border) !important;
    border-radius: 1rem !important;
    box-shadow: var(--glass-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Inner section panels: remove double border/bg */
.fi-section .fi-section-content-ctn {
    background: transparent !important;
}
.fi-section .fi-section-header {
    background: transparent !important;
}

/* --- Accent gradient overlay on stat cards --- */
.fi-wi-stats-overview-stat {
    background-image: var(--accent-gradient) !important;
}

/* --- Hover lift on interactive cards --- */
.fi-wi-stats-overview-stat:hover,
.fi-wi-chart:hover,
.filament-apex-charts-widget:hover {
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow-hover);
}

/* --- Fade-in staggered animation --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fi-wi-stats-overview-stat,
.fi-wi-chart,
.filament-apex-charts-widget {
    animation: fadeInUp 0.5s ease both;
}

/* Stagger delay for stat cards */
.fi-wi-stats-overview-stat:nth-child(1) { animation-delay: 0.05s; }
.fi-wi-stats-overview-stat:nth-child(2) { animation-delay: 0.1s; }
.fi-wi-stats-overview-stat:nth-child(3) { animation-delay: 0.15s; }
.fi-wi-stats-overview-stat:nth-child(4) { animation-delay: 0.2s; }
.fi-wi-stats-overview-stat:nth-child(5) { animation-delay: 0.25s; }
.fi-wi-stats-overview-stat:nth-child(6) { animation-delay: 0.3s; }

/* Stagger delay for chart widgets */
.fi-widgets > div:nth-child(1) .fi-wi-chart,
.fi-widgets > div:nth-child(1) .filament-apex-charts-widget { animation-delay: 0.1s; }
.fi-widgets > div:nth-child(2) .fi-wi-chart,
.fi-widgets > div:nth-child(2) .filament-apex-charts-widget { animation-delay: 0.2s; }
.fi-widgets > div:nth-child(3) .fi-wi-chart,
.fi-widgets > div:nth-child(3) .filament-apex-charts-widget { animation-delay: 0.3s; }
.fi-widgets > div:nth-child(4) .fi-wi-chart,
.fi-widgets > div:nth-child(4) .filament-apex-charts-widget { animation-delay: 0.4s; }

/* --- ApexCharts transparent background --- */
.apexcharts-canvas,
.apexcharts-svg {
    background: transparent !important;
}

.filament-apex-charts-chart-container {
    background: transparent !important;
}

/* --- Table glass styling (ProvinceSalesWidget, resource tables) --- */
.glass-table {
    background: transparent;
}
.glass-table thead tr {
    border-bottom: 2px solid var(--accent-border);
}
.glass-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: background-color 0.2s ease;
}
.glass-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08);
}
.glass-table tfoot tr {
    border-top: 2px solid var(--accent-border);
}

/* --- Page background subtle gradient --- */
.fi-body {
    background-image: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 50%, #e8edf3 100%) !important;
}

/* --- Smooth transitions on page filter changes --- */
.fi-page .fi-widgets {
    transition: opacity 0.3s ease;
}

/* --- Livewire loading overlay: blur + spinner --- */
.lsc-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.lsc-loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.lsc-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(100, 116, 139, 0.2);
    border-top-color: #64748b;
    border-radius: 50%;
    animation: lsc-spin 0.7s linear infinite;
}
@keyframes lsc-spin {
    to { transform: rotate(360deg); }
}
