/* ===== MODERN DESIGN SYSTEM ===== */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

/* Modern Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-lg);
    border: none;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .title {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-item {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
    margin: 0 0.25rem;
}

.navbar-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transform: translateY(-1px);
}

.navbar-dropdown {
    background: white;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Migliora il comportamento dei dropdown */
.navbar-item.has-dropdown:hover .navbar-dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
}

.navbar-item.has-dropdown .navbar-dropdown {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.navbar-item.has-dropdown.is-active .navbar-dropdown {
    opacity: 1;
    visibility: visible;
}

.navbar-dropdown .navbar-item {
    color: var(--text-primary) !important;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
}

.navbar-dropdown .navbar-item:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--primary-color) !important;
}

/* Modern Buttons */
.button {
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    box-shadow: var(--shadow-sm);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.button.is-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.button.is-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.button.is-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #3182ce 100%);
    color: white;
}

.button.is-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #38a169 100%);
    color: white;
}

.button.is-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #dd6b20 100%);
    color: white;
}

.button.is-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #e53e3e 100%);
    color: white;
}

/* Modern Cards/Boxes */
.box {
    background: var(--bg-primary);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.box:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.box .title,
.box .subtitle {
    color: var(--text-primary);
}

/* Modern Tables */
.table {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.01);
}

.table tbody td {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    vertical-align: middle;
}

/* Modern Notifications */
.notification {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
}

.notification.is-success {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 161, 105, 0.1) 100%);
    border-left: 4px solid var(--success-color);
    color: #22543d;
}

.notification.is-danger {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.1) 0%, rgba(229, 62, 62, 0.1) 100%);
    border-left: 4px solid var(--danger-color);
    color: #742a2a;
}

.notification.is-warning {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.1) 0%, rgba(221, 107, 32, 0.1) 100%);
    border-left: 4px solid var(--warning-color);
    color: #7b341e;
}

.notification.is-info {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.1) 0%, rgba(49, 130, 206, 0.1) 100%);
    border-left: 4px solid var(--info-color);
    color: #2a4365;
}

/* Modern Tags */
.tag {
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    box-shadow: var(--shadow-sm);
}

/* Modern Footer */
.footer {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    color: white;
    padding: 3rem 1rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modern Form Elements */
.input, .textarea, .select select {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.input:focus, .textarea:focus, .select select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Modern Container */
.container {
    max-width: 1200px;
    padding: 0 1.5rem;
}

/* Modern Section */
.section {
    padding: 3rem 0;
}

/* Modern Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.hero .title {
    color: white;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* Modern Cards with Icons */
.card-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-md);
}

.card-icon.is-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.card-icon.is-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #38a169 100%);
    color: white;
}

.card-icon.is-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #3182ce 100%);
    color: white;
}

.card-icon.is-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #dd6b20 100%);
    color: white;
}

/* Modern Stats Cards */
.stats-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stats-label {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

/* Modern Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

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

/* Modern Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .stats-card {
        padding: 1.5rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    .navbar-menu {
        background: var(--bg-primary);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-lg);
        margin-top: 0.5rem;
    }
}

/* Unified Sidebar Responsive Behavior */
.sidebar {
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

/* Mobile/Tablet: sidebar nascosta di default, visibile quando .open */
@media (max-width: 1023.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
}

/* Desktop: sidebar sempre visibile */
@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }
}

/* Modern Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Modern Code Blocks */
code {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

/* Modern Breadcrumbs */
.breadcrumb {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Modern Progress Bars */
.progress {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    height: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress::-webkit-progress-bar {
    background: var(--bg-tertiary);
}

.progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--border-radius-sm);
}

/* Stili per la pagina di login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 2rem;
    background-color: white;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.login-container h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.field {
    margin-bottom: 1.5rem;
}

.notification {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* Stile del loader grafico */
#loader {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
}

.loader {
    border: 16px solid #f3f3f3; /* Light grey */
    border-top: 16px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

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

