/*
 * Beautiful Dashboard Widget Styles for Vitalis EHR
 * Modern, Professional, and Responsive Design
 */

/* ===== ROOT VARIABLES ===== */
:root {
    --vitalis-primary: #3b82f6;
    --vitalis-success: #10b981;
    --vitalis-warning: #f59e0b;
    --vitalis-danger: #ef4444;
    --vitalis-info: #06b6d4;
    --vitalis-purple: #8b5cf6;
    --vitalis-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --vitalis-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --vitalis-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --vitalis-gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --vitalis-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --vitalis-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --vitalis-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --vitalis-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ===== MAIN WIDGET CONTAINER STYLES ===== */
.fi-widget {
    border-radius: 1.25rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    position: relative !important;
}

/* Hover effects for all widgets */
.fi-widget:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: var(--vitalis-shadow-xl) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* ===== STATS OVERVIEW WIDGET STYLES ===== */
.fi-wi-stats-overview {
    gap: 1.5rem !important;
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: var(--vitalis-shadow-md) !important;
    padding: 1.75rem !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

/* Dark mode stats */
.dark .fi-wi-stats-overview .fi-wi-stats-overview-stat {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%) !important;
    border-color: rgba(148, 163, 184, 0.1) !important;
    color: #f1f5f9 !important;
}

/* Add subtle gradient overlay */
.fi-wi-stats-overview .fi-wi-stats-overview-stat::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: var(--vitalis-gradient-1) !important;
    z-index: 1 !important;
}

/* Individual stat color themes */
.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(1)::before {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(2)::before {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(3)::before {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(4)::before {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Stat value styling */
.fi-wi-stats-overview-stat-value {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #1e293b, #475569) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    margin-bottom: 0.5rem !important;
}

.dark .fi-wi-stats-overview-stat-value {
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Stat label styling */
.fi-wi-stats-overview-stat-label {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 1rem !important;
}

.dark .fi-wi-stats-overview-stat-label {
    color: #94a3b8 !important;
}

/* Stat description styling */
.fi-wi-stats-overview-stat-description {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 1rem !important;
}

.dark .fi-wi-stats-overview-stat-description {
    color: #94a3b8 !important;
}

/* Icon styling in descriptions */
.fi-wi-stats-overview-stat-description .fi-icon {
    width: 1.125rem !important;
    height: 1.125rem !important;
    flex-shrink: 0 !important;
}

/* Chart styling within stats */
.fi-wi-stats-overview-stat-chart {
    height: 80px !important;
    margin-top: 1.25rem !important;
    opacity: 0.8 !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
}

/* ===== HOVER ANIMATIONS FOR STATS ===== */
.fi-wi-stats-overview .fi-wi-stats-overview-stat:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--vitalis-shadow-lg) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat:hover .fi-wi-stats-overview-stat-value {
    transform: scale(1.05) !important;
    transition: transform 0.2s ease !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .fi-wi-stats-overview {
        gap: 1rem !important;
    }
    
    .fi-wi-stats-overview .fi-wi-stats-overview-stat {
        padding: 1.25rem !important;
    }
    
    .fi-wi-stats-overview-stat-value {
        font-size: 2rem !important;
    }
}

@media (max-width: 640px) {
    .fi-wi-stats-overview-stat-value {
        font-size: 1.75rem !important;
    }
    
    .fi-wi-stats-overview .fi-wi-stats-overview-stat {
        padding: 1rem !important;
    }
}

/* ===== ADDITIONAL WIDGET STYLES ===== */

/* Table Widget Enhancements */
.fi-wi-table > .fi-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: var(--vitalis-shadow-md) !important;
}

.dark .fi-wi-table > .fi-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
    border-color: rgba(148, 163, 184, 0.1) !important;
}

/* Chart Widget Enhancements */
.fi-wi-chart > .fi-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-radius: 1rem !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: var(--vitalis-shadow-md) !important;
}

.dark .fi-wi-chart > .fi-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
    border-color: rgba(148, 163, 184, 0.1) !important;
}

/* ===== LOADING STATES ===== */
.fi-widget[data-loading] {
    opacity: 0.7 !important;
    pointer-events: none !important;
}

.fi-widget[data-loading]::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(2px) !important;
    z-index: 10 !important;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.fi-widget:focus-within {
    outline: 2px solid var(--vitalis-primary) !important;
    outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
    .fi-widget,
    .fi-wi-stats-overview .fi-wi-stats-overview-stat {
        transition: none !important;
    }
    
    .fi-widget:hover {
        transform: none !important;
    }
}

/* ===== CUSTOM ANIMATIONS ===== */
@keyframes vitalisSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat {
    animation: vitalisSlideUp 0.6s ease-out !important;
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(2) {
    animation-delay: 0.1s !important;
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(3) {
    animation-delay: 0.2s !important;
}

.fi-wi-stats-overview .fi-wi-stats-overview-stat:nth-child(4) {
    animation-delay: 0.3s !important;
}

/* ===== SUCCESS/DANGER COLOR VARIANTS ===== */
.fi-wi-stats-overview-stat[data-color="success"] .fi-wi-stats-overview-stat-value {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.fi-wi-stats-overview-stat[data-color="danger"] .fi-wi-stats-overview-stat-value {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.fi-wi-stats-overview-stat[data-color="warning"] .fi-wi-stats-overview-stat-value {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.fi-wi-stats-overview-stat[data-color="info"] .fi-wi-stats-overview-stat-value {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}