/* ========================================
   FLAGGY - PALETTE COLORI UFFICIALE
   Sistema a doppio tema (chiaro/scuro)
   ======================================== */

:root {
  /* === TEMA CHIARO (DEFAULT) === */
  --bg: #f8f5f2;              /* Beige chiaro - sfondo principale */
  --surface: #ffffff;         /* Bianco - card/navbar/pannelli */
  --surface2: #ffffff;        /* Bianco - superfici secondarie */
  --border: #e0dcd7;          /* Beige scuro - bordi e divisori */

  /* === TESTI === */
  --text: #000000;            /* Nero - testo principale */
  --text-secondary: #4a4a4a;  /* Grigio scuro - testo secondario */
  --text-muted: #7A7C86;      /* Grigio medio - testo disabilitato */
  --muted: #7A7C86;           /* Alias per compatibilità */

  /* ===================================================
     COLORI STRUTTURALI FLAGGY
     =================================================== */
  
  /* ROSA - Azione primaria, Evidenziazione, Interattività */
  --primary: #ff467f;
  --primary-hover: #ff6a9a;
  --primary-dim: rgba(255, 70, 127, 0.15);
  
  /* VERDE - Successo, Conferma, Positività */
  --success: #00c88d;
  --success-hover: #00e0a0;
  --success-dim: rgba(0, 200, 141, 0.15);
  
  /* Manteniamo alcuni colori legacy per compatibilità */
  --azure: #38BDF8;
  --azure-hover: #0EA5E9;
  --azure-dim: rgba(56, 189, 248, 0.15);
  
  --magenta: #C026D3;
  --magenta-hover: #A21CAF;
  --magenta-dim: rgba(192, 38, 211, 0.15);
  
  --orange: #E67E22;
  --orange-hover: #F39C12;
  --orange-dim: rgba(230, 126, 34, 0.15);

  /* ===================================================
     COLORI MACROAREE PROFILO
     =================================================== */
  
  /* Aspetto Fisico - Azzurro */
  --macro1-light: #b8e7ff;
  --macro1-medium: #70d6ff;
  --macro1-dark: #3db5e6;
  --macro1-darker: #2891bf;
  
  /* Carattere e Personalità - Arancio */
  --macro2-light: #ffbe70;
  --macro2-medium: #ff9f1c;
  --macro2-dark: #e68a10;
  --macro2-darker: #bf720d;
  
  /* Condotta - Viola/Lilla */
  --macro3-light: #e5b8f5;
  --macro3-medium: #cb6ce6;
  --macro3-dark: #b44dd1;
  --macro3-darker: #9640ad;

  /* ===================================================
     MAPPING FUNZIONALE
     =================================================== */
  
  /* Link e navigazione → ROSA */
  --link: var(--primary);
  --link-hover: var(--primary-hover);
  
  /* CTA e azioni primarie → ROSA */
  --accent1: var(--primary);
  --accent2: var(--primary-hover);
  
  /* Successo e conferme → VERDE */
  --accent3: var(--success);
  --accent4: var(--success-hover);

  /* === COLORI EMOZIONALI DI SUPPORTO === */
  --passion: #8B1E3F;         /* Bordeaux profondo - passione/compatibilità alta */
  --neutral: #2F3E5C;         /* Blu profondo - stato neutro */
  --inactive: #3A3F4B;        /* Grigio-blu - stato basso/inattivo */

  /* === STATI FUNZIONALI === */
  --success-state: var(--success);
  --warn: var(--orange);
  --danger: var(--passion);
  --info: var(--azure);

  /* === SCORE INDICATORS === */
  --score-high: var(--passion);   /* Score alto - bordeaux passione */
  --score-medium: var(--magenta); /* Score medio - fucsia chimica */
  --score-low: var(--inactive);   /* Score basso - grigio-blu */

  /* === GRADIENTI === */
  --gradient-passion: linear-gradient(135deg, #8B1E3F 0%, #C026D3 100%);
  --gradient-balance: linear-gradient(135deg, #C026D3 0%, #38BDF8 100%);
  --gradient-energy: linear-gradient(135deg, #E67E22 0%, #F39C12 100%);
  --gradient-cool: linear-gradient(135deg, #38BDF8 0%, #2F3E5C 100%);
}

/* === TEMA SCURO === */
[data-theme="dark"] {
  --bg: #000000;              /* Nero puro - sfondo principale */
  --surface: #1d1f28;         /* Grigio scuro - card/navbar/pannelli */
  --surface2: #1d1f28;        /* Grigio scuro - superfici secondarie */
  --border: #2A2C36;          /* Grigio freddo - bordi e divisori */

  --text: #F2F2F2;            /* Bianco caldo - testo principale */
  --text-secondary: #B3B3B3;  /* Grigio chiaro - testo secondario */
}

/* Stili input per tema chiaro */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
input[type="number"]:disabled,
input[type="date"]:disabled,
textarea:disabled,
select:disabled {
  background: var(--surface2);
  color: var(--text-muted);
  opacity: 0.6;
}

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

/* ========================================
   SCROLLBAR PERSONALIZZATA
   ======================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bg);
  border-radius: 6px;
  border: 2px solid var(--bg);
}

/* Tema chiaro: scrollbar si scurisce all'hover */
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Tema scuro: scrollbar si schiarisce all'hover */
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg) var(--bg);
}

[data-theme="dark"] * {
  scrollbar-color: var(--bg) var(--bg);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  padding-top: 80px;
  overflow-x: hidden;
}

.sticky-save-button {
  position: sticky;
  top: 80px;
  z-index: 999;
  display: flex;
  justify-content: flex-end;
  padding: 1rem 0;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 85%, transparent 100%);
  padding-bottom: 2rem;
  margin-bottom: -1rem;
}

a {
  color: var(--accent1);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--accent3);
}

