/* ══════════════════════════════════════════════════
   desktop.css — Layout desktop LabelFixer
   Design System: Brick Palette v01 (DS §7)
   ══════════════════════════════════════════════════ */

/* ── Layout base ──────────────────────────────── */
.app-desktop {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar fissa — DS §7.1 (48px) ───────────── */
.navbar-desktop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);  /* 48px */
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar-inner {
  display: flex;
  align-items: center;
  max-width: 1200px;             /* DS §7.1 */
  margin: 0 auto;
  padding: 0 var(--space-2xl);
  height: 100%;
  /* Tre zone: left (logo) | center (nav links) | right (switch) */
}

.navbar-left {
  flex: 1;
  display: flex;
  align-items: baseline;
}

/* Logo — DS §7.1: "Label" #111827 600, "Fixer" #6B7280 600 */
.navbar-logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-error);     /* "Label" — Red Brick */
  text-decoration: none;
}
.navbar-logo span {
  color: var(--color-primary);   /* "Fixer" — Blue Brick */
}

/* Versione app — testo discreto allineato alla baseline del logo (sessione 13) */
.app-version {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  margin-left: var(--space-xs);
}

/* ── Nav links — zona centrale — DS §7.1 ──────── */
.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* DS §12: testo unico colore primario — niente secondary su elementi funzionali */
.navbar-links a {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.navbar-links a:hover {
  color: var(--color-text);
  text-decoration: none;
  border-bottom-color: var(--color-text);
}
.navbar-links a.nav-active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* ── Zona destra (switch btn) ──────────────────── */
.navbar-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
}

/* Pulsante dark mode nella navbar — sfondo solido anche a riposo — DS §12 */
.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle);  /* sfondo leggero sempre visibile */
  color: var(--color-text);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
}
.theme-btn:hover {
  border-color: var(--color-border-hover);
  background: var(--color-border);
}

/* ── Contenuto principale ─────────────────────── */
.main-desktop {
  flex: 1;
  margin-top: var(--navbar-height);
  margin-bottom: var(--footer-height);
  display: flex;
  justify-content: center;
  padding: var(--space-2xl);
}

.content-desktop {
  width: 100%;
  max-width: 1060px;
}

/* ── Footer fisso — DS §7.2 (40px) ───────────── */
.footer-desktop {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);  /* 40px */
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 100;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* ── Schermata Home (upload) — DS §7.3 ───────── */
.screen-home-desktop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding-top: var(--space-xl);
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

/* DS §7.3: h1 30px 700 */
.screen-home-desktop .app-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
}
.screen-home-desktop .app-title span {
  color: var(--color-text-secondary);
}

/* DS §7.3: sottotitolo 18px 500 #6B7280 */
.screen-home-desktop .app-subtitle {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: calc(var(--space-xs) * -1);
}

/* DS §7.3: descrizione 14px 400 #9CA3AF — recede */
.screen-home-desktop .app-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 480px;
}

.screen-home-desktop .drop-zone {
  width: 100%;
}

/* CTA hero: 44px, Blue Brick (ereditato da .btn.btn-primary) */
.screen-home-desktop .btn-cta {
  width: 100%;
}

/* ── Schermata Editor — layout a due colonne ──── */
.screen-editor-desktop {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-2xl);
  align-items: start;
}

.editor-preview-desktop {
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-xl));
}

.editor-preview-desktop .a4-container {
  max-width: 100%;
}

/* ── Sidebar editor — DS §4.4 + §11.4 ────────── */
/* Card container: NO padding interno — gestito dalle singole card */
.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);          /* 8px tra card — DS §11.4 */
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-xl));
}

/* DS §12.1: label Title Case, colore testo primario, icon 18px allineata */
.editor-sidebar .section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);            /* colore unico — DS §12 */
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Inner span (icon + label text): flex per allineamento verticale preciso */
.editor-sidebar .section-title > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;                            /* gap uniforme icon-label — DS §12.1 */
  line-height: 1;
}

.editor-sidebar .section-title i {
  font-size: 18px;                     /* icona grande, visibile — DS §11.2 */
  flex-shrink: 0;
}

/* ── Sidebar sections — DS §11.4: ogni section è una card ── */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md); /* 8px */
}

/* Riga con due colonne (Copie + Posizione) */
.sidebar-section--row {
  flex-direction: row;
  gap: var(--space-md);
  align-items: flex-start;
}

