/* CSS GLOBALE - Header e Navigazione per tutte le pagine */

:root {
  --primary-color: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #7dd3fc;
  --secondary-color: #06b6d4;
  --accent-color: #38bdf8;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --background: #f0f9ff;
  --surface: #ffffff;
  --surface-dark: #e0f2fe;
  --surface-light: #f8fafc;
  --text-primary: #0c4a6e;
  --text-secondary: #0369a1;
  --text-muted: #64748b;
  --border: #bae6fd;
  --border-light: #e0f2fe;
  --shadow: 0 1px 3px 0 rgba(14, 165, 233, 0.1), 0 1px 2px 0 rgba(14, 165, 233, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(14, 165, 233, 0.15), 0 4px 6px -2px rgba(14, 165, 233, 0.1);
  --gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #38bdf8 100%);
  --gradient-light: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  padding-bottom: 120px; /* Spazio per navigazione flottante */
}

/* HEADER UNIFICATO per tutte le pagine */
header {
  background: var(--gradient);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo h1 {
  color: white;
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px; /* Spazio tra logo e testo */
  margin: 0; /* Rimuovi margin di default */
}
.app-logo {
  width: 45px;  /* ← RIDOTTO da 100px */
  height: 45px; /* ← RIDOTTO da 100px */
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px; /* Angoli arrotondati */
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-links li a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 12px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links li a:hover,
.nav-links li a.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: blur(10px);
  transform: translateY(-1px);
}

/* NAVIGAZIONE FLOTTANTE UNIFICATA */
.floating-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(240, 249, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-items {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-item {
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  text-decoration: none;
  color: var(--text-secondary);
}

.nav-item.active,
.nav-item:hover {
  background: var(--gradient);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* FLOATING ADD BUTTON UNIFICATO */
.floating-add {
  position: fixed;
  bottom: 120px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  z-index: 999;
  border: none;
  text-decoration: none;
}

.floating-add:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* CONTAINER UNIFICATO */
.container,
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 120px;
}

/* FOOTER UNIFICATO */
footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  margin-top: 50px;
  margin-bottom: 100px;
}

/* RESPONSIVE DESIGN UNIFICATO */
@media (max-width: 768px) {
  nav {
    padding: 0 16px;
    height: 60px;
  }
  
  .logo h1 {
    font-size: 1.5rem;
    gap: 10px;
  }
  
  .app-logo {
    width: 36px;
    height: 36px;
  }
  
  .nav-links {
    gap: 4px;
  }
  
  .nav-links li a {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  
  .container,
  .main-content {
    padding: 20px 16px 120px;
  }
  
  /* Navigazione flottante mobile */
  .floating-nav {
    left: 16px;
    right: 16px;
    transform: none;
  }
  
  .nav-items {
    justify-content: space-around;
    width: 100%;
  }
  
  .floating-add {
    bottom: 110px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .logo h1 {
    font-size: 1.3rem;
    gap: 8px;
  }
  
  .app-logo {
    width: 32px;
    height: 32px;
  }
  
  .nav-links li a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* EFFETTI SCROLL HEADER */
.header-scrolled {
  transform: translateY(-100%);
}

/* ANIMAZIONI GLOBALI */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* BOTTONI GLOBALI */
.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-dark);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-warning {
  background: var(--warning-color);
  color: white;
}

.btn-warning:hover {
  background: #e8960f;
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #0d9f71;
}

.btn-danger,
.delete-btn {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover,
.delete-btn:hover {
  background: #dc2626;
}

/* MESSAGGI TOAST GLOBALI */
.toast-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

.toast-success {
  background: var(--success-color);
  color: white;
}

.toast-error {
  background: var(--danger-color);
  color: white;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  opacity: 0.8;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* LOADING STATES GLOBALI */
.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.loading-placeholder::before {
  content: '🔄';
  margin-right: 10px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
/* Chat Badge - Contatore chat non lette */
.chat-badge {
    position: absolute;
    top: -2px;
    right: -8px;
    background: #16a34a;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid white;
    z-index: 10;
}

/* Nascondi badge quando 0 */
.chat-badge.hidden {
    display: none;
}

/* Container per posizionamento relativo */
.nav-links li {
    position: relative;
}