/* Navbar */
nav {
  background-color: var(--surface);
  border-bottom: 1px solid var(--surface2);
  padding: 1rem;
  margin-bottom: 2rem;
}

/* Flaggy Navbar - Nuova Navbar */
.flaggy-navbar {
  background-color: var(--surface);
  border-bottom: 1px solid rgba(255, 70, 127, 0.1);
  padding: 1rem 2rem;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.nav-left {
  display: flex;
  align-items: center;
}

.nav-logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  height: 40px;
}

.nav-logo {
  height: 96px;
  width: 96px;
  object-fit: contain;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.flaggy-navbar .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.flaggy-navbar .nav-links li {
  margin: 0;
}

.flaggy-navbar .nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  display: inline-block;
}

.flaggy-navbar .nav-links a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.flaggy-navbar .nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
  margin: 0;
  margin-left: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--text);
}

/* Hamburger Menu Button (nascosto su desktop) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.nav-hamburger span {
  width: 100%;
  height: 3px;
  background-color: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.theme-toggle:hover {
  background: var(--surface2);
  transform: rotate(15deg);
}

/* Old navbar for backward compatibility */
nav.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

nav .nav-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffffff;
}

nav .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

nav .nav-links a {
  color: var(--text);
  transition: color 0.2s;
}

nav .nav-links a:hover {
  color: var(--accent1);
  text-decoration: none;
}

/* Main content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  overflow-x: hidden;
}

/* Container stretto per dashboard */
.container-narrow {
  max-width: 80%;
  margin: 0 auto;
  padding: 0 1rem;
  overflow-x: hidden;
}

/* Header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.page-header p {
  color: var(--muted);
}

/* Cards */
.card {
  background-color: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-header {
  border-bottom: 1px solid var(--surface2);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.card-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.card-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

.card-body {
  margin-bottom: 0;
}

/* Buttons */
button, .btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

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

.btn-primary:hover {
  background-color: #6d28d9;
  text-decoration: none;
}

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

.btn-success:hover {
  background-color: #16a34a;
  text-decoration: none;
}

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

.btn-secondary:hover {
  background-color: var(--muted);
  border-color: var(--muted);
  text-decoration: none;
}

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

.btn-danger:hover {
  background-color: #dc2626;
  text-decoration: none;
}

.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  background-color: rgba(15, 23, 42, 0.8);
  border: 2px solid var(--accent1);
  border-radius: 0.375rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent1);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Form validation */
.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.alert {
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: #fecaca;
}

.alert-success {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid var(--accent2);
  color: #86efac;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-go {
  background-color: rgba(34, 197, 94, 0.2);
  color: var(--accent2);
  border: 1px solid var(--accent2);
}

.badge-maybe {
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--warn);
  border: 1px solid var(--warn);
}

.badge-no {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

table thead {
  background-color: var(--surface2);
  border-bottom: 2px solid var(--surface2);
}

table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--surface2);
}

table tbody tr {
  background-color: var(--surface);
  transition: background-color 0.2s;
}

table tbody tr:hover {
  background-color: var(--surface2);
}

/* Candidate card */
.candidate-card {
  background-color: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.candidate-card:hover {
  border-color: var(--accent1);
}

.candidate-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.candidate-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.candidate-card-score {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent1);
}

