/* ============================================================
   components.css — SPU-LMS 2.0 VIVID
   No shimmer loop → no flicker. Animazioni CSS transform only.
   ============================================================ */

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform 150ms cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 150ms ease,
              background 120ms ease,
              color 120ms ease;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.95) !important; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn--primary {
  background: var(--color-navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,58,110,0.30);
}
.btn--primary:hover {
  background: var(--color-navy-light);
  box-shadow: 0 6px 20px rgba(30,58,110,0.40);
  transform: translateY(-2px);
  color: #fff; text-decoration: none;
}

.btn--gold {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
  color: var(--color-navy-dark);
  box-shadow: 0 2px 12px rgba(201,168,76,0.35);
  font-weight: var(--font-weight-bold);
}
.btn--gold:hover {
  background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
  box-shadow: 0 6px 24px rgba(201,168,76,0.50);
  transform: translateY(-2px);
  color: var(--color-navy-dark); text-decoration: none;
}

.btn--outline {
  background: transparent;
  color: var(--color-navy);
  border: 2px solid var(--color-navy);
  padding: 8px var(--space-5);
}
.btn--outline:hover {
  background: var(--color-navy);
  color: #fff;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn--ghost:hover {
  background: var(--color-surface);
  color: var(--color-navy);
  border-color: var(--color-navy);
  text-decoration: none;
}

.btn--danger {
  background: var(--color-error);
  color: #fff;
  box-shadow: 0 2px 8px rgba(231,76,60,0.30);
}
.btn--danger:hover {
  background: #c0392b;
  box-shadow: 0 6px 20px rgba(231,76,60,0.45);
  transform: translateY(-2px);
  color: #fff; text-decoration: none;
}

.btn--success {
  background: var(--color-success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46,204,113,0.30);
}
.btn--success:hover { transform: translateY(-2px); color: #fff; text-decoration: none; }

.btn--sm  { padding: 6px var(--space-3); font-size: var(--font-size-xs); border-radius: var(--radius-sm); }
.btn--lg  { padding: var(--space-2) var(--space-8); font-size: var(--font-size-base); border-radius: var(--radius-lg); }
.btn--full { width: 100%; }

.btn--loading { pointer-events: none; opacity: 0.75; }
.btn--loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: var(--space-2);
  display: inline-block;
  vertical-align: middle;
}

/* ─── CARDS ─── */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 200ms ease,
              border-color 200ms ease;
  animation: fadeIn 0.4s both;
}

.card--elevated { box-shadow: var(--shadow-md); border-color: transparent; }

.card--interactive { cursor: pointer; }
.card--interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(30,58,110,0.15);
}
.card--interactive:active { transform: translateY(-1px); }

.card--navy {
  background: linear-gradient(135deg, var(--color-navy-dark), var(--color-navy-mid));
  border: none; box-shadow: var(--shadow-navy);
}
.card--navy h1,.card--navy h2,.card--navy h3,.card--navy h4,.card--navy p { color: #fff; }

.card__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-5); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.card__title {
  font-size: var(--font-size-xs); font-weight: var(--font-weight-extrabold);
  color: var(--color-navy); text-transform: uppercase; letter-spacing: 0.08em;
}
.card__footer { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }

/* ─── STAT CARDS — no shimmer, no flicker ─── */
.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2);
  display: flex; flex-direction: column; gap: var(--space-2);
  position: relative; overflow: hidden;

  /* Entrata: scale da sotto — una volta sola, niente loop */
  animation: statCardIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;

  /* Hover: transform only — GPU accelerated, no reflow */
  transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 200ms ease;
}

@keyframes statCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Bordo colorato — statico, niente animazione loop */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  /* Il colore viene sovrascritto inline per ogni card */
  background: var(--color-navy);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Background decorativo — no animation */
.stat-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(0,0,0,0.03);
}

.stat-card__label {
  font-size: 10px; font-weight: var(--font-weight-extrabold);
  text-transform: uppercase; letter-spacing: var(--letter-spacing-widest);
  color: var(--color-text-light);
}

.stat-card__value {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-black);
  color: var(--color-navy-dark);
  line-height: 1;
  letter-spacing: var(--letter-spacing-tight);
  /* Contatore animato — una volta sola */
  animation: countIn 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes countIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.stat-card__sub { font-size: var(--font-size-xs); color: var(--color-text-muted); }

