/* =========================================
   1. STRUTTURA BASE
   ========================================= */

/* Usiamo l'ID per lo stile base, ma ricordiamo che il JS agisce tramite classe */
#profilePictureContainer {
  overflow: visible !important;
  transition: transform 0.3s ease; /* Tolto box-shadow transition per evitare conflitti con JS inline */
}

#profilePicturePreview {
	width:102px!important;
	height:auto!important;
  display: block;
  position: relative;
  z-index: 1;
}

/* Overlay per le maschere */
/* .profile-mask-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    border-radius: 50%;
} */
/* ==========================================
   CONTAINER SCROLL FILTRI
   ========================================== */
#filtersScrollContainer {
  transition: min-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: min-height;
}

/* ==========================================
   DROPDOWN COMUNI (Bordo + Neon)
   ========================================== */
.imgProFil-color-picker-dropdown,
#neon-colorPickerDropdown {
  position: absolute;
  top: 35px;
  left: 0;

  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 12px;
  z-index: 1000;
  min-width: 200px;
  border: 1px solid #e0e0e0;

  /* STATO INIZIALE (Nascosto) */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.2s ease-out;

  display: block !important;
}

/* CLASSE ATTIVA PER MOSTRARE */
.imgProFil-color-picker-dropdown.is-open,
#neon-colorPickerDropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Freccina del dropdown */
.imgProFil-color-picker-dropdown::before,
#neon-colorPickerDropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 28px;
  width: 12px;
  height: 12px;
  background: white;
  border-left: 1px solid #e0e0e0;
  border-top: 1px solid #e0e0e0;
  transform: rotate(45deg);
}

/* ==========================================
   GRIGLIA PRESET COLORI
   ========================================== */
