/* Global Styles */
:root {
    --primary-color: #F5844C;
    --secondary-color: #E67039;
    --success-color: #51cf66;
    --danger-color: #ff6b6b;
    --warning-color: #ffd43b;
    --info-color: #4dabf7;
    --purple-color: #7b1fa2;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-width: 250px;
    --header-height: 60px;
}

/* Utility classes */
.text-purple {
    color: var(--purple-color) !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* Header Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    height: var(--header-height);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    z-index: 1030;
    padding: 0 1rem;
}

.navbar-brand {
    font-size: 1.25rem;
    color: white !important;
    font-weight: 600;
}

.navbar-brand img {
    height: 35px;
    margin-right: 8px;
}

/* Area Buttons nel menu centrale */
.area-btn {
    position: relative;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
}

.area-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white !important;
}

.area-btn.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.area-btn.active:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* User Dropdown */
#userDropdown {
    cursor: pointer;
    color: white !important;
}

.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    color: white !important;
    text-decoration: none;
}

.user-dropdown .dropdown-toggle::after {
    margin-left: 0.5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-weight: 600;
    color: white;
}

#userDropdown .d-none.d-md-inline {
    max-width: 200px;
    text-align: left;
    line-height: 1.3;
}

#userName {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#schoolName {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-header {
    padding: 0.75rem 1rem;
    max-width: 280px;
}

.dropdown-header .flex-grow-1 {
    min-width: 0;
}

#userDropdownName {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#schoolDropdownName {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Notifiche Icon in Navbar */
.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar .nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.navbar .nav-link i {
    color: white;
}

/* Notifiche Dropdown */
.notifications-dropdown {
    min-width: 350px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

/* Main Container */
.main-container {
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar .nav-link {
    color: #6c757d;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    background-color: rgba(245, 132, 76, 0.1);
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 0.5rem;
}

/* Main Content */
.main-content {
    padding-top: 2rem;
    padding-bottom: 2rem;
    overflow-y: auto;
    height: 100%;
}

/* Dashboard Cards */
.dashboard-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.dashboard-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem;
    font-weight: 600;
}

.dashboard-card .card-body {
    padding: 1.25rem;
}

/* Stats Card */
.stat-card {
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-card.success {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #ffd43b 0%, #fab005 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, #4dabf7 0%, #228be6 100%);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* List Items */
.list-item {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    cursor: pointer;
}

.list-item:hover {
    background-color: #f8f9fa;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    color: #6c757d;
    font-size: 0.875rem;
}

.list-item-meta {
    color: #adb5bd;
    font-size: 0.75rem;
}

/* Badge Custom */
.badge-custom {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 6px;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #E67039;
    border-color: #E67039;
    transform: translateY(-2px);
}

/* Scrollbar Personalizzata */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .area-btn span {
        display: none;
    }
}

/* Navbar collapse - menu verticale sotto lg (condiviso tutte le pagine) */
@media (max-width: 991.98px) {
    #navbarMainMenu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #F19569;
        border-bottom: 1px solid #e9856a;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    #navbarMainMenu .navbar-nav {
        padding: 0.5rem 0;
    }

    #navbarMainMenu .nav-link {
        padding: 0.5rem 1rem;
        color: #fff !important;
    }

    #navbarMainMenu .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    #navbarMainMenu .nav-link.active {
        font-weight: 600;
        background-color: rgba(255, 255, 255, 0.25);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h4 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}
