/* Additional Dashboard Styles */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Loading animation improvements */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Card hover effects */
.card-shadow {
    transition: all 0.3s ease;
}

.card-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.15);
}

/* Status indicator animations */
.status-green, .status-yellow, .status-red {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.status-green::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Progress bar improvements */
.progress-bar {
    background: linear-gradient(90deg, var(--success-color) 0%, #34D399 100%);
    transition: width 0.5s ease-in-out;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .modal > div {
        margin: 0.75rem;
        max-height: calc(100vh - 1.5rem);
        max-width: calc(100vw - 1.5rem);
    }
    
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Optimize touch targets */
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .card-shadow {
        margin-bottom: 0.75rem;
    }
    
    /* Improve text readability */
    h1, h2, h3 {
        line-height: 1.3;
    }
    
    /* Touch-friendly form elements */
    input, select, textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Stack stat cards more efficiently */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    /* Smaller text for very small screens */
    .text-sm.sm\\:text-lg {
        font-size: 0.875rem;
    }
}

/* Quick stats pulse animation for new data */
.stat-updated {
    animation: pulse-green 1s ease-in-out;
}

@keyframes pulse-green {
    0% { background-color: transparent; }
    50% { background-color: rgba(16, 185, 129, 0.1); }
    100% { background-color: transparent; }
}

/* Form validation styles */
.input-error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-success {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Custom scrollbar for modals */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .card-shadow:hover {
        transform: none; /* Disable hover effects on touch */
    }
    
    button:hover {
        background-color: initial; /* Use :active instead */
    }
    
    button:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* Landscape mode optimizations for phones */
@media (max-height: 500px) and (orientation: landscape) {
    .modal > div {
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
    }
    
    header {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS Safari viewport height */
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
    
    /* Fix for iOS Safari bottom safe area */
    .pb-4 {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Print styles for export functionality */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-friendly {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}