/* ─── FORM ─── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--color-text); }
.form-label--required::after { content: ' *'; color: var(--color-error); }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px var(--space-4);
  font-size: var(--font-size-sm); color: var(--color-text);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 120ms ease, box-shadow 120ms ease;
  appearance: none;
}
.form-input:hover,.form-select:hover { border-color: #b0bcd4; }
.form-input:focus,.form-select:focus,.form-textarea:focus {
  outline: none; border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(30,58,110,0.12); background: #fafbff;
}
.form-input::placeholder,.form-textarea::placeholder { color: var(--color-text-light); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint  { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.form-error { font-size: var(--font-size-xs); color: var(--color-error); font-weight: var(--font-weight-semibold); }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

/* ─── BADGE ─── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; font-size: 11px; font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full); white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge--navy    { background: rgba(30,58,110,0.10);  color: var(--color-navy);       border: 1px solid rgba(30,58,110,0.20); }
.badge--gold    { background: rgba(201,168,76,0.15); color: #8a6820;                border: 1px solid rgba(201,168,76,0.30); }
.badge--success { background: rgba(46,204,113,0.12); color: #1a8a47;                border: 1px solid rgba(46,204,113,0.25); }
.badge--error   { background: rgba(231,76,60,0.12);  color: var(--color-red);       border: 1px solid rgba(231,76,60,0.25); }
.badge--warning { background: rgba(243,156,18,0.12); color: #9a6c00;                border: 1px solid rgba(243,156,18,0.25); }
.badge--info    { background: rgba(52,152,219,0.12); color: #1a7ab5;                border: 1px solid rgba(52,152,219,0.25); }
.badge--gray    { background: var(--color-surface);  color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge--red     { background: rgba(231,76,60,0.10);  color: var(--color-red);       border: 1px solid rgba(231,76,60,0.20); }
.badge--green   { background: rgba(46,204,113,0.10); color: #1a8a47;               border: 1px solid rgba(46,204,113,0.20); }
.badge--blue    { background: rgba(52,152,219,0.10); color: #1a7ab5;               border: 1px solid rgba(52,152,219,0.20); }
.badge--purple  { background: rgba(155,89,182,0.10); color: #7b3f9e;               border: 1px solid rgba(155,89,182,0.20); }

/* ─── TOAST ─── */
.toast-container {
  position: fixed; bottom: var(--space-6); right: var(--space-6);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-1);
  max-width: 380px; width: calc(100vw - var(--space-12));
}
.toast {
  display: flex; align-items: flex-start; gap: var(--space-1);
  padding: var(--space-2) var(--space-5);
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  opacity: 0;
  transform: translateX(24px) scale(0.96);
  transition: opacity 200ms ease, transform 250ms cubic-bezier(0.34,1.56,0.64,1);
}
.toast--visible { opacity: 1; transform: translateX(0) scale(1); }
.toast__icon    { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast__message { flex: 1; font-size: var(--font-size-sm); line-height: 1.5; }
.toast__close   { font-size: 18px; color: var(--color-text-light); cursor: pointer; padding: 0 2px; }
.toast__close:hover { color: var(--color-text); }
.toast--success { border-left: 4px solid var(--color-success); }
.toast--success .toast__icon { color: var(--color-success); }
.toast--error   { border-left: 4px solid var(--color-error); }
.toast--error .toast__icon   { color: var(--color-error); }
.toast--warning { border-left: 4px solid var(--color-warning); }
.toast--warning .toast__icon { color: var(--color-warning); }
.toast--info    { border-left: 4px solid var(--color-info); }
.toast--info .toast__icon    { color: var(--color-info); }

/* ─── TABELLE ─── */
.table-wrapper {
  overflow-x: auto; border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs); background: var(--color-bg-card);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
.table thead { background: var(--color-navy-dark); position: sticky; top: 0; z-index: 1; }
.table th {
  padding: 12px var(--space-4); text-align: left;
  font-size: 11px; font-weight: var(--font-weight-bold);
  text-transform: uppercase; letter-spacing: var(--letter-spacing-widest);
  color: rgba(255,255,255,0.75); white-space: nowrap;
}
.table td {
  padding: var(--space-2); border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text); vertical-align: middle;
  transition: background 100ms ease;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 100ms ease; }
.table tbody tr:hover td { background: rgba(30,58,110,0.03); }

