/**
 * Sandbox Fase 2 — tamburo profili nel core (send-glass-core.php).
 * ROLLBACK CSS: public/css/sk-glass-profile-core.rollback-pre-lens.css
 */

/* In attesa preflight / Fase 2: mai flash overlay Slimma */
.sk-hub-stage.sk-hub--glass-pending .sk-hub-start-overlay,
.sk-hub-stage.sk-hub--glass-analyzing .sk-hub-start-overlay,
.sk-hub-stage.sk-hub--glass-profile .sk-hub-start-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.sk-hub-stage.sk-hub--glass-pending #dropzone.sk-hub-core,
.sk-hub-stage.sk-hub--glass-analyzing #dropzone.sk-hub-core,
.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core {
  pointer-events: auto;
  cursor: grab !important;
  justify-content: center;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  backdrop-filter: blur(25px) saturate(180%);
  background: rgba(8, 12, 21, 0.45);
  overflow: hidden;
}

.sk-hub-stage.sk-hub--glass-pending #dropzone.sk-hub-core *,
.sk-hub-stage.sk-hub--glass-analyzing #dropzone.sk-hub-core *,
.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core * {
  -webkit-user-select: none;
  user-select: none;
}

.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core:active,
.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core.sk-hub-core--glass-dragging {
  cursor: grabbing !important;
}

/* Figli decorativi: non ereditare grab su overlay interni */
.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core .sk-glass-profile-layer,
.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core .sk-glass-analyzing,
.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core #hub-logo,
.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core .sk-glass-chevrons {
  cursor: inherit;
}

.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%, rgba(0, 0, 0, 0.35) 100%);
}

.sk-hub-stage.sk-hub--glass-profile #hub-logo,
.sk-hub-stage.sk-hub--glass-profile #hub-meta,
.sk-hub-stage.sk-hub--glass-profile #hub-hint,
.sk-hub-stage.sk-hub--glass-profile #hub-status,
.sk-hub-stage.sk-hub--glass-profile #hub-result,
.sk-hub-stage.sk-hub--glass-profile #hub-error,
.sk-hub-stage.sk-hub--glass-profile #hub-sniff-notice,
.sk-hub-stage.sk-hub--glass-profile #hub-timer {
  pointer-events: none;
}

/* Logo S: sempre centrato nel cerchio (come Slimma / timer), mai in flex che lo sposta in basso */
.sk-hub-stage.sk-hub--glass-pending #hub-logo.sk-hub-logo--mark,
.sk-hub-stage.sk-hub--glass-profile #hub-logo.sk-hub-logo--mark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: block;
  width: min(160px, 64vw);
  max-width: 64%;
  height: auto;
  margin: 0;
  opacity: 0.28;
  transform: translate3d(-50%, -50%, 0) scale(0.88);
  flex-shrink: 0;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Upload/processing: stesso watermark centrale di send.php (override .sk-hub-logo--dim) */
.sk-hub-core.sk-hub-core--timer-active .sk-hub-logo,
.sk-hub-core.sk-hub-core--timer-active .sk-hub-logo.sk-hub-logo--mark,
.sk-hub-core.sk-hub-core--timer-active .sk-hub-logo.sk-hub-logo--dim {
  position: absolute;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  margin: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.88);
  z-index: 1;
  max-width: 58%;
  width: min(140px, 58vw);
  height: auto;
  pointer-events: none;
}

.sk-hub-stage.sk-hub--glass-profile #hub-hint,
.sk-hub-stage.sk-hub--glass-analyzing #hub-hint {
  display: none !important;
}

.sk-hub-stage.sk-hub--glass-analyzing #dropzone.sk-hub-core {
  --sk-timer-fs: clamp(1.45rem, 6.5vw, 2.45rem);
  cursor: default;
}

.sk-hub-stage.sk-hub--glass-analyzing #sk-glass-profile-layer {
  visibility: hidden !important;
}

/* «Analizzo» fisso + punti animati (. → .. → ...) */
.sk-glass-analyzing {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  border-radius: 50%;
}

.sk-glass-analyzing__label {
  margin: 0;
  max-width: 92%;
  text-align: center;
  white-space: nowrap;
  font-size: calc(var(--sk-timer-fs, clamp(1.45rem, 6.5vw, 2.45rem)) * 0.8);
  text-transform: none;
}

.sk-glass-analyzing__word {
  display: inline;
}

.sk-glass-analyzing__dots {
  display: inline;
  white-space: nowrap;
}

.sk-glass-analyzing__dot {
  display: inline;
}

.sk-glass-analyzing__dot:nth-child(1) {
  opacity: 1;
}

.sk-glass-analyzing__dot:nth-child(2) {
  opacity: 0;
  animation: sk-glass-analyzing-dot-2 1.35s steps(1, end) infinite;
}

.sk-glass-analyzing__dot:nth-child(3) {
  opacity: 0;
  animation: sk-glass-analyzing-dot-3 1.35s steps(1, end) infinite;
}

@keyframes sk-glass-analyzing-dot-2 {
  0%,
  33.333% {
    opacity: 0;
  }
  33.334%,
  100% {
    opacity: 1;
  }
}

@keyframes sk-glass-analyzing-dot-3 {
  0%,
  66.666% {
    opacity: 0;
  }
  66.667%,
  100% {
    opacity: 1;
  }
}