.candidate-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.candidate-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Settings Page Layout Grid - SOLO per pagina impostazioni */
#settings-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
  width: 100%;
  max-width: 2200px;
  margin: 0 auto;
}

/* Page header - spans all columns */
#settings-container > .page-header {
  grid-column: 1 / -1;
  order: 0;
}

/* Sticky save button - spans all columns */
#settings-container > .sticky-save-button {
  grid-column: 1 / -1;
  order: 1;
}

/* Macro Areas section - positioned second */
#settings-container > #macroAreasSection {
  grid-column: 1 / -1;
  order: 2;
}

/* Subcategories container - 3 columns, positioned in middle */
#settings-container > #subcategoriesContainer {
  order: 3;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  gap: 2rem;
}

/* Alpha section - positioned fourth */
#settings-container > #alphaSection {
  grid-column: 1 / -1;
  order: 4;
}

/* Red Flags - positioned last */
#settings-container > #redFlagsSection {
  grid-column: 1 / -1;
  order: 5;
}

/* Settings */
.settings-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: var(--surface2);
  border-radius: 0.5rem;
  position: relative;
}

.settings-section h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--accent1);
}

.weight-inputs {
  display: grid;
  gap: 1rem;
}

.weight-input-group {
  background-color: var(--surface);
  padding: 1rem;
  border-radius: 0.375rem;
  border-left: 3px solid var(--accent2);
}

.weight-input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Range input (slider) */
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: var(--surface);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  padding: 10px 0;
  margin: 0;
  vertical-align: middle;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent1);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
  border: 2px solid var(--accent3);
  margin-top: -8px;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--accent3);
  transform: scale(1.2);
  box-shadow: 0 0 0 5px rgba(124, 58, 237, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent1);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--accent3);
  transition: all 0.2s;
  margin-top: -8px;
}

/* Score inputs */
.score-input-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.score-input {
  background-color: var(--surface);
  padding: 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--surface2);
}

.score-input label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.score-input input[type="number"] {
  width: 100%;
  padding: 0.75rem;
  background-color: rgba(15, 23, 42, 0.8);
  border: 2px solid var(--accent3);
  border-radius: 0.375rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-box {
  background-color: var(--surface2);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--accent1);
}

.stat-box .stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-box .stat-value {
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--text);
}

/* Login/Register specific */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  max-width: 400px;
  width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.auth-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 1px;
}

.auth-header p {
  color: var(--muted);
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--muted);
}

/* Utility classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--primary); font-weight: bold; }
.text-success { color: var(--accent2); }

/* ========================================
   DASHBOARD - NEW CARD & RECAP SECTIONS
   ======================================== */

/* Dashboard Actions Section */
.dashboard-actions-section {
  margin-bottom: 3rem;
  padding: 2rem 0;
  max-width: 100%;
}

.actions-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 100%;
  margin: 0 auto;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.subsection-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
  margin-top: 1rem;
  letter-spacing: 0.5px;
}

.section-divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 3rem 0;
}

.favorites-container {
  margin-bottom: 2rem;
}

/* ===================================
   HOME PAGE STYLES
   =================================== */

/* Hero Section */
.home-hero {
  text-align: center;
  padding: 3rem 0 2rem 0;
  margin-bottom: 2rem;
}

.home-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

.home-title span {
  color: var(--primary);
}

.home-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Stats Section */
.stats-section {
  margin-bottom: 3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-card.stat-primary {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(255, 70, 127, 0.1) 100%);
}

.stat-card.stat-success {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(0, 200, 141, 0.1) 100%);
}

.stat-card.stat-info {
  border-color: #3db5e6;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(61, 181, 230, 0.1) 100%);
}

.stat-card.stat-warning {
  border-color: #e68a10;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(230, 138, 16, 0.1) 100%);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Navigation Section */
.navigation-section {
  margin-bottom: 3rem;
}

.navigation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.nav-card {
  position: relative;
  background: var(--surface);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  overflow: hidden;
}

.nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-card:hover::before {
  transform: scaleX(1);
}

.nav-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  border-color: var(--primary);
}

.nav-card-dashboard::before {
  background: #3db5e6;
}

.nav-card-dashboard:hover {
  border-color: #3db5e6;
}

.nav-card-profile::before {
  background: #b44dd1;
}

.nav-card-profile:hover {
  border-color: #b44dd1;
}

.nav-card-compare::before {
  background: #e68a10;
}

.nav-card-compare:hover {
  border-color: #e68a10;
}

.nav-card-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.nav-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

.nav-card-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.nav-card-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(255, 70, 127, 0.2);
  color: var(--primary);
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.nav-badge-soon {
  background: rgba(230, 138, 16, 0.2);
  color: #e68a10;
}