.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.sidebar-col--align {
  flex: 0 0 auto;
}

/* Section-title con valore inline a destra — DS §4.5 */
.editor-sidebar .section-title.section-title--value {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

/* Valore inline: sempre ben visibile — stesso size del titolo */
.editor-sidebar .section-title.section-title--value .section-value,
.editor-sidebar .section-title.section-title--value .control-value {
  color: var(--color-text);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

/* Subsection (Margine taglio dentro Linee di taglio) */
.sidebar-subsection {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

/* ── Sezione inattiva — DS §11.1: SOLO lo slider si attenua ── */
/* I testi restano IDENTICI in stato attivo e inattivo: stesso colore, stesso peso.
   È lo slider (e il toggle) a comunicare lo stato, non il testo. */
.is-inactive {
  pointer-events: none;
  user-select: none;
}
.is-inactive input[type="range"] {
  opacity: 0.35;  /* unica eccezione: slider appare disabilitato */
}
/* NESSUN'altra regola su .is-inactive — DS §11.1 */

/* ── Azioni editor — DS §4.1 + §11.4 ─────────── */
/* Card come tutte le sidebar-section. Ordine: Print → Download → Share → New Label */
.editor-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.editor-sidebar-actions .btn {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

/* btn-editor-* e .scale-auto-note → spostati in common.css (condivisi desktop+mobile) */

/* ── Responsive: schermi medi ─────────────────── */
@media (max-width: 960px) {
  .screen-editor-desktop {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .editor-preview-desktop {
    position: static;
  }

  .editor-sidebar {
    position: static;
  }

  .navbar-links {
    display: none;
  }
  .navbar-left,
  .navbar-right {
    flex: 0 0 auto;
  }
  .navbar-inner {
    justify-content: space-between;
  }
}

/* ── Pulsante switch A4/Thermal nella navbar ──── */
/* DS §7.1: compact 32px, border 1px #E5E7EB, hover bg #F3F4F6 */
/* DS §12: sfondo solido leggero anche a riposo, testo primario */
.btn-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0 12px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface-subtle);  /* sfondo leggero visibile */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  height: 32px;                  /* compact — DS §4.1 */
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-switch:hover {
  background: var(--color-border);
  border-color: var(--color-border-hover);
  text-decoration: none;
}
.btn-switch i {
  font-size: 1em;
}

/* ── Pulsante Grazie (footer) — DS §7.2 ─────── */
/* Red Brick, 28px, font 12px 600 */
.btn-thank-you {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--color-error);          /* Red Brick #DC2626 */
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
  height: 28px;                  /* DS §7.2: tutti gli elem footer 28px */
}
.btn-thank-you:hover {
  opacity: 0.88;
  color: #FFFFFF;
  text-decoration: none;
}
.btn-thank-you i {
  color: inherit;
}

/* Variante compatta footer (usa la stessa height) */
.btn-thank-you-sm {
  padding: 0 10px;
  font-size: var(--font-size-xs);
}

/* ── Altezza uniforme elementi footer ─────────── */
/* DS §7.2: tutti a 28px */
.btn-thank-you,
.btn-thank-you-sm,
.lang-select,
.footer-right .theme-btn {
  height: 28px;
  box-sizing: border-box;
}

/* ── Footer — 3 zone ─────────────────────────── */
.footer-inner {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-2xl);
  height: 100%;
}

.footer-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-center {
  flex: 0 0 auto;
}

.footer-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
}

/* Link legali nel footer — DS §12: stessa leggibilità del resto dell'UI */
.footer-link {
  font-size: var(--font-size-xs);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
}
.footer-link:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* ── Footer controls (lingua + tema) ─────────── */
.footer-right .theme-btn {
  width: 28px;
  height: 28px;
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
}

/* ── Badge "Thermal" nel titolo ──────────────── */
.title-badge {
  font-size: 0.45em;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--color-primary);  /* Blue Brick — stabile in entrambi i temi */
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  vertical-align: middle;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Thermal preview container ───────────────── */
.thermal-container {
  max-width: 100%;
}
.thermal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 101.6 / 152.4;
  background: var(--color-surface-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.thermal-frame canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ── Drawer switch link ──────────────────────── */
.nav-drawer-switch {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.nav-drawer-switch:hover {
  background: var(--color-border);
  text-decoration: none;
}
