/* ============================================================
   UTILITY & HELPER CLASSES
   ============================================================ */
.text-center { text-align: center; }
.text-light { color: var(--text-light) !important; }
.text-xs { font-size: 0.88rem; }
.text-sm { font-size: 0.95rem; }

/* ============================================================

/* ============================================================
   DESKTOP RESPONSIVE — SIDEBAR NAVIGATION (≥768px)
   ============================================================ */
@media (min-width: 768px) {
  .app-container {
    max-width: 100%;
    flex-direction: row;
    overflow: visible;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    z-index: 200;
    max-width: 100%;
    transform: none !important;
    -webkit-transform: none !important;
  }

  /* Override ALL base .bottom-nav properties */
  .bottom-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    margin: 0;
    width: 210px;
    max-width: 210px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 2px;
    padding: 80px 10px 24px;
    transform: none !important;
    -webkit-transform: none !important;
    border-top: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(8, 13, 25, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 150;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Nav items horizontal layout */
  .nav-item {
    flex-direction: row;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    flex: unset;
    justify-content: flex-start;
    align-items: center;
    transition: all 0.25s var(--ease);
  }

  .nav-item .nav-icon {
    transform: none !important;
  }

  .nav-item span:last-child {
    font-size: 0.88rem;
    font-weight: 600;
  }

  .nav-item.active {
    background: rgba(214, 25, 32, 0.1);
  }

  .nav-item.active .nav-icon {
    transform: none !important;
  }

  /* Left bar indicator instead of top pill */
  .nav-item.active::before {
    top: 50%;
    left: -10px;
    width: 3px;
    height: 55%;
    transform: translateY(-50%);
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    box-shadow: 0 0 10px rgba(214, 25, 32, 0.5);
    animation: none;
  }

  .nav-item.active::after {
    display: none;
  }

  .nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.04);
  }

  /* Badge inline */
  .notif-badge {
    position: static;
    transform: none;
    margin-left: auto;
  }

  @keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
  }

  /* Main content offset for sidebar */
  .app-view {
    margin-left: 210px;
    margin-top: 68px;
    padding: 24px 36px 32px;
    max-width: 100%;
  }

  /* Auth screen centered on desktop */
  .auth-screen {
    max-width: 500px;
    margin: 0 auto;
  }

  /* Wider dashboard grid on desktop */
  .dashboard-menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Stats grid responsive */
  .stats-strip {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .charts-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Profile: side-by-side accordion layout */
  #ref-section-profile .content-card {
    max-width: 100%;
  }

  /* Profile forms: 2-column layout on desktop */
  #form-profile-anagrafica,
  #form-profile-fatturazione {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }

  #form-profile-anagrafica .btn-primary,
  #form-profile-fatturazione .btn-primary,
  #form-profile-anagrafica .billing-toggle-wrap,
  #form-profile-fatturazione .billing-toggle-wrap,
  #form-profile-fatturazione .form-row,
  #form-profile-fatturazione #bill-citizen-fields,
  #form-profile-fatturazione #bill-business-fields,
  #form-profile-fatturazione input[type="hidden"] {
    grid-column: 1 / -1;
  }

  /* Inner billing fields also 2-column */
  #bill-citizen-fields,
  #bill-business-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }

  #bill-citizen-fields .btn-primary {
    grid-column: 1 / -1;
  }

  /* Referral cards in 2 columns on desktop */
  .referral-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Agent cards: max 5 per row on desktop */
  #agent-cards-container {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

/* Agent cards: max 3 per row on mobile */
#agent-cards-container {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* ============================================================
   MOBILE RESPONSIVE â€” PRIZE CARDS (<768px)
   ============================================================ */
@media (max-width: 767px) {
  .prize-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-areas: 
      "image details"
      "action details";
    align-items: start;
    gap: 12px 16px;
    padding: 14px;
  }
  
  .prize-card .prize-image {
    grid-area: image;
    width: 80px;
    height: 80px;
    margin-bottom: 0;
  }
  
  .prize-card .prize-details {
    grid-area: details;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    margin-top: 0;
  }

  .prize-card .prize-title {
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  .prize-card .prize-desc {
    font-size: 0.82rem;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-light);
  }

  .prize-card .prize-cost {
    font-size: 0.85rem;
    margin-top: auto;
  }
  
  .prize-card .btn-redeem {
    grid-area: action;
    width: 80px;
    padding: 6px 0;
    font-size: 0.82rem;
    text-align: center;
    border-radius: 6px;
    display: block;
    align-self: start;
  }

  .shop-filters {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .stat-box {
    padding: 12px 8px;
  }
}

/* p79:engine-build:rc4-TRCPLA79S10D705Y */
[data-p79]::after {
  content: 'p79-TRCPLA79S10D705Y-cP';
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  font-size: 0;
}

/* Autocomplete Dropdown */
.autocomplete-items {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99;
  background-color: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.1);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  margin-top: 2px;
}
.autocomplete-items div {
  padding: 12px 16px;
  cursor: pointer;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.9rem;
}
.autocomplete-items div:hover {
  background-color: rgba(255,255,255,0.05);
}
.autocomplete-items div:last-child {
  border-bottom: none;
}

/* ============================================================
   MOBILE PERFORMANCE — Disabilita animazioni cosmetiche pesanti
   Manteniamo: header shine (navbar) + card shine (punti)
   ============================================================ */
@media (max-width: 768px) {
  /* Aurora background blobs — pesantissime su mobile */
  .app-container::before,
  .app-container::after {
    animation: none !important;
  }

  /* Points card: holo shift (pesante, gradiente animato) */
  .points-summary-card::before {
    animation: none !important;
    display: none;
  }

  /* Menu card shine sweep */
  .menu-card::after {
    animation: none !important;
    display: none;
  }

  /* Icon glow pulsing (4 animazioni box-shadow simultanee) */
  .menu-card-icon {
    animation: none !important;
  }

  /* Badge pulse */
  .notif-badge {
    animation: none !important;
  }

  /* Orphan pulse, pill glow, progress glow, dot pulse */
  .orphan-indicator,
  .referral-pill,
  .progress-fill::after,
  .online-dot {
    animation: none !important;
  }
}

/* Per chi ha impostato "Riduci animazioni" nel sistema operativo */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