/* ─── PAGE STATES ─── */
.page-error,.page-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh; padding: var(--space-2); animation: fadeIn 0.4s both;
}
.page-placeholder__inner { text-align: center; max-width: 420px; }
.page-placeholder__badge {
  display: inline-block; padding: var(--space-2) var(--space-5);
  background: rgba(201,168,76,0.12); color: #8a6820;
  border-radius: var(--radius-full); font-size: 11px; font-weight: var(--font-weight-bold);
  text-transform: uppercase; letter-spacing: var(--letter-spacing-widest);
  margin-bottom: var(--space-5); border: 1px solid rgba(201,168,76,0.25);
}
.empty-state {
  text-align: center; padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted); animation: fadeIn 0.5s both;
}
.empty-state__icon {
  font-size: 4rem; margin-bottom: var(--space-2); opacity: 0.25;
}
.empty-state__title {
  font-size: var(--font-size-lg); font-weight: var(--font-weight-bold);
  color: var(--color-text); margin-bottom: var(--space-2);
}

/* ─── DIVIDER ─── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: var(--space-6) 0;
}

/* ─── AVATAR ─── */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-navy-light), var(--color-navy-dark));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--font-size-sm); font-weight: var(--font-weight-bold);
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 2px 8px rgba(30,58,110,0.25);
  transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1);
}
.avatar:hover { transform: scale(1.1); }
.avatar--lg { width: 52px; height: 52px; font-size: var(--font-size-xl); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }


/* ═══════════════════════════════════════════════════
   MOBILE COMPONENTS v2.0 — dashboard, quick actions, assignments
   ═══════════════════════════════════════════════════ */

/* Quick action buttons (4-grid) */
.qa-action {
  background: var(--color-white);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.qa-action:active { transform: scale(0.94); }
.qa-action__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qa-action__label {
  font-size: 8px;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Assignment rows */
.asgn-row {
  background: var(--color-white);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.asgn-row:active { transform: scale(0.98); }
.asgn-ic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.asgn-body { flex: 1; min-width: 0; }
.asgn-nm {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asgn-mt {
  font-size: 9px;
  color: var(--color-text-light);
  margin-top: 1px;
  font-weight: 500;
}
.asgn-status {
  font-size: 8px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 99px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.st-done    { background: var(--color-success-bg); color: var(--color-success); }
.st-pend    { background: var(--color-warning-bg); color: var(--color-warning); }
.st-open    { background: rgba(30,58,110,0.08); color: var(--color-navy); }
.st-review  { background: var(--color-info-bg); color: var(--color-info); }
.st-graded  { background: rgba(30,58,110,0.12); color: var(--color-navy-dark); }


/* ── SIDEBAR EXIT BUTTON ── */
.sidebar__exit-wrap {
  padding: 16px 12px 12px;
  margin-top: auto;
  border-top: 1px solid var(--color-border-light);
}
.sidebar__exit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: none;
  border: 1.5px solid rgba(231,76,60,0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-error);
  transition: background 0.15s, border-color 0.15s;
  text-align: left;
}
.sidebar__exit-btn:hover {
  background: var(--color-error-bg);
  border-color: rgba(231,76,60,0.45);
}
.sidebar__exit-btn:active {
  background: rgba(231,76,60,0.12);
}
.sidebar__exit-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════
   PROGRAMME PAGE — week blocks, session rows, badges
   ═══════════════════════════════════════════════════ */

/* Week block container */
.wb {
  margin: 10px 12px 0;
  background: var(--color-white);
  border-radius: 16px;
  overflow: hidden;
}
.wb-hdr {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--color-border-light);
}
.wb-nc {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wb-meta { flex: 1; min-width: 0; }
.wb-mt {
  font-size: 11px; font-weight: 700;
  color: var(--color-navy-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wb-dt { font-size: 9px; color: var(--color-text-light); margin-top: 1px; font-weight: 500; }

/* Session row */
.s-row {
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
}
.s-row:last-child { border-bottom: none; }
.s-time {
  font-size: 9px; font-weight: 700;
  color: var(--color-text-light);
  width: 28px; flex-shrink: 0;
  text-align: center; line-height: 1.2;
}
.s-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.s-body { flex: 1; min-width: 0; }
.s-nm {
  font-size: 10px; font-weight: 700;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-fc { font-size: 8px; color: var(--color-text-light); font-weight: 500; margin-top: 1px; }
.s-tp {
  font-size: 7px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
  flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.05em;
}

/* Week status pills */
.week-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 7px; font-weight: 800;
  padding: 3px 9px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.06em;
  flex-shrink: 0;
}
.week-badge-pill.live { background: rgba(255,255,255,0.95); color: #1e3a6e; }
.week-badge-pill.done { background: #d1fae5; color: #059669; }
.week-badge-pill.soon { background: #f0f3fa; color: #6b7280; }

.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #e74c3c;
  animation: spu-dot-blink 1.2s infinite;
  flex-shrink: 0;
}

/* Page header inner — hamburger spans */
.page-header-inner__ham span {
  display: block;
  width: 16px; height: 1.8px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
}
