/* ============================================================
   GA Pratiche — Sistema Temi
   CSS Variables per 5 palette + override delle classi Tailwind
   ============================================================ */

/* ── BLU (default) ─────────────────────────────────────────── */
:root, [data-theme="blue"] {
  --p-50:  239,246,255;
  --p-100: 219,234,254;
  --p-200: 191,219,254;
  --p-400:  96,165,250;
  --p-500:  59,130,246;
  --p-600:  37, 99,235;
  --p-700:  29, 78,216;
  --p-800:  30, 64,175;
  --p-900:  30, 58,138;
  --p-950:  23, 37, 84;
  --hero-grad: linear-gradient(135deg,#1d4ed8 0%,#1e3a8a 40%,#1e40af 100%);
  --btn-grad:  linear-gradient(135deg,#1e40af,#1d4ed8);
  --btn-shadow: rgba(29,78,216,0.4);
  --tab-active: #1d4ed8;
  --logo-text:  #1e40af;
}

/* ── ROSSO ──────────────────────────────────────────────────── */
[data-theme="red"] {
  --p-50:  254,242,242;
  --p-100: 254,226,226;
  --p-200: 254,202,202;
  --p-400: 248,113,113;
  --p-500: 239, 68, 68;
  --p-600: 220, 38, 38;
  --p-700: 185, 28, 28;
  --p-800: 153, 27, 27;
  --p-900: 127, 29, 29;
  --p-950:  69, 10, 10;
  --hero-grad: linear-gradient(135deg,#dc2626 0%,#7f1d1d 40%,#991b1b 100%);
  --btn-grad:  linear-gradient(135deg,#991b1b,#dc2626);
  --btn-shadow: rgba(220,38,38,0.4);
  --tab-active: #dc2626;
  --logo-text:  #991b1b;
}

/* ── SMERALDO ───────────────────────────────────────────────── */
[data-theme="emerald"] {
  --p-50:  236,253,245;
  --p-100: 209,250,229;
  --p-200: 167,243,208;
  --p-400:  52,211,153;
  --p-500:  16,185,129;
  --p-600:   5,150,105;
  --p-700:   4,120, 87;
  --p-800:   6, 95, 70;
  --p-900:   6, 78, 59;
  --p-950:   2, 44, 34;
  --hero-grad: linear-gradient(135deg,#059669 0%,#065f46 40%,#047857 100%);
  --btn-grad:  linear-gradient(135deg,#065f46,#059669);
  --btn-shadow: rgba(5,150,105,0.4);
  --tab-active: #059669;
  --logo-text:  #065f46;
}

/* ── VIOLA ──────────────────────────────────────────────────── */
[data-theme="violet"] {
  --p-50:  245,243,255;
  --p-100: 237,233,254;
  --p-200: 221,214,254;
  --p-400: 167,139,250;
  --p-500: 139, 92,246;
  --p-600: 124, 58,237;
  --p-700: 109, 40,217;
  --p-800:  91, 33,182;
  --p-900:  76, 29,149;
  --p-950:  46, 16,101;
  --hero-grad: linear-gradient(135deg,#7c3aed 0%,#4c1d95 40%,#6d28d9 100%);
  --btn-grad:  linear-gradient(135deg,#4c1d95,#7c3aed);
  --btn-shadow: rgba(124,58,237,0.4);
  --tab-active: #7c3aed;
  --logo-text:  #6d28d9;
}

/* ── ARANCIO ────────────────────────────────────────────────── */
[data-theme="orange"] {
  --p-50:  255,247,237;
  --p-100: 255,237,213;
  --p-200: 254,215,170;
  --p-400: 251,146, 60;
  --p-500: 249,115, 22;
  --p-600: 234, 88, 12;
  --p-700: 194, 65, 12;
  --p-800: 154, 52, 18;
  --p-900: 124, 45, 18;
  --p-950:  67, 20,  7;
  --hero-grad: linear-gradient(135deg,#ea580c 0%,#7c2d12 40%,#9a3412 100%);
  --btn-grad:  linear-gradient(135deg,#9a3412,#ea580c);
  --btn-shadow: rgba(234,88,12,0.4);
  --tab-active: #ea580c;
  --logo-text:  #9a3412;
}

/* ── TEAL ───────────────────────────────────────────────────── */
[data-theme="teal"] {
  --p-50:  240,253,250;
  --p-100: 204,251,241;
  --p-200: 153,246,228;
  --p-400:  45,212,191;
  --p-500:  20,184,166;
  --p-600:  13,148,136;
  --p-700:  15,118,110;
  --p-800:  17, 94, 89;
  --p-900:  19, 78, 74;
  --p-950:   4, 47, 46;
  --hero-grad: linear-gradient(135deg,#0d9488 0%,#134e4a 40%,#115e59 100%);
  --btn-grad:  linear-gradient(135deg,#115e59,#0d9488);
  --btn-shadow: rgba(13,148,136,0.4);
  --tab-active: #0d9488;
  --logo-text:  #115e59;
}

/* ── INDACO ──────────────────────────────────────────────────── */
[data-theme="indigo"] {
  --p-50:  238,242,255;
  --p-100: 224,231,255;
  --p-200: 199,210,254;
  --p-400: 129,140,248;
  --p-500:  99,102,241;
  --p-600:  79, 70,229;
  --p-700:  67, 56,202;
  --p-800:  55, 48,163;
  --p-900:  49, 46,129;
  --p-950:  30, 27, 75;
  --hero-grad: linear-gradient(135deg,#4f46e5 0%,#312e81 40%,#3730a3 100%);
  --btn-grad:  linear-gradient(135deg,#3730a3,#4f46e5);
  --btn-shadow: rgba(79,70,229,0.4);
  --tab-active: #4f46e5;
  --logo-text:  #3730a3;
}

/* ── AMBRA ───────────────────────────────────────────────────── */
[data-theme="amber"] {
  --p-50:  255,251,235;
  --p-100: 254,243,199;
  --p-200: 253,230,138;
  --p-400: 251,191, 36;
  --p-500: 245,158, 11;
  --p-600: 217,119,  6;
  --p-700: 180, 83,  9;
  --p-800: 146, 64, 14;
  --p-900: 120, 53, 15;
  --p-950:  69, 26,  3;
  --hero-grad: linear-gradient(135deg,#d97706 0%,#78350f 40%,#92400e 100%);
  --btn-grad:  linear-gradient(135deg,#92400e,#d97706);
  --btn-shadow: rgba(217,119,6,0.4);
  --tab-active: #d97706;
  --logo-text:  #92400e;
}

/* ── ROSA ────────────────────────────────────────────────────── */
[data-theme="rose"] {
  --p-50:  255,241,242;
  --p-100: 255,228,230;
  --p-200: 254,205,211;
  --p-400: 251,113,133;
  --p-500: 244, 63, 94;
  --p-600: 225, 29, 72;
  --p-700: 190, 18, 60;
  --p-800: 159, 18, 57;
  --p-900: 136, 19, 55;
  --p-950:  76,  5, 25;
  --hero-grad: linear-gradient(135deg,#e11d48 0%,#881337 40%,#9f1239 100%);
  --btn-grad:  linear-gradient(135deg,#9f1239,#e11d48);
  --btn-shadow: rgba(225,29,72,0.4);
  --tab-active: #e11d48;
  --logo-text:  #9f1239;
}

/* ── CIANO ───────────────────────────────────────────────────── */
[data-theme="cyan"] {
  --p-50:  236,254,255;
  --p-100: 207,250,254;
  --p-200: 165,243,252;
  --p-400:  34,211,238;
  --p-500:   6,182,212;
  --p-600:   8,145,178;
  --p-700:  14,116,144;
  --p-800:  21, 94,117;
  --p-900:  22, 78, 99;
  --p-950:   8, 51, 68;
  --hero-grad: linear-gradient(135deg,#0891b2 0%,#164e63 40%,#155e75 100%);
  --btn-grad:  linear-gradient(135deg,#155e75,#0891b2);
  --btn-shadow: rgba(8,145,178,0.4);
  --tab-active: #0891b2;
  --logo-text:  #155e75;
}

/* ── ANTRACITE ──────────────────────────────────────────────── */
[data-theme="slate"] {
  --p-50:  248,250,252;
  --p-100: 241,245,249;
  --p-200: 226,232,240;
  --p-400: 148,163,184;
  --p-500: 100,116,139;
  --p-600:  71, 85,105;
  --p-700:  51, 65, 85;
  --p-800:  30, 41, 59;
  --p-900:  15, 23, 42;
  --p-950:   2,  6, 23;
  --hero-grad: linear-gradient(135deg,#475569 0%,#0f172a 40%,#334155 100%);
  --btn-grad:  linear-gradient(135deg,#0f172a,#475569);
  --btn-shadow: rgba(71,85,105,0.4);
  --tab-active: #475569;
  --logo-text:  #334155;
}

/* ============================================================
   Override esplicito di tutte le classi primary-* usate
   (sostituisce il valore statico generato da Tailwind CDN)
   ============================================================ */

/* — background — */
.bg-primary-50  { background-color: rgb(var(--p-50))  !important; }
.bg-primary-100 { background-color: rgb(var(--p-100)) !important; }
.bg-primary-500 { background-color: rgb(var(--p-500)) !important; }
.bg-primary-700 { background-color: rgb(var(--p-700)) !important; }
.bg-primary-800 { background-color: rgb(var(--p-800)) !important; }

/* — background con opacità (slash syntax) — */
.bg-primary-500\/30 { background-color: rgba(var(--p-500), 0.3) !important; }
.bg-primary-700\/10 { background-color: rgba(var(--p-700), 0.1) !important; }

/* — hover:background — */
.hover\:bg-primary-50:hover  { background-color: rgb(var(--p-50))  !important; }
.hover\:bg-primary-500:hover { background-color: rgb(var(--p-500)) !important; }
.hover\:bg-primary-800:hover { background-color: rgb(var(--p-800)) !important; }

/* — text — */
.text-primary-100 { color: rgb(var(--p-100)) !important; }
.text-primary-200 { color: rgb(var(--p-200)) !important; }
.text-primary-500 { color: rgb(var(--p-500)) !important; }
.text-primary-700 { color: rgb(var(--p-700)) !important; }
.text-primary-800 { color: rgb(var(--p-800)) !important; }
.text-primary-900 { color: rgb(var(--p-900)) !important; }

/* — hover:text — */
.hover\:text-primary-700:hover { color: rgb(var(--p-700)) !important; }

/* — border — */
.border-primary-100 { border-color: rgb(var(--p-100)) !important; }
.border-primary-200 { border-color: rgb(var(--p-200)) !important; }
.border-primary-400 { border-color: rgb(var(--p-400)) !important; }
.border-primary-700 { border-color: rgb(var(--p-700)) !important; }

/* — border con opacità (slash syntax) — */
.border-primary-400\/40 { border-color: rgba(var(--p-400), 0.4) !important; }

/* — hover:border — */
.hover\:border-primary-200:hover { border-color: rgb(var(--p-200)) !important; }
.hover\:border-primary-400:hover { border-color: rgb(var(--p-400)) !important; }

/* — focus:border — */
.focus\:border-primary-400:focus { border-color: rgb(var(--p-400)) !important; }

/* — border direzionali (spinner) — */
.border-t-primary-600 { border-top-color: rgb(var(--p-600)) !important; }

/* — ring — */
.ring-primary-100 { --tw-ring-color: rgb(var(--p-100)) !important; }

/* — gradienti from/to — */
.from-primary-700 { --tw-gradient-from: rgb(var(--p-700)) !important; }
.from-primary-950 { --tw-gradient-from: rgb(var(--p-950)) !important; }
.to-primary-800   { --tw-gradient-to:   rgb(var(--p-800)) !important; }

/* ============================================================
   Regole funzionali globali
   ============================================================ */

/* Hero gradient */
.gradient-hero { background: var(--hero-grad) !important; }

/* Bottone primario */
.btn-primary { background: var(--btn-grad) !important; }
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--btn-shadow) !important;
}

/* Input/select/textarea focus */
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: rgb(var(--p-700)) !important;
  box-shadow: 0 0 0 3px rgba(var(--p-700), 0.15) !important;
}

/* Tab attivo admin */
.tab-btn.active {
  border-bottom: 2px solid var(--tab-active) !important;
  color: var(--tab-active) !important;
}

/* Scritta logo */
.ga-logo-text {
  color: var(--logo-text);
  font-family: 'Times New Roman', Times, serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-top: -0.25rem;
  margin-bottom: 5px;
  display: block;
}