.nav-card-arrow {
  font-size: 2rem;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.nav-card:hover .nav-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Quick Access Section */
.quick-access-section {
  margin-bottom: 3rem;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.quick-access-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-decoration: none;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.quick-access-card:hover {
  transform: translateX(5px);
  border-color: var(--primary);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.quick-profile-icon {
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-profile-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--text);
}

.quick-card-info {
  flex: 1;
}

.quick-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.quick-card-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quick-card-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.quick-access-card.score-high .quick-card-score {
  color: var(--success);
}

.quick-access-card.score-medium .quick-card-score {
  color: #e68a10;
}

.quick-access-card.score-low .quick-card-score {
  color: #ef4444;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .navigation-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-access-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .home-title {
    font-size: 2rem;
  }
  
  .home-subtitle {
    font-size: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-icon {
    font-size: 2rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
}

/* ===================================
   END HOME PAGE STYLES
   =================================== */

/* ===================================
   FLOATING ACTION BUTTON (FAB)
   =================================== */

.fab-compare {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #3db5e6, #e68a10, #b44dd1);
    background-size: 300% 300%;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 0.05rem;
    border-radius: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.fab-compare:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    color: white;
    text-decoration: none;
}

.fab-compare:active {
    transform: translateY(0);
    color: white;
    text-decoration: none;
}

@media (max-width: 768px) {
    .fab-compare {
        bottom: 1rem;
        right: 1rem;
        padding: 0.65rem 1rem;
        font-size: 0.75rem;
    }
}

/* ===================================
   COMPARE PAGE STYLES
   =================================== */

/* Selection Section */
.compare-selection-section {
  margin-bottom: 3rem;
}

/* Carousel */
.carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.carousel-arrow {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.carousel-arrow:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.carousel-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-arrow svg {
  width: 24px;
  height: 24px;
  stroke: var(--text);
}

.carousel-arrow:hover:not(:disabled) svg {
  stroke: white;
}

.carousel-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-card {
  min-width: 200px;
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 1.5rem 1rem;
  text-align: center;
  border: 2px solid var(--border);
  position: relative;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.carousel-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.carousel-card-checkbox {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.carousel-card-checkbox input[type="checkbox"] {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Compare Actions */
.compare-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  padding: 1.5rem;
  background: transparent;
  border-radius: 0.75rem;
  border: none;
  gap: 1rem;
}

.selection-info {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 600;
}

.selection-info #selectionCount {
  color: var(--primary);
  font-size: 1.5rem;
}

.btn-compare {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  background: #00c88d;
  color: white;
  border: none;
  font-weight: bold;
  transition: all 0.3s ease;
}

.btn-compare:hover:not(:disabled) {
  background: #00b37d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 200, 141, 0.3);
}

.btn-compare:disabled {
  background: var(--passion);
  opacity: 0.6;
  cursor: not-allowed;
}

/* Results Section */
.compare-results-section {
  margin-top: 2rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* Radar Chart */
.compare-chart-container {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 2px solid var(--border);
}

.compare-chart-container canvas {
  max-height: 500px;
}

/* Compare Table */
.compare-table-container {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 2px solid var(--border);
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table thead th {
  background: rgba(255, 70, 127, 0.1);
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
}

.compare-table tbody td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.compare-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-section-header td {
  background: rgba(61, 181, 230, 0.1);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
  padding: 0.75rem 1rem !important;
}

.score-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.score-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.score-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.decision-go {
  color: var(--success);
  font-weight: 600;
}

.decision-nogo {
  color: #ef4444;
  font-weight: 600;
}

.decision-maybe {
  color: #e68a10;
  font-weight: 600;
}

/* Detailed Comparison */
.compare-details-container {
  margin-bottom: 3rem;
}

.detail-macro-section {
  background: var(--surface);
  border-radius: 1rem;
  margin-bottom: 1rem;
  border: 2px solid var(--border);
  overflow: hidden;
}

.detail-macro-header {
  padding: 1.5rem;
  background: rgba(61, 181, 230, 0.1);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

.detail-macro-header:hover {
  background: rgba(61, 181, 230, 0.15);
}

.detail-macro-header h4 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.toggle-icon {
  font-size: 1rem;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.detail-macro-content {
  padding: 1.5rem;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid var(--border);
}

.detail-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Recap */
.compare-recap-container {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem;
  border: 2px solid var(--border);
}

.recap-ranking {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border);
}

.recap-ranking h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0.5rem;
}

.ranking-medal {
  font-size: 1.5rem;
}

.ranking-name {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.ranking-score {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.recap-candidate {
  margin-bottom: 2rem;
  padding: 1.5rem;
  padding-left: 2rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0.5rem;
}

.recap-candidate h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.recap-strengths,
.recap-weaknesses {
  margin-bottom: 1rem;
}

.recap-strengths strong,
.recap-weaknesses strong {
  color: var(--text);
  font-size: 1rem;
  display: block;
  margin-bottom: 0.5rem;
}

.recap-strengths ul,
.recap-weaknesses ul {
  margin: 0;
  padding-left: 1.5rem;
}

.recap-strengths li,
.recap-weaknesses li {
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .carousel-track {
    gap: 15px;
  }
  
  .carousel-card {
    min-width: 180px;
  }
}

@media (max-width: 768px) {
  .carousel-container {
    gap: 0.5rem;
  }
  
  .carousel-arrow {
    width: 40px;
    height: 40px;
  }
  
  .carousel-card {
    min-width: 150px;
  }
  
  .compare-actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .results-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .compare-table-container {
    padding: 1rem;
  }
  
  .compare-table {
    font-size: 0.9rem;
  }
  
  .compare-table thead th,
  .compare-table tbody td {
    padding: 0.75rem 0.5rem;
  }
}

/* ===================================
   END COMPARE PAGE STYLES
   =================================== */

.btn-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  width: 100%;
}

.btn-action:hover {
  background-color: var(--surface2);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 70, 127, 0.2);
}

.btn-action .action-icon {
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.btn-action:hover .action-icon {
  color: var(--primary);
}

/* Backwards compatibility - redirect old class to new */
.btn-new-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  max-width: 400px;
}

.btn-new-card:hover {
  background-color: var(--surface2);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 70, 127, 0.2);
}

.btn-new-card .user-icon {
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
}

.btn-new-card:hover .user-icon {
  color: var(--primary);
}

/* Responsive - stack buttons on mobile */
@media (max-width: 768px) {
  .actions-buttons-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Recap Section */
.recap-section {
  margin-bottom: 3rem;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Candidate Card */
.candidate-card-item {
  background-color: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 220px;
}

.candidate-card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Card Colors based on score */
.candidate-card-item.score-low {
  background: linear-gradient(135deg, #ff4757 0%, #ff6b7a 100%);
}

.candidate-card-item.score-medium {
  background: linear-gradient(135deg, #ffa502 0%, #ffb732 100%);
}

.candidate-card-item.score-high {
  background: linear-gradient(135deg, #00c88d 0%, #00e0a0 100%);
}

/* Favorite Star */
.favorite-star {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.favorite-star:hover {
  color: rgba(255, 255, 255, 0.6);
  transform: scale(1.2);
}

.favorite-star.active {
  color: #ffd700;
}

/* Delete Button */
.delete-button {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 1.5rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: bold;
}

.delete-button:hover {
  color: #ff4757;
  transform: scale(1.2);
}

/* Profile Icon */
.profile-icon {
  width: 70px;
  height: 70px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
}

.profile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

.profile-icon svg {
  width: 45px;
  height: 45px;
  color: rgba(255, 255, 255, 0.9);
}

/* Card Info */
.card-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.card-age {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.75rem;
}

.card-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: auto;
}

/* Warning badge for outdated cards */
.warning-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background-color: #ff4757;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  animation: pulse 2s infinite;
}

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

/* ========================================
   CANDIDATE EDIT - COMPILA CARD
   ======================================== */

.page-title-card {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.page-subtitle-card {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Sezione Identikit */
.identikit-section {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
}

.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-dates-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

.checkbox-group {
  margin-bottom: 1.25rem;
  padding-top: 1.95rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.75rem 1rem;
  background-color: var(--bg);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  transition: border-color 0.3s;
  white-space: nowrap;
}

.checkbox-label:hover {
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Macro Areas Grid */
.macro-areas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.macro-area-card {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 0.75rem;
  position: relative;
}

.macro-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.macro-area-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
}

.macro-percentage-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  position: relative;
}

.macro-percentage-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, currentColor, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Colori macroaree */
.macro-area-card.macro-1 .macro-percentage-circle {
  color: #70d6ff;
  background: rgba(112, 214, 255, 0.1);
}

.macro-area-card.macro-2 .macro-percentage-circle {
  color: #ff9f1c;
  background: rgba(255, 159, 28, 0.1);
}

.macro-area-card.macro-3 .macro-percentage-circle {
  color: #cb6ce6;
  background: rgba(203, 108, 230, 0.1);
}

/* Sliders caratteristiche */
.characteristic-item {
  margin-bottom: 1.25rem;
}

.characteristic-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.characteristic-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.characteristic-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.characteristic-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 3px;
  outline: none;
  background: var(--border);
}

.characteristic-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentColor;
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.characteristic-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentColor;
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.macro-area-card.macro-1 .characteristic-slider {
  color: #70d6ff;
}

.macro-area-card.macro-2 .characteristic-slider {
  color: #ff9f1c;
}

.macro-area-card.macro-3 .characteristic-slider {
  color: #cb6ce6;
}

/* Flags Container */
.flags-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.flags-section {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 0.75rem;
}

.red-flags-section {
  border-left: 4px solid #ff4757;
}

.green-flags-section {
  border-left: 4px solid #00c88d;
}

.flags-list {
  margin-bottom: 1rem;
  min-height: 100px;
}

.flag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: var(--bg);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.flag-info {
  flex: 1;
}

.flag-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.flag-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.flag-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.flag-severity {
  display: flex;
  gap: 0.25rem;
  font-size: 1.2rem;
}

.btn-flag-edit,
.btn-flag-delete {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: transform 0.2s, opacity 0.2s;
  opacity: 0.7;
}

.btn-flag-edit:hover {
  transform: scale(1.2);
  opacity: 1;
}

.btn-flag-delete:hover {
  transform: scale(1.2);
  opacity: 1;
  color: var(--danger);
}

.btn-add-flag {
  width: 100%;
  padding: 0.875rem;
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-add-red-flag:hover {
  border-color: #ff4757;
  color: #ff4757;
  background: rgba(255, 71, 87, 0.05);
}

.btn-add-green-flag:hover {
  border-color: #00c88d;
  color: #00c88d;
  background: rgba(0, 200, 141, 0.05);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  display: none;
  position: fixed;
  z-index: 1999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}

.flag-modal-content {
  background-color: var(--surface);
  padding: 2rem;
  border-radius: 0.75rem;
  max-width: 500px;
  width: 90%;
  position: relative;
  border: 2px solid var(--border);
}

.confirm-modal-content {
  background-color: var(--surface);
  padding: 2rem;
  border-radius: 0.75rem;
  max-width: 400px;
  width: 90%;
  position: relative;
  border: 2px solid var(--border);
  text-align: center;
  z-index: 2001;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--primary);
}

.flag-modal-content h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.flag-modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.flag-severity-selector {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.flag-icon {
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.3;
  transition: all 0.2s;
  filter: grayscale(1);
}

.flag-icon:hover {
  opacity: 0.6;
  transform: scale(1.1);
}

.flag-icon.active {
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1.15);
}

.btn-save-flag {
  width: 100%;
  margin-top: 1.5rem;
}

/* Confirm Modal Actions */
.confirm-modal-content p {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.confirm-actions .btn {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem 1.5rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.form-actions .btn {
  min-width: 150px;
  padding: 0.875rem 2rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1rem;
}

/* Score Circle */
.score-circle {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
}

.score-circle.score-high {
    border-color: var(--success) !important;
    color: var(--success);
}

.score-circle.score-medium {
    border-color: #ff9f1c !important;
    color: #ff9f1c;
}

.score-circle.score-low {
    border-color: var(--danger) !important;
    color: var(--danger);
}

/* Landing Page */
.landing-page {
    background: var(--bg);
    min-height: 100vh;
}

.hero-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.67rem 2rem 1.33rem 2rem;
}

.hero-main-title {
    text-align: center;
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--text);
    margin-top: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: 0.1rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-logo {
    width: 500px;
    height: 500px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.hero-text {
    position: relative;
}

.hero-welcome-title {
    font-size: 3rem;
    font-weight: bold;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: 0.1rem;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
}

.hero-description p {
    margin-bottom: 1rem;
}

.hero-question {
    margin-top: 2rem;
    font-weight: 600;
    color: var(--text);
}

.how-it-works {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.33rem 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 4rem;
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-section {
    text-align: center;
    padding: 0.67rem 0;
}

.cta-text {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-main-title {
    font-size: 2rem;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero-logo {
    width: 250px;
    height: 250px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 0.5rem;
  }
  
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .section-subtitle {
    font-size: 0.9rem;
  }

  nav.navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  nav .nav-links {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .candidate-card-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .candidate-card-actions {
    flex-wrap: wrap;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .score-input-group {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .macro-areas-grid {
    grid-template-columns: 1fr;
  }
  
  .form-dates-row {
    grid-template-columns: 1fr;
  }
  
  .flags-container {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}

/* ========================================
   SETTINGS PAGE - SLIDER & CHART STYLES
   ======================================== */

.settings-section-large {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  padding: 2rem;
  border-radius: 1rem;
  border-left: 4px solid var(--accent1);
  margin-bottom: 2rem;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.settings-section-large h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  background: linear-gradient(135deg, var(--orange), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Alpha Section */
.alpha-section {
  background-color: var(--surface2);
  padding: 2rem;
  border-radius: 0.75rem;
  border: 2px solid var(--accent1);
}

.alpha-slider-container {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.slider-group {
  flex: 1;
  min-width: 150px;
}

.slider-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-size: 0.95rem;
}

.slider-large {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--azure), var(--magenta), var(--orange));
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider-large::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azure), var(--magenta));
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(192, 38, 211, 0.4);
  transition: all 0.2s ease;
}

.slider-large::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(192, 38, 211, 0.6);
}

.slider-large::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azure), var(--magenta));
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(192, 38, 211, 0.4);
  transition: all 0.2s ease;
}

.slider-large::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(192, 38, 211, 0.6);
}

.slider-value {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.slider-value strong {
  color: var(--accent1);
  font-size: 1.1rem;
}

.alpha-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    var(--orange) 0deg calc(var(--alpha-value, 60) * 3.6deg),
    var(--azure) calc(var(--alpha-value, 60) * 3.6deg) 360deg
  );
  box-shadow: 0 0 30px rgba(192, 38, 211, 0.3);
}

.alpha-value {
  font-size: 1.5rem;
  color: var(--bg);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.alpha-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: bold;
  margin-top: 0.25rem;
}

/* Weights Grid */
.weights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1400px) {
  .weights-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.weight-chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.chart-wrapper {
  width: 100%;
  max-width: 400px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-wrapper canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

.chart-wrapper-sub {
  width: 280px;
  max-width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-wrapper-sub canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

.sliders-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-left: 2rem;
  padding-right: 3rem;
}

/* Slider della sezione principale macroaree */
#macroAreasSection .sliders-container {
  max-width: 85%;
}

/* Slider Item */
.slider-item {
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  margin-bottom: 0.75rem;
}

.slider-item:hover {
  border-color: var(--accent1);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.2);
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.macro-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.macro-percentage {
  font-size: 0.85rem;
  color: var(--accent1);
  background-color: rgba(230, 126, 34, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 0.3rem;
}

.slider-macro {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #1A1B22;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}

.slider-macro::-webkit-slider-runnable-track {
  background: transparent;
  border-radius: 2px;
  height: 4px;
  border: none;
}

.slider-macro::-moz-range-track {
  background: transparent;
  border-radius: 2px;
  border: 1px solid var(--border);
  height: 4px;
}

.slider-macro::-moz-range-progress {
  background: transparent;
  border-radius: 2px;
  height: 4px;
}

.slider-macro::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--orange-hover));
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.4);
  transition: all 0.2s ease;
}

.slider-macro::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.6);
}

.slider-macro::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--orange-hover));
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.4);
  transition: all 0.2s ease;
}

.slider-macro::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.6);
}