.imgProFil-color-preset-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.imgProFil-color-preset {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.imgProFil-color-preset:hover {
  transform: scale(1.1);
  border-color: #333;
}

.imgProFil-color-preset.active {
  border-color: #6822ff;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #6822ff;
}

/* ==========================================
   INPUT HEX
   ========================================== */
.imgProFil-color-hex-input-group {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.imgProFil-hex-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  text-transform: uppercase;
}

.imgProFil-hex-apply-btn {
  width: 32px;
  background: #6822ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.imgProFil-hex-apply-btn:hover {
  background: #5018dd;
}

/* ==========================================
   BOTTONE SELETTORE AVANZATO
   ========================================== */
.imgProFil-color-picker-advanced-btn {
  width: 100%;
  padding: 8px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.imgProFil-color-picker-advanced-btn:hover {
  background: #e8e8e8;
  border-color: #bbb;
}

.imgProFil-color-picker-advanced-btn svg {
  fill: #666;
}

/* ==========================================
   BOTTONE PALETTE (icona sopra il filtro)
   ========================================== */
.imgProFil-color-picker-btn {
  position: absolute;
  top: -5px;
  right: 0;
  width: 26px;
  height: 26px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 20;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: transform 0.2s;
}

.imgProFil-color-picker-btn:hover {
  background: #f8f9fa;
  transform: scale(1.1);
}

.imgProFil-color-picker-btn svg {
  display: block;
}

/* =========================================
   2. UI FILTRI & EFFETTI
   ========================================= */
.filters-scroll-container {
  display: flex;
  gap: 14px;
  overflow-y: hidden;
  padding: 15px 5px;
  cursor: grab;
  scrollbar-width: none;
  user-select: none;
  -webkit-user-select: none;
}
.filters-scroll-container::-webkit-scrollbar {
  display: none;
}
.filters-scroll-container:active {
  cursor: grabbing;
}

.filter-item {
  flex: 0 0 auto;
  width: 70px;
  text-align: center;
  cursor: pointer;
  position: relative;
}
.filter-thumb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 5px;
  border: 3px solid transparent;
  transition: transform 0.2s;
  background: #f0f0f0;
  overflow: hidden;
  position: relative;
}
.filter-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.filter-item.active .filter-thumb {
  transform: scale(1.1);
  border-color: #6822ff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}
.filter-name {
  font-size: 11px;
  font-weight: 600;
  color: #6c757d;
  margin-top: 3px;
}

.border-pro { box-shadow: 0 0 0 4px #FFD700!important; } /* Colore oro per distinzione */
.badge-ImageProfilePro {
position: absolute;
    z-index: 1;
    top: -5px;
    right: 4px;
    background: #FFD700;
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
/* Contenitore durante l'elaborazione */
.ai-scanning {
    position: relative;
    overflow: hidden;
    filter: grayscale(0.5); /* Scolorisce leggermente l'originale */
}

/* La linea dello scanner */
.ai-scanning::after {
    content: "";
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 45%,
        #00d9ff 50%, /* Colore linea scanner */
        rgba(0, 217, 255, 0.2) 55%,
        transparent 100%
    );
    animation: scanAnimation 2s ease-in-out infinite;
    z-index: 10;
}

/* Effetto pulsante sul contenitore */
.ai-scanning {
    animation: aiPulse 2s infinite;
}

@keyframes scanAnimation {
    0% { top: -100%; }
    100% { top: 100%; }
}

@keyframes aiPulse {
    0% { box-shadow: 0 0 0 0px rgba(0, 217, 255, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(0, 217, 255, 0); }
    100% { box-shadow: 0 0 0 0px rgba(0, 217, 255, 0); }
}
/*
.effect-open-work::after {
    content: "#OPENTOWORK";
    position: absolute;
    bottom: 3px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #0a66c2 0%, #004182 100%);
    color: white; font-size: 9px; font-weight: 700; padding: 3px 10px; border-radius: 12px;
    z-index: 10; white-space: nowrap; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(10, 102, 194, 0.4); pointer-events: none;
} */

/* PULSE */
.effect-pulse {
  animation: profile-pulse 2s infinite ease-in-out !important;
}
@keyframes profile-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* COLOR PICKER */
.color-picker-btn {
  position: absolute;
  top: -5px;
  right: 0;
  width: 26px;
  height: 26px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 20;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: transform 0.2s;
}
.color-picker-btn:hover {
  background: #f8f9fa;
  transform: scale(1.1);
}
.color-picker-btn svg {
  display: block;
}

/* MASCHERE PREVIEW */
.filter-thumb.mask-preview::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}
.filter-thumb.mask-preview.mask-1::after {
  background-image: url("/assets/img/profile-masks/mask-1-thumb.png");
}
.filter-thumb.mask-preview.mask-2::after {
  background-image: url("/assets/img/profile-masks/mask-2-thumb.png");
}
.filter-thumb.mask-preview.mask-3::after {
  background-image: url("/assets/img/profile-masks/mask-3-thumb.png");
}
.filter-thumb.mask-preview.mask-pet::after {
  background-image: url("/assets/img/profile-masks/mask-pet.png");
}

.filter-thumb.mask-preview.mask-eco::after {
  background-image: url("/assets/img/profile-masks/mask-eco.png");
}

.filter-thumb.mask-preview.mask-hiring::after {
  background-image: url("/assets/img/profile-masks/mask-hiring.png");
}

.filter-thumb.mask-preview.mask-cyber::after {
  background-image: url("/assets/img/profile-masks/mask-cyber.png");
}

/* RESPONSIVE */
@media (max-width: 576px) {
  .filter-item {
    width: 72px;
  }
  .filter-thumb {
    width: 60px;
    height: 60px;
  }
  .filter-name {
    font-size: 10px;
  }
}

/* --- EFFETTI PROFILO (Frontend) --- */

/* Base Container */
.profile-pic-container {
  position: relative;
  z-index: 1;
  overflow: visible !important; /* Fondamentale per badge e cornici esterne */
}

/* Base Immagine */
.profile-pic-img {
  position: relative;
  z-index: 2;
  transition: transform 0.3s;
}

/* 1. OPEN TO WORK */
.effect-open-work::after {
  position: relative;
  content: "#OPENTOWORK";
  bottom: 0px;
  background: linear-gradient(182deg, #ffffff 0%, #eeeeee 100%);
  color: #212121;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 12px;
  z-index: 10;
  white-space: nowrap;
  border: 2px solid #0a66c2;
  box-shadow: 0 2px 6px rgba(10, 102, 194, 0.4);
  pointer-events: none;
}

/* 2. PULSE */
.effect-pulse .profile-pic-img {
  animation: profile-pulse 2s infinite ease-in-out;
}
@keyframes profile-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 3. MASK OVERLAY */
.profile-mask-overlay {
  position: absolute!important;
  top: -5px!important;
  left: -7px!important;
  width: 118px!important;
  height: 118px!important;
  pointer-events: none!important;
  z-index: 5!important;
  background-size: cover!important;
  background-position: center!important;
  border-radius: 50%!important;
}
