/* Modern Dashboard Style - Futuristic Design */

/* Fix dropdown menu z-index issue */
.dropdown-menu {
    z-index: 999999 !important;
    position: absolute !important;
}

.dropdown.show .dropdown-menu,
.dropdown-menu.show {
    z-index: 999999 !important;
    display: block !important;
}

/* Fix per i titoli delle pagine - testo scuro su sfondo chiaro */
.modern-dashboard h1.h2 {
    color: #2c3e50 !important;
}

.modern-dashboard .border-bottom {
    border-color: rgba(52, 73, 94, 0.2) !important;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-bg: #0f0f23;
    --card-bg: rgba(255, 255, 255, 0.05);
    --neon-purple: #b74bf7;
    --neon-blue: #4cc9f0;
    --neon-pink: #f72585;
    --neon-green: #4eff00;
    --neon-orange: #ff9500;
}

.modern-dashboard {
    background: linear-gradient(135deg, #e8f4fd 0%, #e6f2ff 50%, #f0f8ff 100%);
    min-height: 100vh;
    position: relative;
    padding-top: 100px !important; /* Aumentato per dare più spazio tra navbar e contenuto */
    /* overflow-x: hidden; Rimosso per permettere ai dropdown di essere visibili */
}

.modern-dashboard::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Animated Background Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* AuraSync Constellation Container */
.constellation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

/* Constellation Particles with AuraSync Effect */
.constellation-particle {
    position: absolute;
    border-radius: 50%;
    animation: constellationFloat 25s infinite ease-in-out, auraSyncRGB 6s infinite;
    pointer-events: none;
}

/* Constellation Canvas for Lines */
.constellation-canvas,
#constellation-canvas {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* AuraSync RGB Animation for Particles */
@keyframes auraSyncRGB {
    0% {
        background: radial-gradient(circle, #ff0080 0%, transparent 70%);
        box-shadow: 0 0 20px #ff0080, 0 0 40px #ff008060, 0 0 60px #ff008040;
    }
    16.66% {
        background: radial-gradient(circle, #ff8000 0%, transparent 70%);
        box-shadow: 0 0 20px #ff8000, 0 0 40px #ff800060, 0 0 60px #ff800040;
    }
    33.33% {
        background: radial-gradient(circle, #ffff00 0%, transparent 70%);
        box-shadow: 0 0 20px #ffff00, 0 0 40px #ffff0060, 0 0 60px #ffff0040;
    }
    50% {
        background: radial-gradient(circle, #00ff00 0%, transparent 70%);
        box-shadow: 0 0 20px #00ff00, 0 0 40px #00ff0060, 0 0 60px #00ff0040;
    }
    66.66% {
        background: radial-gradient(circle, #00ffff 0%, transparent 70%);
        box-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff60, 0 0 60px #00ffff40;
    }
    83.33% {
        background: radial-gradient(circle, #0080ff 0%, transparent 70%);
        box-shadow: 0 0 20px #0080ff, 0 0 40px #0080ff60, 0 0 60px #0080ff40;
    }
    100% {
        background: radial-gradient(circle, #ff0080 0%, transparent 70%);
        box-shadow: 0 0 20px #ff0080, 0 0 40px #ff008060, 0 0 60px #ff008040;
    }
}

/* Constellation Float Animation */
@keyframes constellationFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(-30px, -10px) scale(1.05);
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #3b82f6;
    border-radius: 50%;
    animation: float 20s infinite linear, auraSync 8s infinite;
    opacity: 0.6;
    box-shadow: 0 0 10px currentColor;
}

/* AuraSync Color Animation */
@keyframes auraSync {
    0% {
        background: #ff0080;
        box-shadow: 0 0 15px #ff0080, 0 0 30px #ff008050;
    }
    14% {
        background: #ff8000;
        box-shadow: 0 0 15px #ff8000, 0 0 30px #ff800050;
    }
    28% {
        background: #ffff00;
        box-shadow: 0 0 15px #ffff00, 0 0 30px #ffff0050;
    }
    42% {
        background: #00ff00;
        box-shadow: 0 0 15px #00ff00, 0 0 30px #00ff0050;
    }
    57% {
        background: #00ffff;
        box-shadow: 0 0 15px #00ffff, 0 0 30px #00ffff50;
    }
    71% {
        background: #0080ff;
        box-shadow: 0 0 15px #0080ff, 0 0 30px #0080ff50;
    }
    85% {
        background: #8000ff;
        box-shadow: 0 0 15px #8000ff, 0 0 30px #8000ff50;
    }
    100% {
        background: #ff0080;
        box-shadow: 0 0 15px #ff0080, 0 0 30px #ff008050;
    }
}

@keyframes float {
    from {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    to {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Glass Morphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.15),
        inset 0 0 20px rgba(59, 130, 246, 0.03);
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.5s;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 40px 0 rgba(31, 38, 135, 0.5),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
}

.glass-card:hover::before {
    animation: shimmer 0.5s ease;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Neon Stats Cards */
.stat-card-modern {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    border: 2px solid rgba(59, 130, 246, 0.15);
    background-clip: padding-box;
    position: relative;
    padding: 30px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(45deg, var(--neon-purple), var(--neon-blue), var(--neon-pink));
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotate-border 10s linear infinite;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    /* Rimosso il gradiente che rendeva il testo trasparente */
    color: #ffffff !important;
}

.stat-label {
    color: #ffffff !important;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
}

.stat-change {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 15px;
    font-weight: 600;
    color: #ffffff !important;
}

.stat-change.positive {
    background: rgba(78, 255, 0, 0.2);
    color: var(--neon-green);
    box-shadow: 0 0 20px rgba(78, 255, 0, 0.3);
}

.stat-change.negative {
    background: rgba(247, 37, 133, 0.2);
    color: var(--neon-pink);
    box-shadow: 0 0 20px rgba(247, 37, 133, 0.3);
}

/* Modern Charts Container */
.chart-container-modern {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
    position: relative;
    height: 400px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
}

.chart-options {
    display: flex;
    gap: 10px;
}

.chart-option-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #2563eb;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.chart-option-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
}

.chart-option-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: 0 0 20px rgba(183, 75, 247, 0.4);
}

/* User Profile in Sidebar - Reduced size */
.sidebar-user-profile {
    padding: 20px 0;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    margin-top: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.user-avatar-large {
    width: 90px;
    height: 90px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-weight: 900;
    font-size: 1.8rem;
    margin: 0 auto 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid #fed800;
    overflow: visible;
    position: relative;
}

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

.sidebar-user-profile .user-info {
    text-align: center;
    width: 100%;
    padding: 0 15px;
}

.sidebar-user-profile .user-name {
    color: #000000;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.sidebar-user-profile .user-role {
    color: rgba(0, 0, 0, 0.9);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.sidebar-user-profile .user-role i {
    font-weight: 700 !important;
}

.sidebar-user-profile .user-school {
    color: rgba(0, 0, 0, 0.8);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 3px;
}

.sidebar-user-profile .user-school i {
    font-weight: 700 !important;
}

/* Quick Action Buttons in Sidebar */
.sidebar-quick-actions {
    padding: 20px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    width: 100%;
}

.sidebar-action-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    padding: 12px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    flex: 1;
    max-width: 100px;
}

.sidebar-action-btn i,
.sidebar-action-btn span {
    color: #ffffff !important;
}

.sidebar-action-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: #ffffff;
    background: #000000;
}

.sidebar-action-btn i {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.sidebar-action-btn.profile {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
}

.sidebar-action-btn.profile:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.sidebar-action-btn.settings {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    border-color: #f97316;
}

.sidebar-action-btn.settings:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 4px 15px rgba(251, 146, 60, 0.3);
}

.sidebar-action-btn.logout {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
}

.sidebar-action-btn.logout:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.sidebar-header {
    position: relative;
    padding-bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-close-sidebar {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-close-sidebar:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Circular Progress */
.circular-progress {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 10;
}

.progress-circle {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    animation: progress 2s ease-out forwards;
}

@keyframes progress {
    to {
        stroke-dashoffset: var(--progress);
    }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-value {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.progress-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Activity Feed */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.activity-feed::-webkit-scrollbar {
    width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.activity-feed::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    border-radius: 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
    cursor: pointer;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.activity-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

.activity-icon.success {
    background: linear-gradient(135deg, #4eff00, #00ff88);
    box-shadow: 0 0 20px rgba(78, 255, 0, 0.4);
}

.activity-icon.warning {
    background: linear-gradient(135deg, #ff9500, #ffb700);
    box-shadow: 0 0 20px rgba(255, 149, 0, 0.4);
}

.activity-icon.info {
    background: linear-gradient(135deg, #4cc9f0, #00b4d8);
    box-shadow: 0 0 20px rgba(76, 201, 240, 0.4);
}

.activity-content {
    flex: 1;
}

.activity-title {
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
}

.activity-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-btn {
    background: linear-gradient(135deg, rgba(183, 75, 247, 0.2) 0%, rgba(76, 201, 240, 0.2) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    text-decoration: none;
}

.action-btn:hover {
    background: linear-gradient(135deg, rgba(183, 75, 247, 0.3) 0%, rgba(76, 201, 240, 0.3) 100%);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(183, 75, 247, 0.3);
    border-color: var(--neon-purple);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.action-label {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Calendar Widget */
.calendar-widget {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-day:hover {
    background: rgba(183, 75, 247, 0.3);
    color: white;
    transform: scale(1.1);
}

.calendar-day.today {
    background: var(--primary-gradient);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(183, 75, 247, 0.5);
}

.calendar-day.event {
    position: relative;
}

.calendar-day.event::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: var(--neon-pink);
    border-radius: 50%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stat-number {
        font-size: 2rem;
    }
    
    .glass-card {
        padding: 15px;
    }
    
    .chart-container-modern {
        height: 300px;
    }
    
    .circular-progress {
        width: 150px;
        height: 150px;
    }
    
    .progress-value {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Glow Effects */
.glow-purple {
    box-shadow: 0 0 30px var(--neon-purple);
}

.glow-blue {
    box-shadow: 0 0 30px var(--neon-blue);
}

.glow-pink {
    box-shadow: 0 0 30px var(--neon-pink);
}

/* Top Navigation Modern */
.top-nav-modern {
    background: rgba(15, 15, 35, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    display: flex;
    align-items: center;
    z-index: 1040;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* Effetto scroll per navbar */
.top-nav-modern.scrolled {
    background: rgba(15, 15, 35, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.top-nav-modern h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Search bar removed - no longer needed */

.user-menu-modern {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Fix navbar positioning */
.top-nav-modern .position-absolute {
    z-index: 10;
}

.notification-btn {
    position: relative;
    background: #fed800;
    border: none;
    width: 40px;  /* Ridotto per allineamento migliore */
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.notification-btn i {
    color: #000000 !important;
}

.notification-btn:hover {
    background: #fed800;
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(254, 216, 0, 0.4);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--neon-pink);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(183, 75, 247, 0.5);
}

/* Modern Sidebar */
.modern-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #fed800;
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
    color: #000000 !important;
}

/* Force all sidebar text and icons to be black */
.modern-sidebar * {
    color: #000000 !important;
}

.modern-sidebar .dropdown-item {
    color: #000000 !important;
    background: transparent;
}

.modern-sidebar .dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.modern-sidebar .dropdown-item.active {
    background: rgba(0, 0, 0, 0.1) !important;
}

.modern-sidebar.active {
    left: 0 !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
}

/* Floating Hamburger Button */
.floating-hamburger {
    position: fixed;
    top: 45px;  /* Centro della navbar (90px / 2) */
    transform: translateY(-50%);  /* Centra verticalmente il pulsante */
    left: 20px;
    width: 45px;  /* Ridotto per allinearsi meglio con gli altri elementi */
    height: 45px;
    background: #fed800;
    border: none;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1052; /* Sopra l'overlay della sidebar (1049) */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(254, 216, 0, 0.4);
}

.floating-hamburger.sidebar-open {
    left: 310px;
    transform: translateY(-50%);  /* Mantiene il centro verticale */
    background: #fed800;
    box-shadow: 0 4px 20px rgba(254, 216, 0, 0.4);
}

.floating-hamburger:hover {
    transform: translateY(-50%) scale(1.05);  /* Mantiene il centro e scala */
    box-shadow: 0 6px 30px rgba(254, 216, 0, 0.6);
}

.floating-hamburger:active {
    transform: translateY(-50%) scale(0.95);  /* Mantiene il centro */
}

/* Hamburger Icon Animation */
.hamburger-icon {
    width: 24px;
    height: 20px;
    position: relative;
    transition: transform 0.3s;
}

.hamburger-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: #000000;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: all 0.25s ease;
}

.hamburger-icon span:nth-child(1) {
    top: 0px;
}

.hamburger-icon span:nth-child(2) {
    top: 8px;
}

.hamburger-icon span:nth-child(3) {
    top: 16px;
}

/* Keep hamburger icon unchanged when sidebar is open */
.floating-hamburger.sidebar-open .hamburger-icon span:nth-child(1) {
    top: 0px;
    transform: rotate(0deg);
}

.floating-hamburger.sidebar-open .hamburger-icon span:nth-child(2) {
    opacity: 1;
    left: 0;
}

.floating-hamburger.sidebar-open .hamburger-icon span:nth-child(3) {
    top: 16px;
    transform: rotate(0deg);
}

/* Pulse animation for attention */
@keyframes hamburger-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(183, 75, 247, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(183, 75, 247, 0.8), 0 0 0 10px rgba(183, 75, 247, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(183, 75, 247, 0.4);
    }
}

.floating-hamburger.pulse {
    animation: hamburger-pulse 2s infinite;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
}

/* Regola già inclusa sopra nel blocco precedente */

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close-sidebar {
    display: none !important;
}

.sidebar-content {
    padding: 20px 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    margin-bottom: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #000000;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: #000000;
    transition: width 0.3s ease;
}

.sidebar-link:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.05);
    padding-left: 35px;
}

.sidebar-link:hover::before {
    width: 4px;
}

.sidebar-link.active {
    color: #000000;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-link.active::before {
    width: 4px;
    background: #000000;
}

.sidebar-link i {
    width: 25px;
    margin-right: 15px;
    font-size: 1.1rem;
}

.sidebar-link span {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Hamburger button animation */
#sidebarToggle {
    margin-right: 10px;
}

#sidebarToggle:hover {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(183, 75, 247, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(183, 75, 247, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(183, 75, 247, 0);
    }
}

/* Scrollbar for sidebar */
.modern-sidebar::-webkit-scrollbar {
    width: 6px;
}

.modern-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.modern-sidebar::-webkit-scrollbar-thumb {
    background: #000000;
    border-radius: 3px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .modern-sidebar {
        width: 250px;
        left: -250px;
    }
}