.slider-track {
  display: none;
}

.slider-fill {
  height: 100%;
  background-color: currentColor;
  transition: width 0.1s ease;
  border-radius: 2px;
  display: none;
}

.threshold-input-group {
  background-color: var(--surface);
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.threshold-input-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text);
}

.threshold-input-group strong {
  color: var(--accent1);
  font-size: 1.1rem;
  background-color: rgba(230, 126, 34, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 0.3rem;
}

.slider-threshold {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--danger), var(--accent1));
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider-threshold::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--danger), var(--accent1));
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 30, 63, 0.4);
  transition: all 0.2s ease;
}

.slider-threshold::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(139, 30, 63, 0.6);
}

.slider-threshold::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--danger), var(--accent1));
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(139, 30, 63, 0.4);
  transition: all 0.2s ease;
}

.slider-threshold::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(139, 30, 63, 0.6);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Loading spinner */
.spinner {
  border: 3px solid var(--surface2);
  border-top: 3px solid var(--accent1);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 0.5rem;
}

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

/* ========================================
   MODAL OVERLAY PER SETTINGS
   ======================================== */

.modal-overlay {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--surface);
  padding: 2.5rem;
  border-radius: 1rem;
  max-width: 600px;
  width: 90%;
  position: relative;
  border: 2px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-title {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.05em;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  text-align: center;
}