.sk-glass-profile-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* START: Chevron Affordance — ROLLBACK: public/css/sk-glass-profile-core.rollback-pre-chevron.css */
.sk-hub-stage.sk-hub--glass-profile .sk-glass-chevrons {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  border-radius: 50%;
}

.sk-hub-stage.sk-hub--glass-profile .sk-glass-chevron {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00e5ff;
  opacity: 0.32;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
  transition: opacity 0.35s ease;
  will-change: transform, opacity;
}

.sk-hub-stage.sk-hub--glass-profile .sk-glass-chevron__icon {
  display: block;
}

.sk-hub-stage.sk-hub--glass-profile .sk-chevron-top {
  top: 10%;
  animation: sk-glass-chevron-molleggio-top 1.2s infinite alternate ease-in-out;
}

.sk-hub-stage.sk-hub--glass-profile .sk-chevron-bottom {
  bottom: 10%;
  animation: sk-glass-chevron-molleggio-bottom 1.2s infinite alternate ease-in-out;
}

@keyframes sk-glass-chevron-molleggio-top {
  from {
    transform: translateX(-50%) translateY(0);
  }
  to {
    transform: translateX(-50%) translateY(-6px);
  }
}

@keyframes sk-glass-chevron-molleggio-bottom {
  from {
    transform: translateX(-50%) translateY(0);
  }
  to {
    transform: translateX(-50%) translateY(6px);
  }
}

.sk-hub-stage.sk-hub--glass-profile #dropzone.sk-hub-core:hover .sk-glass-chevron {
  opacity: 0.45;
}
/* END: Chevron Affordance */

.sk-glass-selection-viewport {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* ROLLBACK: perspective: 600px; */
  perspective: 520px;
  perspective-origin: 50% 50%;
  pointer-events: none;
  overflow: hidden;
  border-radius: 50%;
  /* Maschera verticale: le voci entrano/escono dal bordo vetro (rotazione percepita completa) */
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 8%,
    #000 20%,
    #000 80%,
    rgba(0, 0, 0, 0.35) 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 8%,
    #000 20%,
    #000 80%,
    rgba(0, 0, 0, 0.35) 92%,
    transparent 100%
  );
}

.sk-glass-profile-cylinder {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  will-change: transform;
  pointer-events: none;
}

.sk-glass-profile-item {
  position: absolute;
  width: 100%;
  text-align: center;
  font-family: var(--sk-font-mono, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
  font-size: clamp(0.85rem, 3.8vw, 1.5rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.15);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform, opacity, filter;
  pointer-events: none;
  user-select: none;
  /* ROLLBACK: transition: color 1s ease, text-shadow 1s ease; */
  transition:
    color 1s ease,
    text-shadow 1s ease,
    filter 0.28s ease,
    opacity 0.28s ease;
}

/* Stesso neon di «Analizzo…» / testi hub in coda */
.sk-glass-profile-item.is-active {
  color: #00e5ff;
  text-shadow:
    0 0 8px rgba(0, 229, 255, 0.9),
    0 0 18px rgba(0, 229, 255, 0.55);
}

.sk-send-glass-hint-below {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: #64748b;
  text-align: center;
  line-height: 1.45;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

/* Profilo Personalizzato: invita ad aprire Avanzate Pro per le opzioni */
.sk-send-pro-below-hub.sk-pro-entry--custom-hint {
  z-index: 14;
}

.sk-send-pro-below-hub .sk-btn-pro-open.sk-btn-pro-open--custom-hint {
  position: relative;
  z-index: 1;
  border-color: rgba(46, 230, 166, 0.75);
  color: #e8fff4;
  animation: sk-pro-custom-hint-btn 2.4s ease-in-out infinite;
}

.sk-send-pro-below-hub .sk-btn-pro-open.sk-btn-pro-open--custom-hint::before {
  content: '';
  position: absolute;
  inset: -10px -14px;
  border-radius: 999px;
  z-index: -1;
  pointer-events: none;
  animation: sk-pro-custom-hint-aura 2.4s ease-in-out infinite;
}

@keyframes sk-pro-custom-hint-btn {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(46, 230, 166, 0.25);
  }
  50% {
    box-shadow:
      0 0 22px rgba(46, 230, 166, 0.55),
      0 0 36px rgba(46, 230, 166, 0.22);
  }
}

@keyframes sk-pro-custom-hint-aura {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sk-glass-profile-cylinder {
    transition: none !important;
  }
  .sk-glass-analyzing__dot:nth-child(2),
  .sk-glass-analyzing__dot:nth-child(3) {
    animation: none;
    opacity: 1;
  }
  .sk-hub-stage.sk-hub--glass-profile .sk-chevron-top,
  .sk-hub-stage.sk-hub--glass-profile .sk-chevron-bottom {
    animation: none !important;
    transform: translateX(-50%) translateY(0);
  }
  .sk-send-pro-below-hub .sk-btn-pro-open.sk-btn-pro-open--custom-hint,
  .sk-send-pro-below-hub .sk-btn-pro-open.sk-btn-pro-open--custom-hint::before {
    animation: none;
  }
  .sk-send-pro-below-hub .sk-btn-pro-open.sk-btn-pro-open--custom-hint {
    box-shadow: 0 0 16px rgba(46, 230, 166, 0.45);
    border-color: rgba(46, 230, 166, 0.8);
  }
}
