/* =========================================
   🎨 COLORFUL MODERN THEME (no purple)
   Compatibile con Bootstrap 5.3+
   Adattivo a tema Light / Dark / Auto
========================================= */

/* ===== BASE THEME COLORS ===== */
:root {
  --bs-primary: #0d6efd;      /* Blu brillante */
  --bs-secondary: #6c757d;    /* Grigio neutro */
  --bs-success: #198754;      /* Verde */
  --bs-info: #20c997;         /* Verde acqua */
  --bs-warning: #ffc107;      /* Giallo caldo */
  --bs-danger: #dc3545;       /* Rosso */
  --bs-light: #f8f9fa;
  --bs-dark: #212529;
  --bs-body-color: #212529;
  --bs-body-bg: #fff;
  --bs-border-color: #dee2e6;
}
/* ===== TABELLE CON THEAD PERSONALI ===== */
    /* Light mode */
    .table-header {
      background-color: #f8f9fa; /* chiaro */
      color: #212529;
    }

    /* Dark mode */
    body.dark-mode .table-header {
      background-color: #2b2b2b; /* scuro */
      color: #f1f1f1;
    }
/* ===== DARK MODE OVERRIDE ===== */
html[data-bs-theme="dark"] {
  --bs-body-bg: #121212;
  --bs-body-color: #e6e6e6;
  --bs-border-color: #2c2c2c;
  --bs-primary: #2f7dff;     /* Blu più chiaro per contrasto */
  --bs-secondary: #868e96;
  --bs-success: #27a36a;
  --bs-info: #27d1a0;
  --bs-warning: #ffca2c;
  --bs-danger: #f05b67;
  --bs-light: #1e1e1e;
  --bs-dark: #e6e6e6;
}

/* ===== GLOBAL STYLING ===== */
body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: var(--bs-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--bs-info);
}

/* ===== BUTTONS ===== */
.btn {
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover {
  color: #fff !important;
}

/* ===== NAVBAR ===== */
.navbar {
  background-color: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  transition: background-color 0.3s;
}

.navbar .nav-link {
  color: var(--bs-body-color);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--bs-primary);
}

/* ===== SIDEBAR ===== */
.sidebar {
  background-color: var(--bs-light);
  transition: background-color 0.3s;
  min-width:220px !important;
      width: 220px;
      
      
      padding: 1rem;
      height: calc(100vh - 60px - 50px);
      position: sticky;
      top: 60px;
      overflow-y: auto;
      
}

html[data-bs-theme="dark"] .sidebar {
  background-color: #1a1a1a;
}

.sidebar .nav-link {
  color: var(--bs-body-color);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s, color 0.2s;
}

.sidebar .nav-link:hover {
  background-color: var(--bs-primary);
  color: #fff;
}

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

/* ===== FOOTER ===== */
footer.footer {
  font-size: 0.9rem;
  background-color: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  transition: background-color 0.3s, color 0.3s;
}

footer.footer .social-icons a {
  color: inherit;
  transition: color 0.2s ease-in-out;
}

footer.footer .social-icons a:hover {
  color: var(--bs-primary);
}


/* Username accanto all'avatar */
.navbar-username {
  color: var(--bs-body-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

[data-bs-theme="light"] .navbar-username:hover {
  color: #0d6efd; /* blu primario soft in modalità chiara */
}

[data-bs-theme="dark"] .navbar-username {
  color: #e0e0e0; /* grigio chiaro per dark mode */
}

[data-bs-theme="dark"] .navbar-username:hover {
  color: #f8f9fa; /* ancora più chiaro su hover */
}
#themeToggle {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  color: var(--bs-body-color);
  transition: color 0.3s ease;
}

#themeToggle:hover {
  color: var(--bs-primary);
}

/* === FULLCALENDAR - Tema Dinamico === */
.fc {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-radius: 0.5rem;
  transition: background-color 0.3s, color 0.3s;
}

/* Griglia e bordi coerenti col tema */
.fc-theme-standard .fc-scrollgrid,
.fc-theme-standard td,
.fc-theme-standard th {
  border-color: var(--bs-border-color) !important;
}

/* Intestazioni giorni */
.fc-col-header-cell {
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  font-weight: 600;
}

/* Giorni non del mese corrente (grigio tenue) */
.fc-daygrid-day.fc-day-other {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}

/* Hover sul giorno */
.fc-daygrid-day:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.05);
  cursor: pointer;
}

/* Evento */
.fc-event {
  background-color: var(--bs-primary);
  border: none;
  color: #fff;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  transition: transform 0.1s ease-in-out;
}

.fc-event:hover {
  transform: scale(1.03);
}

/* Titolo dell’evento */
.fc-event-title {
  white-space: normal;
}

/* Oggi (giorno corrente) */
.fc-day-today {
  background-color: rgba(var(--bs-warning-rgb), 0.15) !important;
  border: 1px solid var(--bs-warning) !important;
}

/* Bottoni toolbar */
.fc-toolbar-title {
  color: var(--bs-body-color);
}

.fc .fc-button {
  background-color: var(--bs-primary);
  border: none;
  color: #fff;
}

.fc .fc-button:hover {
  background-color: var(--bs-primary-dark, #0a58ca);
}

.fc .fc-button-active {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

/*****************************/
body {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    header {
      height: 60px;
      background-color: #0d6efd;
      color: white;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 1rem;
    }

    .content {
      flex: 1;
      display: flex;
      flex-wrap: nowrap;
      overflow: hidden;
    }

    .sidebarMenu {
      width: 220px;
      background-color: #f8f9fa;
      border-right: 1px solid #dee2e6;
      padding: 1rem;
      height: calc(100vh - 60px - 50px);
      position: sticky;
      top: 60px;
      overflow-y: auto;
      transition: transform 0.3s ease;
    }

    main {
      flex: 1;
      padding: 1.5rem;
      overflow-y: auto;
    }

    footer {
      height: 50px;
      background-color: #212529;
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    /* Sidebar nascosta su mobile */
    @media (max-width: 991.98px) {
      .sidebarMenu {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        transform: translateX(-100%);
        z-index: 1040;
      }
      .sidebarMenu.show {
        transform: translateX(0);
      }
      .content {
        flex-direction: column;
      }
      main {
        padding-top: 2rem;
      }
    }

    .overlay {
      position: fixed;
      inset: 0;
      background-color: rgba(0, 0, 0, 0.4);
      display: none;
      z-index: 1040;
    }
    .overlay.show {
      display: block;
    }