/* Trustie 2.0 - Bootstrap Custom Overrides */

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

/* Root Variables - Minimal Custom Properties */
:root {
  --primary-color: #0d6efd;
  --sidebar-width: 280px;
  --transition-speed: 0.3s;
}

/* Global Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Sidebar Navigation - Desktop */
@media (min-width: 992px) {
  .sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    background-color: #fff;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
  }

  .sidebar-header {
    padding: 1.5rem;
  }

  .sidebar-title {
    margin: 0;
    font-size: 1.25rem;
  }

  .sidebar-body {
    padding: 1rem 0;
  }

  .sidebar-nav .nav-link {
    padding: 0.75rem 1.5rem;
    color: #495057;
    border-left: 3px solid transparent;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    display: block;
  }

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

  .sidebar-nav .nav-link.active {
    background-color: #e7f1ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
  }

  .main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
  }

  /* Nascondi il pulsante menu su desktop */
  button[data-bs-toggle="offcanvas"] {
    display: none !important;
  }

  #closeSidebar {
    display: none;
  }
}

/* Mobile Sidebar */
@media (max-width: 991px) {
  .sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #fff;
    border-right: 1px solid #dee2e6;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform var(--transition-speed) ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }

  .sidebar-nav.show {
    transform: translateX(0);
  }

  .sidebar-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar-title {
    margin: 0;
    font-size: 1.25rem;
  }

  .sidebar-body {
    padding: 1rem 0;
  }

  .sidebar-nav .nav-link {
    padding: 0.75rem 1rem;
    color: #495057;
    border-left: 3px solid transparent;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
    display: block;
  }

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

  .sidebar-nav .nav-link.active {
    background-color: #e7f1ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
  }

  .main-content {
    padding: 5rem 1rem 1rem;
  }

  /* Backdrop per mobile */
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}

/* Content Sections */
.content-section {
  display: none;
  animation: fadeIn var(--transition-speed) ease-in;
}

.content-section.active {
  display: block;
}

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

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
}

/* Card Enhancements */
.card {
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* Stat Cards */
.stat-card h3 {
  margin-bottom: 0.5rem;
}

.stat-card p {
  margin-bottom: 0;
}

/* Progress Bars Enhancement */
.progress {
  border-radius: 0.5rem;
}

.progress-bar {
  transition: width 1s ease-in-out;
}

/* Badge Customization */
.badge {
  font-weight: 600;
  padding: 0.35em 0.65em;
}

/* List Group Items */
.list-group-item {
  border-left: none;
  border-right: none;
}

.list-group-item:first-child {
  border-top: none;
}

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

/* Alert Customization */
.alert {
  border-radius: 0.5rem;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Print Styles */
@media print {
  .sidebar-nav,
  button[data-bs-toggle="offcanvas"] {
    display: none !important;
  }

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

  .content-section {
    display: block !important;
    page-break-after: always;
  }

  .card {
    page-break-inside: avoid;
  }
}

/* Utility Classes */
.z-3 {
  z-index: 1030;
}

/* Focus States for Accessibility */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading Animation (for future enhancements) */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}
