/* Custom CSS per l'applicazione */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset base e font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Utilities */
.transition-all {
    transition: all 0.3s ease;
}

.cursor-pointer {
    cursor: pointer;
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 100%;
}

/* Flag Switch Styles */
.flag-switch {
    background-color: #4B5563;
    transition: background-color 0.2s ease;
}

.flag-switch.active {
    background-color: #3B82F6;
}

.flag-dot {
    transition: transform 0.2s ease;
}

.flag-switch.active + .flag-dot,
.flag-switch.active .flag-dot {
    transform: translateX(24px);
}

/* Range Slider Styles */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    outline: none;
}

.range-slider::-webkit-slider-track {
    background: rgba(59, 130, 246, 0.2);
    height: 8px;
    border-radius: 4px;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #3B82F6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    background: #2563EB;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

.range-slider::-moz-range-track {
    background: rgba(59, 130, 246, 0.2);
    height: 8px;
    border-radius: 4px;
    border: none;
}

.range-slider::-moz-range-thumb {
    background: #3B82F6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.range-slider::-moz-range-thumb:hover {
    background: #2563EB;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

/* Dual Range Slider Styles */
.dual-range-container {
    height: 20px;
}

.dual-range-slider {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    outline: none;
    pointer-events: none;
}

.dual-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #3B82F6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
    pointer-events: all;
    position: relative;
}

.dual-range-slider::-webkit-slider-thumb:hover {
    background: #2563EB;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

.dual-range-slider::-moz-range-thumb {
    background: #3B82F6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
    pointer-events: all;
}

.dual-range-slider::-moz-range-thumb:hover {
    background: #2563EB;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.6);
}

.dual-range-track {
    top: 9px;
    background: rgba(59, 130, 246, 0.2);
}

.dual-range-highlight {
    top: 9px;
    background: #3B82F6;
    transition: all 0.1s ease;
}

/* Ensure proper layering */
.dual-range-min {
    z-index: 10;
}

.dual-range-max {
    z-index: 20;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Animation per i messaggi di stato */
.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading spinner personalizzato */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #ffffff;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover effects per i bottoni */
.btn-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Focus styles per accessibilità */
.focus-visible:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Mobile responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-full {
        width: 100% !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem !important;
    }
}

/* Modal and overlay z-index management */
.modal-overlay {
    z-index: 9999 !important;
}

.modal-content {
    z-index: 10000 !important;
}

.error-message {
    z-index: 10001 !important;
    position: relative !important;
}

.success-message {
    z-index: 10001 !important;
    position: relative !important;
}

/* Toast notifications */
.toast-notification {
    z-index: 10002 !important;
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: rgba(0, 0, 0, 0.9) !important;
    color: white !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    animation: slideInRight 0.3s ease-out !important;
}

.toast-error {
    background: rgba(239, 68, 68, 0.95) !important;
    border-left: 4px solid #dc2626 !important;
}

.toast-success {
    background: rgba(34, 197, 94, 0.95) !important;
    border-left: 4px solid #16a34a !important;
}

.toast-warning {
    background: rgba(251, 146, 60, 0.95) !important;
    border-left: 4px solid #ea580c !important;
}

/* Dropdown z-index fixes */
.dropdown-menu {
    z-index: 9998 !important;
}

/* Ensure modals appear above everything */
.fixed.inset-0 {
    z-index: 9999 !important;
}

.fixed.inset-0 + div {
    z-index: 10000 !important;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .glass, .glass-dark {
        background: white !important;
        backdrop-filter: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}