/* ============================================================
   Leditaly Configuratore LED — Custom CSS
   (TailwindCSS gestisce la maggior parte dello stile)
   ============================================================ */

/* ── Transizioni step ──────────────────────────────────────────────────── */
.led-step-enter {
  position: absolute;
  top: 0; left: 0; right: 0;
  transform: translateX(100%);
  opacity: 0;
}
.led-step-active {
  position: relative;
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity   0.42s ease;
}
.led-step-exit {
  position: absolute;
  top: 0; left: 0; right: 0;
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity   0.42s ease;
  pointer-events: none;
}
.led-step-enter-back {
  position: absolute;
  top: 0; left: 0; right: 0;
  transform: translateX(-100%);
  opacity: 0;
}
.led-step-exit-back {
  position: absolute;
  top: 0; left: 0; right: 0;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity   0.42s ease;
  pointer-events: none;
}

/* ── Spinner ───────────────────────────────────────────────────────────── */
.led-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f4f6;
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: led-spin 0.7s linear infinite;
}
@keyframes led-spin {
  to { transform: rotate(360deg); }
}

/* ── Card selezione ────────────────────────────────────────────────────── */
.led-option-card {
  cursor: pointer;
  border-radius: 1rem;
  border: 2px solid #e5e7eb;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background-color 0.2s;
  position: relative;
  overflow: hidden;
  background: white;
}
.led-option-card:hover {
  border-color: #fbbf24;
  box-shadow: 0 4px 20px rgba(251,191,36,0.15);
  transform: translateY(-2px);
}
.led-option-card.selected {
  border-color: #f59e0b;
  background-color: #fffbeb;
  box-shadow: 0 4px 20px rgba(245,158,11,0.2);
  animation: led-select-pulse 0.3s ease;
}
.led-option-card.selected::after {
  content: '';
  position: absolute;
  top: 10px; right: 10px;
  width: 20px; height: 20px;
  background: #f59e0b url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E") center/12px no-repeat;
  border-radius: 50%;
}
@keyframes led-select-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ── Card categoria (step 0 — più grandi) ─────────────────────────────── */
.led-category-card {
  cursor: pointer;
  border-radius: 1.25rem;
  border: 2px solid #e5e7eb;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.25s ease;
  background: white;
  position: relative;
  overflow: hidden;
}
.led-category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fef3c7 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.led-category-card:hover::before { opacity: 1; }
.led-category-card:hover {
  border-color: #fbbf24;
  box-shadow: 0 8px 30px rgba(251,191,36,0.2);
  transform: translateY(-4px);
}
.led-category-card.selected {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb, #fff);
  box-shadow: 0 8px 30px rgba(245,158,11,0.25);
}
.led-category-card.selected::before { opacity: 1; }

/* ── Temperatura colore ────────────────────────────────────────────────── */
.led-tcc-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: block;
  margin: 0 auto 8px;
}

/* ── Sidebar item ──────────────────────────────────────────────────────── */
.led-sidebar-item {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: white;
  border: 1px solid #f3f4f6;
  animation: led-slide-in 0.25s ease;
}
@keyframes led-slide-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Result card ───────────────────────────────────────────────────────── */
.led-result-card {
  background: linear-gradient(135deg, #fff 0%, #fffbeb 100%);
  border: 2px solid #fcd34d;
  border-radius: 1.5rem;
  padding: 2rem;
  animation: led-result-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes led-result-appear {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Progress step dots ────────────────────────────────────────────────── */
.led-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b5563;
  transition: all 0.3s;
  flex-shrink: 0;
}
.led-progress-dot.active {
  background: #f59e0b;
  width: 24px;
  border-radius: 4px;
}
.led-progress-dot.done {
  background: #fcd34d;
}

/* ── Tensione toggle ───────────────────────────────────────────────────── */
.led-voltage-btn {
  flex: 1;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 2px solid #e5e7eb;
  font-weight: 700;
  font-size: 1.5rem;
  transition: all 0.2s;
  cursor: pointer;
  background: white;
}
.led-voltage-btn:hover { border-color: #fbbf24; }
.led-voltage-btn.selected {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #d97706;
  box-shadow: 0 4px 16px rgba(245,158,11,0.2);
}

/* ── IP badge ──────────────────────────────────────────────────────────── */
.led-ip-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
}

/* ── Responsività base ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .led-category-card { padding: 1.25rem 1rem; }
}

/* ── Product Drawer ─────────────────────────────────────── */
.leditaly-product-drawer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1),
                opacity    0.35s ease;
}
.leditaly-product-drawer.drawer-open {
    max-height: 2000px;
    opacity: 1;
}
.leditaly-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}
.leditaly-drawer-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    max-height: 440px;
    overflow-y: auto;
}
.leditaly-product-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.leditaly-product-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(245,158,11,0.15);
    background: #fffbeb;
}
.leditaly-product-thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    background: #f3f4f6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #d1d5db;
}
.leditaly-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.leditaly-product-info {
    flex: 1;
    min-width: 0;
}
.leditaly-product-code {
    display: block;
    font-family: ui-monospace, 'Courier New', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.leditaly-product-desc {
    display: block;
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.leditaly-product-badges {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}
.badge-tensione {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: #dbeafe;
    color: #1d4ed8;
}
.badge-ip {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: #dcfce7;
    color: #166534;
}
.leditaly-product-arrow {
    flex-shrink: 0;
    color: #d1d5db;
    font-size: 1rem;
    transition: color 0.2s, transform 0.2s;
}
.leditaly-product-card:hover .leditaly-product-arrow {
    color: #f59e0b;
    transform: translateX(3px);
}
.leditaly-drawer-msg {
    padding: 2rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}
