/* ====================================================
   Aste Auto — CSS personalizzato
   Complementa Tailwind CSS
   ==================================================== */

:root {
  --color-primary:       #1976d2;
  --color-primary-dark:  #1565c0;
  --color-danger:        #d32f2f;
  --color-success:       #388e3c;
  --color-warning:       #f57c00;
  --color-info:          #0288d1;
  --color-bg:            #fafafa;
  --color-surface:       #ffffff;
  --color-text:          #212121;
  --color-text-secondary:#757575;
  --color-border:        #e0e0e0;
  --radius:              8px;
  --shadow:              0 2px 8px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  --color-bg:            #111827;
  --color-surface:       #1f2937;
  --color-text:          #f9fafb;
  --color-text-secondary:#9ca3af;
  --color-border:        #374151;
}

/* ---- Font ---- */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- Material Symbols ottimizzato ---- */
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  display: inline-block;
}

.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---- Scrollbar personalizzata ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.dark ::-webkit-scrollbar-thumb { background: #4b5563; }
.dark ::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* ---- Countdown ---- */
.countdown-timer {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.countdown-urgent {
  color: #ef4444;
  animation: pulse-red 1s ease-in-out infinite;
}

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

/* ---- Toast ---- */
#toast {
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
}
#toast.show {
  transform: translateY(0);
  opacity: 1;
}
#toast.toast-success { background: #166534; }
#toast.toast-error   { background: #991b1b; }
#toast.toast-info    { background: #1e40af; }

/* ---- Form focus rings ---- */
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* ---- Tabelle responsive ---- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- Card hover ---- */
.card-hover {
  transition: box-shadow 0.2s, transform 0.2s;
}
.card-hover:hover {
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* ---- Badge live ---- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ---- Skeleton loader ---- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
.dark .skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Paginazione ---- */
.pagination-btn {
  min-width: 36px;
  text-align: center;
}

/* ---- Toggle switch ---- */
.toggle-switch { position: relative; display: inline-flex; align-items: center; }

/* ---- Responsive navbar ---- */
@media (max-width: 640px) {
  .nav-mobile-hidden { display: none; }
}

/* ---- Optional badge (accessori veicolo) ---- */
.optional-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.4;
}
.dark .optional-badge {
  background: rgba(29, 78, 216, 0.15);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.25);
}

/* ---- Print ---- */
@media print {
  nav, footer, button, .no-print { display: none !important; }
  body { background: white; color: black; }
}
