/**
 * COMPONENTS.CSS
 * Stili componenti UI riutilizzabili
 */

/* ========================================
   APP CONTAINER
   ======================================== */
.app-container {
  max-width: 500px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 20px 40px rgb(0 0 0 / 0.1);
  overflow: hidden;
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   HEADER
   ======================================== */
.header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 24px 20px 20px;
  position: relative;
}

.header h1 {
  font-size: clamp(24px, 5vw, 28px);
  font-weight: 700;
  margin-bottom: 4px;
}

.header-subtitle {
  opacity: 0.9;
  font-size: 14px;
  font-weight: 500;
}

/* ========================================
   CONTENT
   ======================================== */
.content {
  padding: 24px 20px;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dark);
  font-size: 14px;
}

.form-label .material-icons {
  margin-right: 8px;
  font-size: 20px;
  color: var(--primary);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: var(--transition);
  background: white;
  font-weight: 500;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgb(59 130 246 / 0.1);
  transform: translateY(-1px);
}

/* ========================================
   DATE INPUT
   ======================================== */
.date-input-container {
  position: relative;
}

.date-input-container .form-control {
  padding-right: 48px;
}

.date-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 20px;
  pointer-events: none;
}

/* ========================================
   QUANTITA INPUT
   ======================================== */
.quantita-input {
  text-align: center;
  font-weight: 600;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  margin-bottom: 12px;
  gap: 8px;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-secondary {
  background: var(--light);
  color: var(--dark);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--light-gray);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn-add {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  margin-top: 12px;
  box-shadow: var(--shadow-md);
}

.btn-add:hover {
  background: linear-gradient(135deg, #059669, var(--success));
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  font-size: 20px;
}

.btn-icon:hover {
  background: #dc2626;
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.loading {
  text-align: center;
  padding: 60px 24px;
}

.spinner {
  border: 3px solid var(--light-gray);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

/* ========================================
   ALERT MESSAGES
   ======================================== */
.alert {
  padding: 16px;
  border-radius: var(--radius);
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.4s ease;
  font-weight: 500;
}

.alert-success {
  background: rgb(16 185 129 / 0.12);
  color: var(--success);
  border: 1px solid rgb(16 185 129 / 0.3);
}

.alert-error {
  background: rgb(239 68 68 / 0.12);
  color: var(--danger);
  border: 1px solid rgb(239 68 68 / 0.3);
}

/* ========================================
   MODAL SYSTEM CON ANIMAZIONI
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  
  /* ✨ Animazioni */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(0px);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  
  /* ✨ Animazioni */
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
              opacity 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Animazione chiusura */
.modal-overlay.closing {
  opacity: 0;
  backdrop-filter: blur(0px);
}

.modal-overlay.closing .modal-content {
  transform: scale(0.9) translateY(20px);
  opacity: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--light-gray);
  position: relative;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  color: var(--gray);
}

.modal-close:hover {
  background: var(--light);
  color: var(--dark);
  transform: rotate(90deg);
}

.modal-close .material-icons {
  font-size: 20px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--light-gray);
  justify-content: flex-end;
}

.modal-footer .btn {
  min-width: 100px;
}

/* ========================================
   BACKDROP CLICK TO CLOSE
   ======================================== */

.modal-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
}

/* ========================================
   STAT CARDS (Dashboard KPI) - V2
   ======================================== */

.stat-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--icon-color);
  transition: var(--transition);
  position: relative;
}

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

/* Header con icona */
.stat-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--icon-color);
  opacity: 0.12;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .material-icons {
  font-size: 24px;
  color: var(--icon-color);
  opacity: 1;
}

/* Content */
.stat-card-body {
  flex: 1;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1;
  display: block;
  margin-bottom: 8px;
}

/* Trend badge */
.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 8px;
}

.stat-trend .material-icons {
  font-size: 14px;
}

.stat-trend-success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
}

.stat-trend-danger {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

/* Responsive */
@media (max-width: 500px) {
  .stat-card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-value {
    font-size: 28px;
  }
  
  .stat-icon {
    width: 40px;
    height: 40px;
  }
}

/* Animation per aggiornamenti */
@keyframes pulseValue {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    color: var(--primary);
  }
}

.stat-value-updated {
  animation: pulseValue 0.5s ease;
}

/* ========================================
   NAVIGATION MENU
   ======================================== */

.main-nav {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border-bottom: 1px solid var(--light-gray);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--gray);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  flex: 1;
  text-align: center;
}

.nav-item:hover {
  background: var(--light);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-item .material-icons {
  font-size: 24px;
}

/* Mobile */
@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    padding: 8px 12px;
    border-top: 1px solid var(--light-gray);
    border-bottom: none;
  }

  .nav-item {
    padding: 8px;
    font-size: 11px;
  }

  .nav-item .material-icons {
    font-size: 20px;
  }

  .nav-item span:last-child {
    display: none; /* Nascondi testo su mobile */
  }
}

/* ========================================
   TRANSACTION CARDS (Storico)
   ======================================== */

.transaction-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-left: 4px solid var(--primary);
}

.transaction-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}

.transaction-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.transaction-product {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 1;
}

.transaction-icon {
  color: var(--primary);
  font-size: 24px;
}

.transaction-product-name {
  font-weight: 600;
  color: var(--dark);
  font-size: 15px;
  margin-bottom: 4px;
}

.transaction-market {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--gray);
}

.transaction-market .material-icons {
  font-size: 14px;
}

.transaction-time {
  font-size: 12px;
  color: var(--gray);
  white-space: nowrap;
}