.suggestion-btn {
  transition: all 0.2s;
}

.suggestion-btn:hover {
  background: var(--primary-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 70, 127, 0.3);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 70, 127, 0.2);
}

/* ============================================
   RESPONSIVE MOBILE - OTTIMIZZAZIONI
   ============================================ */

/* Tablet e Mobile Large (max-width: 1024px) */
@media (max-width: 1024px) {
  .weights-grid {
    grid-template-columns: 1fr;
  }
  
  .sliders-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  #macroAreasSection .sliders-container {
    max-width: 100%;
  }
  
  .chart-wrapper {
    max-width: 350px;
    height: 350px;
  }
  
  .chart-wrapper-sub {
    width: 240px;
    max-width: 240px;
    height: 240px;
  }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  /* Navbar responsive con hamburger menu */
  .flaggy-navbar {
    padding: 1rem;
  }
  
  .nav-hamburger {
    display: flex;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 50%;
    height: 100vh;
    background-color: var(--surface);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    border-left: 1px solid rgba(255, 70, 127, 0.2);
  }
  
  .nav-links.active {
    right: 0;
  }
  
  .nav-links li {
    width: 100%;
    text-align: center;
  }
  
  .nav-links a {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 70, 127, 0.1);
    text-align: center;
  }
  
  .nav-links a:hover,
  .nav-links a.active {
    border-bottom-color: var(--primary);
  }
  
  .theme-toggle {
    margin-left: auto;
    margin-right: auto;
    margin-top: 1rem;
    display: block;
  }
  
  /* Blocca scroll quando menu aperto */
  body.menu-open {
    overflow: hidden;
  }
  
  .nav-brand {
    font-size: 1.25rem;
  }
  
  /* Settings page - layout responsive */
  #settings-container {
    grid-template-columns: 1fr !important;
  }
  
  #settings-container > #subcategoriesContainer {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem;
  }
  
  .settings-section-large {
    padding: 1.5rem 1rem;
  }
  
  /* Macro Areas e Subcategories - layout verticale */
  .weights-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2rem !important;
  }
  
  .weight-chart-container {
    width: 100% !important;
    max-width: 350px !important;
  }
  
  .sliders-container {
    width: 100% !important;
    max-width: 600px !important;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    gap: 1rem;
  }
  
  .chart-wrapper {
    max-width: 300px;
    height: 300px;
  }
  
  .chart-wrapper-sub {
    width: 200px;
    max-width: 200px;
    height: 200px;
  }
  
  .slider-item-v2 {
    padding: 0.75rem;
  }
  
  /* Modal confirm */
  .confirm-modal-content {
    max-width: 90%;
    padding: 1.5rem;
  }
  
  .confirm-modal-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .confirm-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .confirm-actions .btn {
    width: 100%;
  }
  
  /* Tooltip custom - ridimensionamento */
  #chartjs-tooltip-custom {
    max-width: 90vw !important;
    font-size: 0.85rem !important;
    padding: 15px !important;
  }
  
  /* Hero section */
  .hero-content {
    padding: 1rem;
  }
  
  /* Dashboard cards */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Compare section */
  .compare-carousel {
    padding: 1rem 0.5rem;
  }
  
  .carousel-card {
    min-width: 200px;
  }
  
  /* Settings section header */
  .settings-section h3 {
    font-size: 1.1rem;
  }
  
  .section-subtitle {
    font-size: 0.85rem;
  }
}

/* Mobile Small (max-width: 480px) */
@media (max-width: 480px) {
  .chart-wrapper {
    max-width: 250px;
    height: 250px;
  }
  
  .chart-wrapper-sub {
    width: 180px;
    max-width: 180px;
    height: 180px;
  }
  
  .slider-item-v2 {
    padding: 0.5rem;
  }
  
  .slider-item-v2 > div:first-child span {
    font-size: 0.85rem;
  }
  
  #chartjs-tooltip-custom {
    font-size: 0.75rem !important;
    padding: 12px !important;
  }
  
  #chartjs-tooltip-custom > div:first-child {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }
  
  .hero-main-title {
    font-size: 1.75rem;
  }
  
  .hero-logo {
    width: 200px;
    height: 200px;
  }
  
  .feature-card {
    padding: 1.5rem 1rem;
  }
  
  .carousel-card {
    min-width: 180px;
  }
  
  .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
  }
}

/* ===================================
   PROFILE IMAGE SELECTOR
   =================================== */

.profile-image-modal-content {
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

#profileImageGrid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 2rem;
  padding: 2rem;
  width: 100%;
}

.image-item {
  position: relative;
  cursor: pointer;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  aspect-ratio: 1;
}

.image-item:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

.image-item.selected {
  border-color: var(--accent2);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.selected-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--accent2);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