.transaction-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--light-gray);
}

.transaction-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.transaction-quantity {
  font-size: 14px;
  color: var(--gray);
}

.transaction-badges {
  display: flex;
  gap: 6px;
}

.transaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.transaction-badge-discount {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.transaction-badge-note {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
}

.transaction-badge .material-icons {
  font-size: 14px;
}

.transaction-total {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}

.transaction-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--light);
}

.btn-icon:hover {
  transform: scale(1.05);
}

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

.btn-icon-view:hover {
  background: rgba(59, 130, 246, 0.12);
}

.btn-icon-delete {
  color: var(--danger);
}

.btn-icon-delete:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* Transaction Groups */
.transaction-group {
  margin-bottom: 32px;
}

.transaction-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--light-gray);
}

.transaction-group-header .material-icons {
  color: var(--primary);
  font-size: 20px;
}

.transaction-group-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
  flex: 1;
}

.transaction-group-count {
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.transaction-group-cards {
  display: flex;
  flex-direction: column;
}

/* ========================================
   TOAST MESSAGES
   ======================================== */

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: white;
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 500px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.info {
  border-left-color: var(--primary);
}

.toast .material-icons {
  font-size: 24px;
}

.toast.success .material-icons {
  color: var(--success);
}

.toast.error .material-icons {
  color: var(--danger);
}

.toast.warning .material-icons {
  color: var(--warning);
}

.toast.info .material-icons {
  color: var(--primary);
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--dark);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .toast-container {
    top: 20px;
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* Dettagli transazione modal */
.dettagli-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dettagli-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.dettagli-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  font-size: 14px;
}

.dettagli-label .material-icons {
  font-size: 18px;
}

.dettagli-value {
  font-size: 15px;
  color: var(--dark);
  font-weight: 500;
  text-align: right;
}

.dettagli-row.total {
  background: var(--light);
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.dettagli-row.total .dettagli-value {
  font-size: 20px;
  color: var(--primary);
}

.dettagli-row.discount .dettagli-value {
  color: var(--success);
}

.dettagli-row.notes {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.dettagli-row.notes .dettagli-value {
  text-align: left;
  font-style: italic;
  color: var(--gray);
}

.dettagli-separator {
  height: 1px;
  background: var(--light-gray);
  margin: 8px 0;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  background: var(--light);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray);
  margin-left: 8px;
}


/* Pulsante chiusura modal */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  color: var(--gray);
}

.modal-close:hover {
  background: var(--light);
  color: var(--dark);
}

.modal-close .material-icons {
  font-size: 20px;
}

/* ========================================
   DETTAGLI TRANSAZIONE
   ======================================== */

.dettagli-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dettagli-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--light);
  transition: background 0.2s ease;
}

.dettagli-row:hover {
  background: var(--light);
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: var(--radius-sm);
}

.dettagli-row:last-child {
  border-bottom: none;
}

.dettagli-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  font-size: 14px;
  font-weight: 500;
}

.dettagli-label .material-icons {
  font-size: 18px;
  color: var(--primary);
}

.dettagli-value {
  font-size: 15px;
  color: var(--dark);
  font-weight: 500;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dettagli-row.total {
  background: var(--light);
  padding: 20px 16px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  border: 2px solid var(--primary-light);
}

.dettagli-row.total .dettagli-label {
  font-size: 16px;
  color: var(--dark);
}

.dettagli-row.total .dettagli-value {
  font-size: 24px;
  color: var(--primary);
  font-weight: 700;
}

.dettagli-row.discount .dettagli-value {
  color: var(--success);
}

.dettagli-row.notes {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.dettagli-row.notes .dettagli-value {
  text-align: left;
  font-style: italic;
  color: var(--gray);
  font-weight: 400;
}

.dettagli-separator {
  height: 1px;
  background: var(--light-gray);
  margin: 12px 0;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* ========================================
   RIPPLE EFFECT BOTTONI
   ======================================== */

.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-danger::after {
  background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   SKELETON LOADERS
   ======================================== */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--light) 0%,
    #f0f0f0 50%,
    var(--light) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius-sm);
}

/* Skeleton per card transazioni */
.skeleton-transaction-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.skeleton-transaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.skeleton-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-text {
  height: 16px;
  border-radius: 4px;
}

.skeleton-text-sm {
  height: 12px;
  border-radius: 4px;
}

.skeleton-text-lg {
  height: 20px;
  border-radius: 4px;
}

.skeleton-transaction-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-transaction-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--light);
}

/* Skeleton per stat cards dashboard */
.skeleton-stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.skeleton-stat-value {
  height: 32px;
  width: 120px;
  margin-bottom: 8px;
}

.skeleton-stat-label {
  height: 14px;
  width: 80px;
}

/* Loading inline (per bottoni) */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  color: white;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Spinner migliorato */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

.spinner-modern {
  width: 40px;
  height: 40px;
  border: 3px solid var(--light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--light);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-bar-indeterminate {
  position: absolute;
  height: 100%;
  width: 30%;
  background: var(--primary);
  animation: progress-indeterminate 1.5s infinite;
}

@keyframes progress-indeterminate {
  0% {
    left: -30%;
  }
  100% {
    left: 100%;
  }
}

/* Progress bar globale (top della pagina) */
.global-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.global-progress-bar.active {
  opacity: 1;
}

.global-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--primary);
}

/* ========================================
   TOAST ANIMATIONS
   ======================================== */

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast {
  animation: slideInRight 0.3s ease;
}
