@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@300..700&family=Quicksand:wght@300..700&display=swap');

:root {
  --profile-bg: #dcdcdc;
  --profile-color: #1a1a1a;
  --profile-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --profile-accent: #007aff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Rimuove frecce dai campi numero */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

html {
  overflow-y: scroll; /* Forza la presenza della barra di serie per evitare salti */
}

body {
  font-family: var(--profile-font);
  background-color: var(--profile-bg);
  color: var(--profile-color);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 3s ease; /* Transizione fluida */
  display: flex;
  flex-direction: column;
}

/* Card Decorative di Sfondo (Login/Profile Background) */
.bg-card {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 26px;
    overflow: hidden;
    will-change: transform;
    pointer-events: none;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg-color, rgba(255, 255, 255, 0.4));
}

/* ==========================================
   0. LIVE CARDS (Followed Users)
   ========================================== */
/* --- ISOLAMENTO DESKTOP ESCLUSIVO PER LE STORIE --- */
@media (min-width: 769px) {
    .followed-lives-container {
        width: 95% !important;
        max-width: 1620px !important;
        max-height: none !important;
        margin: 0 auto 20px auto !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 1000 !important;
    }

    .followed-lives-container .lives-scroll-wrapper {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        max-height: none !important;
    }

    .followed-lives-container .lives-list {
        display: flex !important;
        flex-direction: row !important;
        gap: 15px !important;
        min-height: 80px !important;
    }
}

body.world-view .followed-lives-container {
    display: none !important;
}

.lives-scroll-wrapper {
    overflow-x: auto;
    display: flex;
    padding: 5px 15px;
    scrollbar-width: none; /* Firefox */
}

.lives-scroll-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.lives-list {
    display: flex;
    gap: 15px;
    align-items: center;
    min-height: 80px;
    margin: 0 auto;
}

.live-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.live-card-item {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: white;
    border: 2px solid #007aff;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: transform 0.2s ease;
}

.live-card-item.new-content {
    border: none;
    background: linear-gradient(135deg, #ff9500, #ff2d55, #af52de, #007aff, #34c759);
    background-size: 300% 300%;
    animation: multicolor-bg-shift 4s infinite alternate linear;
}

@keyframes multicolor-bg-shift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Card Decorative di Sfondo (Login/Profile Background) */
.bg-card {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 26px;
    overflow: hidden;
    will-change: transform;
    pointer-events: none;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--bg-color, rgba(255, 255, 255, 0.4));
}

.live-card-avatar-centered {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    border: 2px solid white;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 10;
    background-color: #f2f2f7;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.live-card-username-under {
    font-size: 0.75rem;
    color: #1c1c1e;
    font-weight: 700;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.live-card-msg-preview {
    font-size: 0.65rem;
    padding: 8px;
    text-align: center;
    line-height: 1.2;
    font-weight: 800;
    color: #1c1c1e;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes multicolor-border {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Modal Viewer Live */
.live-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.2); /* Oscuramento molto leggero */
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px); /* Offuscamento leggero */
    -webkit-backdrop-filter: blur(5px);
}

.live-viewer-content {
    width: 95%;
    max-width: 90vh; /* Quadrata e proporzionata all'altezza dello schermo per estendersi al massimo */
    aspect-ratio: 1 / 1; /* Torna alla forma quadrata richiesta */
    background: #1c1c1e;
    border-radius: 32px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 120px rgba(0,0,0,0.6);
}

@media (max-width: 768px) {
    .live-viewer-content {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        aspect-ratio: auto !important;
    }
}

.live-viewer-header {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Allineato in alto a sinistra */
    gap: 12px;
    z-index: 10;
    background: transparent;
    color: white;
}

.live-viewer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid white;
}

.live-viewer-progress-container {
    position: absolute;
    top: 5px;
    left: 0;
    width: 100%;
    padding: 0 10px;
    display: flex;
    gap: 4px;
    z-index: 20;
}

.live-progress-bar {
    height: 2px;
    flex: 1;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.live-progress-fill {
    height: 100%;
    background: white;
    width: 0%;
}

.live-viewer-body {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.live-viewer-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-viewer-text-overlay {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    z-index: 10;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    box-sizing: border-box;
}

.live-viewer-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 30;
}

.live-card-item:hover {
    transform: scale(1.05);
}

.live-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-card-placeholder {
    font-size: 1.5rem;
}

.live-card-username {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 0.65rem;
    padding: 2px 4px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.live-card-avatar-mini {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid white;
    background-size: cover;
    background-position: center;
    z-index: 2;
}

/* ==========================================
   1. HEADER & NAVIGAZIONE
   ========================================== */
.logo-text-animated {
  fill: #007aff; /* Fallback */
  animation: logoMulticolor 8s infinite linear;
}

/* Badge Verificato (Frammento Multicolor) */
.verified-badge {
  display: inline-block;
  width: 35px;
  height: 35px;
  vertical-align: middle;
  margin-left: 0.5px; /* Ridotto da 8px */
  position: relative;
  transform: translateY(-3px);
}

.verified-badge svg {
  width: 100%;
  height: 100%;
}

.verified-fragment-1 { fill: #ff9500; animation: logoMulticolor 8s infinite linear; }
.verified-fragment-2 { fill: #007aff; animation: logoMulticolor 8s infinite linear -1s; }
.verified-fragment-3 { fill: #34c759; animation: logoMulticolor 8s infinite linear -2s; }

/* Classe universale per il logo dei frammenti cangiante (usata per ADS) */
.fragment-logo-animated path:nth-child(1) { animation: logoMulticolor 8s infinite linear; }
.fragment-logo-animated path:nth-child(2) { animation: logoMulticolor 8s infinite linear -1s; }
.fragment-logo-animated path:nth-child(3) { animation: logoMulticolor 8s infinite linear -2s; }

.ad-indicator, .world-ad-indicator {
  display: inline-block;
  vertical-align: middle;
}

@keyframes fragment-shimmer {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.3) drop-shadow(0 0 3px #007aff); transform: scale(1.08); }
}

/* Classe per far pulsare i frammenti del logo in modo uniforme */
.logo-pulsing g:first-of-type {
  animation: fragment-shimmer 3s infinite ease-in-out;
  transform-origin: center;
  transform-box: fill-box;
  will-change: transform, filter;
}

/* Delay sfalsati per effetto lettera per lettera - Generico per ogni tspan animato */
tspan.logo-text-animated:nth-child(1)  { animation-delay: -0.0s; }
tspan.logo-text-animated:nth-child(2)  { animation-delay: -0.5s; }
tspan.logo-text-animated:nth-child(3)  { animation-delay: -1.0s; }
tspan.logo-text-animated:nth-child(4)  { animation-delay: -1.5s; }
tspan.logo-text-animated:nth-child(5)  { animation-delay: -2.0s; }
tspan.logo-text-animated:nth-child(6)  { animation-delay: -2.5s; }
tspan.logo-text-animated:nth-child(7)  { animation-delay: -3.0s; }
tspan.logo-text-animated:nth-child(8)  { animation-delay: -3.5s; }
tspan.logo-text-animated:nth-child(9)  { animation-delay: -4.0s; }
tspan.logo-text-animated:nth-child(10) { animation-delay: -4.5s; }
tspan.logo-text-animated:nth-child(11) { animation-delay: -5.0s; }
tspan.logo-text-animated:nth-child(12) { animation-delay: -5.5s; }

/* Animazione per i percorsi (paths) del logo o icone */
.path-animated:nth-child(1) { animation: logoMulticolor 8s infinite linear; }
.path-animated:nth-child(2) { animation: logoMulticolor 8s infinite linear -1.5s; }
.path-animated:nth-child(3) { animation: logoMulticolor 8s infinite linear -3s; }
.path-animated:nth-child(4) { animation: logoMulticolor 8s infinite linear -4.5s; }

/* Spinner Multicolor */
.loader-multicolor {
  width: 30px;
  height: 30px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ff9500;
  border-radius: 50%;
  animation: spin 1s linear infinite, loaderColorChange 4s linear infinite;
  margin: 0 auto 15px auto;
  display: block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes loaderColorChange {
  0%   { border-top-color: #ff9500; }
  12%  { border-top-color: #007aff; }
  25%  { border-top-color: #34c759; }
  37%  { border-top-color: #ff2d55; }
  50%  { border-top-color: #5856d6; }
  62%  { border-top-color: #ffcc00; }
  75%  { border-top-color: #5ac8fa; }
  87%  { border-top-color: #af52de; }
  100% { border-top-color: #ff9500; }
}

@keyframes logoMulticolor {
  0%   { fill: #ff9500; } /* Arancione */
  12%  { fill: #007aff; } /* Blu */
  25%  { fill: #34c759; } /* Verde */
  37%  { fill: #ff2d55; } /* Rosa */
  50%  { fill: #5856d6; } /* Viola */
  62%  { fill: #ffcc00; } /* Giallo */
  75%  { fill: #5ac8fa; } /* Azzurro */
  87%  { fill: #af52de; } /* Lilla */
  100% { fill: #ff9500; }
}

@keyframes buttonMulticolor {
  0%   { background-color: #ff9500; }
  12%  { background-color: #007aff; }
  25%  { background-color: #34c759; }
  37%  { background-color: #ff2d55; }
  50%  { background-color: #5856d6; }
  62%  { background-color: #ffcc00; } /* Giallo */
  75%  { background-color: #5ac8fa; } /* Azzurro */
  87%  { background-color: #af52de; } /* Lilla */
  100% { background-color: #ff9500; }
}

@keyframes backgroundSoftMulticolor {
  0%   { background-color: #ffecd2; } /* Arancione tenue */
  12%  { background-color: #d4eaff; } /* Blu tenue */
  25%  { background-color: #dbffe3; } /* Verde tenue */
  37%  { background-color: #ffe3ec; } /* Rosa tenue */
  50%  { background-color: #e9e9ff; } /* Viola tenue */
  62%  { background-color: #fffbc7; } /* Giallo tenue */
  75%  { background-color: #dff8ff; } /* Azzurro tenue */
  87%  { background-color: #f4e8ff; } /* Lilla tenue */
  100% { background-color: #ffecd2; }
}

/* Splash Screen / Initial Loader */
#initial-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000000; /* Alzato per coprire ogni elemento (menu, banner, ecc.) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: backgroundSoftMulticolor 10s infinite linear;
  transition: opacity 0.8s ease, visibility 0.8s;
  background-color: #fff5e6; /* Fallback iniziale */
}

#initial-loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-logo {
  transform: scale(1.2);
}

.loader-fragment-1 { fill: #ff9500; animation: logoMulticolor 8s infinite linear; }
.loader-fragment-2 { fill: #007aff; animation: logoMulticolor 8s infinite linear -1s; }
.loader-fragment-3 { fill: #34c759; animation: logoMulticolor 8s infinite linear -2s; }

.loader-footer {
  padding-bottom: 40px;
  color: #8e8e93;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(1.2); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}


/* Testi accentati basati sul tema */
.profile-accent-text {
  color: var(--accent-color, inherit) !important;
  transition: color 0.3s ease;
}

body.has-accent-gradient .profile-accent-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  z-index: 2000;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1) !important;
  color: #000000 !important;
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 0; /* Avvicinato al massimo */
    flex: 1;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-center-actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
    gap: 15px; /* Spaziatura uniforme tra gli elementi centrali */
}

.header-settings, #load-settings {
    display: none !important;
}

.world-nav-container, .notifications-container {
    flex-shrink: 0;
}

.search-container {
    display: none !important;
    flex: 0 0 auto;
    width: 380px;
    max-width: 400px;
}

body.world-view .search-container.auth-item {
    display: flex !important;
}

.header-right-actions {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Mondo 3D Rotante */
.world-sphere-container {
    width: 45px;
    height: 45px;
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.world-sphere {
    width: 30px;
    height: 30px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate3D 8s infinite linear;
}

.sphere-fragment {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
}

.fragment-1 { transform: rotateY(0deg); border-color: #ff9500; animation: glow-1 4s infinite; }
.fragment-2 { transform: rotateY(60deg); border-color: #007aff; animation: glow-2 4s infinite; }
.fragment-3 { transform: rotateY(120deg); border-color: #34c759; animation: glow-3 4s infinite; }
.fragment-4 { transform: rotateX(90deg); border-color: #ff2d55; }
.fragment-5 { transform: rotateX(45deg); border-color: #5856d6; }
.fragment-6 { border: 1px solid rgba(0,122,255,0.2); background: radial-gradient(circle, rgba(0,122,255,0.1) 0%, transparent 70%); }

@keyframes rotate3D {
    0% { transform: rotateY(0deg) rotateX(10deg); }
    100% { transform: rotateY(360deg) rotateX(10deg); }
}

@keyframes glow-1 { 0%, 100% { border-color: #ff9500; box-shadow: 0 0 5px #ff9500; } 50% { border-color: #ffcc00; } }
@keyframes glow-2 { 0%, 100% { border-color: #007aff; box-shadow: 0 0 5px #007aff; } 50% { border-color: #5ac8fa; } }
@keyframes glow-3 { 0%, 100% { border-color: #34c759; box-shadow: 0 0 5px #34c759; } 50% { border-color: #30d158; } }

@media (max-width: 768px) {
    /* RIMOSSO - SPOSTATO IN Mobile.css */
}

.rotating-world {
  display: none;
}

.site-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #1c1c1e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.main-nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 30px;
  padding: 0;
  margin: 0;
}

.main-nav li {
  display: flex;
  align-items: center;
}

.main-nav a {
  color: #1c1c1e !important; /* Forza scuro su testata chiara */
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.4px;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
}

#load-profile {
  font-size: 1.5rem; /* Icona leggermente più grande per visibilità */
  background: none;
  border: none;
  cursor: pointer;
  color: #1c1c1e;
  transition: opacity 0.2s ease;
}

#lock-toggle:hover {
  opacity: 0.6;
}

.main-nav a:hover {
  opacity: 0.6;
}

.search-container {
  display: flex;
  align-items: center;
  background: #f2f2f7;
  border-radius: 10px;
  padding: 4px 12px;
  height: 32px; /* Altezza fissa per allineamento perfetto */
  position: relative;
}

.search-results-popup {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin-top: 5px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}

.search-result-item {
  padding: 8px 15px;
  font-size: 0.85rem;
  color: #1a1a1a;
  cursor: pointer;
  border-bottom: 0.5px solid #f2f2f7;
  transition: background 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #f2f2f7;
}

.search-container input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  width: 180px;
  color: #000;
  line-height: 1.2;
}

.main-nav a::after {
  display: none; /* Rimosso l'effetto sottolineatura precedente */
}

.header-glass-btn {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #1c1c1e !important;
  text-decoration: none;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.header-glass-btn:hover {
  opacity: 0.6;
}

.header-settings {
  display: flex;
  align-items: center;
  gap: 20px;
}

#lock-toggle {
  display: none !important;
}

#lock-toggle.unlocked {
  color: #34c759; /* Verde premium per lo stato sbloccato */
}

/* Gestione visibilità in base alla modalità modifica */
body.edit-mode .box-slot {
  cursor: move;
  border: 1.5px solid rgba(0, 0, 0, 0.15); /* Bordo più visibile */
  background: #a0a0a0; /* Scurito ulteriormente da #b0b0b0 */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Aggiunta ombra leggera in edit mode */
}

body.edit-mode .box-slot:hover {
  background: #cfcfcf;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

body:not(.edit-mode) .box-slot {
  cursor: default;
  border: 1px solid rgba(0, 0, 0, 0.05); /* Bordo sottile anche in view mode */
  background: #a0a0a0;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12); /* Ombra più marcata */
  transform: none;
}

body.demo-mode .widget-settings-btn,
body.demo-mode .add-btn-center {
  display: none !important;
}

/* Quando è bloccato (View Mode) */
body:not(.edit-mode) .setup-area,
body:not(.edit-mode) .settings-menu {
  display: none !important; /* Nasconde setup e rotellina impostazioni */
}

/* Guestbook sempre attivo per i visitatori */
body:not(.edit-mode) .guestbook-setup {
  display: flex !important;
}

/* Quando è sbloccato (Edit Mode) */
body.edit-mode .box-slot > * {
  pointer-events: auto; /* Permette di cliccare Carica e Input */
}

body.edit-mode .box-slot {
  cursor: move;
}

#sidebar-hover-trigger, #sidebar-right-hover-trigger {
  position: fixed;
  top: 0;
  width: 40px; /* Aumentato a circa 1cm (40px) per un'attivazione più facile */
  height: 100vh;
  z-index: 1500;
  background: transparent;
}

#sidebar-hover-trigger { left: 0; }
#sidebar-right-hover-trigger { right: 0; }

.sidebar-left {
  position: fixed;
  top: 60px;
  left: -280px;
  width: 280px;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.25); /* Ultra trasparente */
  backdrop-filter: blur(25px) saturate(160%);
  -webkit-backdrop-filter: blur(25px) saturate(160%);
  border-right: 1px solid rgba(0, 0, 0, 0.1); /* Bordo più marcato */
  padding: 20px;
  display: flex !important; /* Forza flex ma controllato da left */
  flex-direction: column;
  gap: 15px;
  z-index: 1600;
  height: calc(100% - 60px);
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  color: #1a1a1a !important;
  transition: left 0.3s ease;
  box-shadow: 10px 0 30px rgba(0,0,0,0.08); /* Aggiunta ombra anche a sinistra */
}

.sidebar-right {
  position: fixed;
  top: 60px;
  right: -280px;
  width: 280px;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(25px) saturate(160%);
  -webkit-backdrop-filter: blur(25px) saturate(160%);
  border-left: 1px solid rgba(0, 0, 0, 0.1); /* Bordo più marcato */
  padding: 20px;
  display: flex !important;
  flex-direction: column;
  gap: 20px;
  z-index: 1600;
  height: calc(100% - 60px);
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  color: #1c1c1e !important;
  transition: right 0.3s ease;
  box-shadow: -10px 0 30px rgba(0,0,0,0.08); /* Ombra leggermente più marcata */
}

.sidebar-left.open { left: 0; }
.sidebar-right.open { right: 0; }

.sidebar-left.pinned, .sidebar-right.pinned {
  left: auto;
  right: auto;
  position: fixed; /* Torna a fixed per rimanere attaccato al bordo */
  top: 60px;
  height: calc(100vh - 60px);
  min-width: 280px;
}

.sidebar-left.pinned { left: 0 !important; }
.sidebar-right.pinned { right: 0 !important; }

/* Nascondi scrollbar per Chrome, Safari e Opera */
.sidebar-left::-webkit-scrollbar, .sidebar-right::-webkit-scrollbar {
  display: none;
}

/* Styles for Sidebar Accordion */
.accordion-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  user-select: none;
}

.accordion-chevron {
  transition: transform 0.3s ease;
  font-size: 1.4rem;
  color: #8e8e93;
}

.sidebar-accordion-item.active .accordion-chevron {
  transform: rotate(90deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

.sidebar-accordion-item.active .accordion-content {
  max-height: 1000px; /* Valore alto per contenere tutto il menu */
  opacity: 1;
}

/* Stile per i componenti trascinabili nella sidebar */
.widget-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 12px;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1c1c1e;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    user-select: none;
}

.widget-item:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.widget-item:active {
    cursor: grabbing;
    transform: scale(0.97);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

#lock-toggle, #lock-toggle-sidebar {
  display: none !important;
}

#pin-sidebar, #pin-sidebar-right {
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 10px;
  padding: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#lock-toggle-sidebar:hover, #pin-sidebar:hover, #pin-sidebar-right:hover {
  background: #ffffff;
  transform: scale(1.05);
}

#lock-toggle-sidebar.unlocked {
  background: #34c759;
  color: white;
}

#pin-sidebar.active, #pin-sidebar-right.active {
  background: #007aff;
  color: white;
}

/* Layout dell'app con Sidebar Pinned */
.app-layout {
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Occupa lo spazio tra header e fine pagina */
  padding-top: 60px; /* Spazio per l'header fisso */
  transition: padding 0.3s ease;
}

body.has-marquee .app-layout {
  padding-top: 90px;
}

.main-content-flex {
    display: flex;
    flex-grow: 1;
    width: 100%;
    min-height: 0; /* Importante per flex children */
}

.app-layout.sidebar-pinned {
  padding-left: 280px;
}

.app-layout.sidebar-right-pinned {
  padding-right: 280px;
}

/* Fix per Landing Page ed Ospiti: No padding laterale se non loggati */
body:not(.is-logged-in) .app-layout {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.top-settings-panel {
    position: fixed;
    top: 60px; /* Sotto la barra */
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    width: 95%;
    max-width: 1000px;
    height: auto;
    max-height: calc(100vh - 80px);
    background: rgba(242, 242, 247, 0.98); /* Leggermente più scuro stile premium */
    backdrop-filter: blur(25px) saturate(160%);
    -webkit-backdrop-filter: blur(25px) saturate(160%);
    border-radius: 0 0 40px 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    z-index: 4000; /* Sopra tutto tranne l'header se necessario, ma lo mettiamo sopra l'overlay */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, top 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
}

body.has-marquee .top-settings-panel {
    top: 90px;
}

.top-settings-panel.open {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.top-settings-overlay {
    position: fixed;
    top: 60px; /* Parte da sotto la barra per non oscurarla */
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3); /* Effetto oscuramento per il resto della pagina */
    z-index: 3999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.top-settings-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Fix per Mobile */
@media (max-width: 768px) {
    .top-settings-panel {
        width: 100%;
        max-width: none;
        height: 90vh;
        border-radius: 0 0 30px 30px;
    }
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); /* Uniformato alla grandezza della card LIVE (380px) */
  justify-content: center; /* Centra le card orizzontalmente per evitare pendenze a destra */
  max-width: 1620px !important; /* Limita a un massimo di 4 colonne (380*4 + gaps) */
  margin: 0 auto;
  gap: 20px;
  padding-bottom: 100px;
  width: 100%;
}

.box-slot {
  position: relative;
  background: #a0a0a0;
  border: 2px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 1 / 1;
  width: 100%;
  cursor: grab;
  overflow: hidden;
  isolation: isolate; /* Forza il clipping del border-radius su tutti i contenuti figli */
  user-select: none; /* Previene la selezione del testo al doppio click */
  -webkit-user-select: none;
  touch-action: manipulation; /* Migliora il double-tap su mobile prevenendo lo zoom */
  container-type: inline-size;

  /* Fix flickering and smears */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-perspective: 1000;
  perspective: 1000;
  will-change: transform;
}

/* Stile Profilo Avatar */
.profile-header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

#Avatar-Container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 380px;
  flex-shrink: 0;
}

.avatar-slot {
  width: 180px !important;
  height: 180px !important;
  border-radius: 50% !important;
  border: 3px solid rgba(170, 211, 246, 0.5);
  overflow: hidden;
  position: relative;
  margin: 0 auto 20px auto;
  flex-shrink: 0;
}

.avatar-display {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  background-color: #f2f2f7; /* Colore di fallback premium */
}

.avatar-display img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  /* border-radius rimosso per permettere posizionamento rettangolare interno */
  display: block;
}

body:not(.edit-mode) .avatar-slot {
  border: none;
  background: transparent;
  cursor: default;
}

#Banner-Container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 380px;
  height: 380px;
  flex-shrink: 0;
}

.banner-slot {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  margin: 0;
}

.widget-active-content {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: inherit;
}

/* --- CONTROLLI ZOOM AVATAR (RIPOSIZIONAMENTO) --- */
.zoom-adjust-container {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0 15px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 13000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #d1d1d6;
    width: 220px;
    height: 48px;
    animation: fadeIn 0.2s ease;
    user-select: none;
    touch-action: none;
}

.zoom-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 100%;
    background: transparent;
    outline: none;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.zoom-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #e5e5ea;
    border-radius: 10px;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: #007aff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid white;
    margin-top: -10px;
}

.zoom-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #007aff;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.avatar-slot .widget-active-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

body:not(.edit-mode) .avatar-slot {
  border: none;
  background: transparent;
  cursor: default;
}

/* Rotellina Impostazioni Widget */
.widget-settings-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 32px;  /* Aumentato per centraggio e tocco migliore */
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
  display: none; /* Nascosto di default, mostrato con JS o Edit Mode */
  justify-content: center; /* Centra orizzontalmente l'emoji */
  align-items: center;     /* Centra verticalmente l'emoji */
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body.is-own-profile .widget-settings-btn {
  display: flex !important;
  opacity: 1 !important;
}

.box-slot:hover .widget-settings-btn {
  display: flex;
}

.widget-settings-btn:hover {
  background: rgba(255,255,255,1);
  transform: scale(1.1);
}

.widget-label {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #000000 !important; /* Sempre Nero come richiesto */
  letter-spacing: 0.5px;
  z-index: 5;
  pointer-events: none;
  opacity: 0.8;
  white-space: nowrap;

  /* Stabilizzazione per evitare sfarfallio */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
}

/* Unificazione Menu Proprietario */
body.is-own-profile .card-options-container {
    display: none !important;
}

/* Legacy settings menu removed */
.settings-menu {
    display: none !important;
}

.settings-icon-bar {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    border-bottom: 0.5px solid #f2f2f7;
    background: #f9f9f9;
}

.settings-action-icon {
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.settings-action-icon:hover {
    background: #e5e5ea;
    transform: scale(1.1);
}

.settings-action-icon.active {
    background: #007aff;
    color: white;
}

/* Selettore Rapido Evoluto */
.slot-quick-selector {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    padding: 10px;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    border-radius: 16px;
    backdrop-filter: blur(15px);
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

.selector-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
    width: 100%;
    height: 100%;
}

.quick-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    text-align: center;
    gap: 2px;
}

.quick-option:hover {
    transform: scale(1.1);
    color: #007aff;
}

.action-option .quick-option-icon {
    filter: drop-shadow(0 4px 10px rgba(255, 149, 0, 0.3));
}

.quick-option-icon {
    font-size: 3.5rem; /* Ridotte per un miglior equilibrio visivo */
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15));
}

.selector-nav {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.selector-nav:hover {
    opacity: 1;
}

.selector-arrow {
    background: #f2f2f7;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007aff;
    transition: background 0.2s;
}

.selector-arrow:hover {
    background: #e5e5ea;
}

.selector-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.selector-dots {
    display: flex;
    gap: 6px;
}

.selector-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d1d1d6;
}

.selector-dot.active {
    background: #007aff;
    width: 12px;
    border-radius: 3px;
}

.settings-menu button {
  background: none;
  border: none;
  padding: 8px 12px;
  text-align: center;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  width: 100%;
}

.settings-actions-bottom button {
  width: auto !important;
  padding: 8px 5px !important;
}

.settings-menu button:hover {
  background: #f2f2f7;
}

.settings-menu .btn-delete-widget {
  color: #ff3b30;
}

/* Pulsante Aggiungi (+) in mezzo */
.add-btn-center {
  background: #007aff;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.3);
  transition: transform 0.2s, background 0.2s;
  display: none; /* Mostrato solo in Edit Mode o Demo se non c'è contenuto */
}

.box-slot:hover .add-btn-center {
  transform: scale(1.1);
  background: #0056b3;
}

/* Stile specifico per il "+" e la rotellina in modalità modifica mobile */
body.edit-mode.is-mobile .add-btn-center,
body.edit-mode.is-mobile .widget-settings-btn {
    display: flex !important;
}

body.edit-mode.is-mobile .add-btn-center {
    background: #f2f2f7 !important; /* Grigio chiaro premium */
    color: #8e8e93 !important;      /* Grigio icona */
    border: none !important;
    box-shadow: none !important;
    width: 60px !important;
    height: 60px !important;
    font-size: 2.5rem !important;
    font-weight: 300 !important; /* Più sottile e tondo */
}

.box-slot:active {
  cursor: grabbing;
}

.box-slot.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  border: 2px solid #007aff;
}

.box-slot.drop-target {
  background: rgba(0, 122, 255, 0.15);
  border: 2px solid #007aff;
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(0, 122, 255, 0.3);
}

/* Inibizione eventi durante il drag */
.box-slot.dragging * {
  pointer-events: none;
}

/* ==========================================
   5. STILI SPECIFICI COMPONENTI (PAGINE premium)
   ========================================== */
/* Stili per il menu componenti mobile */
.mobile-component-selector {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.2);
    z-index: 3000;
    transition: bottom 0.3s ease;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.mobile-component-selector.visible {
    bottom: 0;
}

.selector-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #f2f2f7;
    font-weight: 700;
}

.selector-body {
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.mobile-widget-option {
    background: #f2f2f7;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 2999;
    display: none;
}

.f-page {
  width: 100%;
  height: 100%;
  padding: 20px;
  /* Rimosso overflow per evitare doppie scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.f-page::-webkit-scrollbar {
  display: none;
}

.f-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 25px;
  color: var(--profile-color);
}

.f-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.f-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #1c1c1e;
}

.f-card p {
  font-size: 0.95rem;
  color: #3a3a3c;
  line-height: 1.5;
}

/* Bottoni in stile premium */
.btn-premium {
  background: #e5e5ea; /* Un po' più scuro per contrasto */
  color: #000000;      /* Testo nero come richiesto */
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

/* premium SWITCH */
.f-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.f-switch input { opacity: 0; width: 0; height: 0; }
.f-switch .slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #d1d1d6; transition: .4s; border-radius: 34px;
}
.f-switch .slider:before {
  position: absolute; content: ""; height: 24px; width: 24px; left: 2px; bottom: 2px;
  background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.f-switch input:checked + .slider { background-color: #34c759; }
.f-switch input:checked + .slider:before { transform: translateX(22px); }

/* Large Toggle for Creator Private Section */
.creator-large-switch {
    width: 60px !important;
    height: 32px !important;
}

.creator-large-switch .switch-slider {
    border-radius: 32px !important;
}

.creator-large-switch .switch-slider:before {
    height: 28px !important;
    width: 28px !important;
    left: 2px !important;
    bottom: 2px !important;
}

.creator-large-switch input:checked + .switch-slider:before {
    transform: translateX(28px) !important;
}


/* premium LIST GROUP */
.f-list-group {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 0.5px solid #c6c6c8;
}

.f-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 0.5px solid #e5e5ea;
  background: #ffffff;
  color: #000000;
}

.f-list-item:last-child { border-bottom: none; }
.f-list-item span { font-size: 1rem; color: #000000; }

.f-list-item input, .f-list-item select {
  border: none; background: transparent; font-size: 1rem; color: #000000; outline: none; text-align: right; width: 60%; font-weight: 500;
}

.f-list-item select option {
  color: #000000;
  background: #ffffff;
}

.f-list-item input::placeholder {
  color: #8e8e93;
}

.btn-premium:hover {
  background: #e5e5ea;
}

.btn-f-primary, .btn-multicolor {
  width: 100%;
  background-color: #007aff; /* Fallback */
  animation: buttonMulticolor 8s infinite linear;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.btn-multicolor {
  width: auto;
  padding: 10px 25px;
}

.btn-f-primary:hover {
  opacity: 0.8;
}

/* Modale premium */
.f-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

/* premium STYLE ALERTS */
.f-alert-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Spostato in alto invece che centrato */
  padding-top: 15vh; /* Distanza dal bordo superiore */
  z-index: 999999; /* Primo piano assoluto sopra tutti i modal */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.f-alert-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.f-alert-content {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px) saturate(160%);
  -webkit-backdrop-filter: blur(25px) saturate(160%);
  width: 270px;
  border-radius: 14px;
  text-align: center;
  padding: 20px 0 0 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transform: scale(1.1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.f-alert-modal.visible .f-alert-content {
  transform: scale(1);
}

.f-alert-content p {
  font-size: 1rem;
  font-weight: 500;
  color: #000;
  padding: 0 15px 20px 15px;
  line-height: 1.3;
  margin: 0;
}

.f-alert-btn-ok, .f-alert-btn-confirm, .f-alert-btn-cancel {
  width: 100%;
  height: 44px;
  background: none;
  border: none;
  border-top: 0.5px solid rgba(0,0,0,0.1);
  font-size: 1.05rem;
  font-weight: 600;
  color: #007aff;
  cursor: pointer;
}

.f-alert-btn-ok:active, .f-alert-btn-confirm:active, .f-alert-btn-cancel:active {
  background: rgba(0,0,0,0.05);
}

.f-alert-actions {
  display: flex;
}

.f-alert-btn-cancel {
  border-right: 0.5px solid rgba(0,0,0,0.1);
  font-weight: 400;
}

.f-alert-btn-confirm {
  font-weight: 600;
}

.f-modal-content {
  background: white;
  width: 90%;
  max-width: 400px;
  border-radius: 20px;
  padding: 25px;
  text-align: left; /* Cambiato da center a left per ordine e professionalità */
}

.f-modal-content h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  text-align: center; /* Titolo resta centrato */
}

.f-modal-content input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d1d1d6;
  margin-bottom: 20px;
  outline: none;
}

.f-modal-actions {
  display: flex;
  gap: 15px;
}

.f-modal-actions button {
  flex: 1;
}

#content-area {
  width: 100%;
  padding: 40px;
  background: var(--profile-bg);
}

#content-area::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* YouTube Widget */
.video-container {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.setup-area {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  padding: 45px 15px 20px 15px; /* Aumentato ulteriormente padding superiore per centrare meglio */
  border-radius: 16px;
  backdrop-filter: blur(15px);
  z-index: 100;
  box-sizing: border-box;
  margin: 0;
}

.setup-icon {
    font-size: 3rem; /* Ridotta leggermente per bilanciare lo spazio */
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15));
    line-height: 1;
    /*aggiungere padding inferiore*/
    padding: 1px;

}
    line-height: 1;
}

.setup-area input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d1d1d6;
  outline: none;
}

/* Note Widget */
.notes-widget textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  resize: none;
  padding: 20px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  color: inherit;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Gallery Widget */
.gallery-grid {
  display: block;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: inherit;
}

.gallery-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: inherit !important;
  box-shadow: none !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  max-height: none !important;
}

/* Mood Widget */
.mood-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 20px;
}

.mood-display {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15.0rem; /* Fallback per emoji testuali */
}

.mood-display img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.mood-text {
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
}

.mood-setup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.mood-select {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #d1d1d6;
}

/* Links Widget */
.links-widget {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.links-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow-y: auto;
}

.link-item {
  width: 95%;
  background: #f2f2f7;
  color: #007aff;
  text-decoration: none;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: transform 0.2s, background 0.2s;
}

.link-item:hover {
  transform: translateY(-2px);
  background: #e5e5ea;
}

.links-setup {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 10px 15px !important;
}

.links-setup .setup-icon {
    font-size: 3rem;
    margin-bottom: 2px;
}

.links-editor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px; /* Uguale allo slider */
    width: 80%; /* 4/5 della larghezza totale per avere quadrati uguali allo slider */
    margin: 5px auto 10px auto;
}

.slider-editor-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 10px;
}

.gallery-editor-grid, .video-editor-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 18%; /* Circa 1/5 della larghezza per essere uguale ai quadrati dello slider */
    margin: 0 auto 10px auto;
}

.link-slot, .slider-slot, .gallery-slot, .video-slot {
    background-color: #f2f2f7;
    border: 1px solid #d1d1d6;
    border-radius: 12px;
    padding: 3px;
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    width: 100%;
    color: #8e8e93;
    box-sizing: border-box;
    word-break: break-word;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.link-slot:hover, .slider-slot:hover, .gallery-slot:hover, .video-slot:hover {
    background-color: #e5e5ea;
    transform: scale(1.02);
}

.link-slot.active, .slider-slot.active, .gallery-slot.active, .video-slot.active {
    background-color: #007aff !important;
    color: white !important;
    border-color: #007aff !important;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,122,255,0.3);
    z-index: 2;
}

.link-slot.has-content, .slider-slot.has-content, .gallery-slot.has-content, .video-slot.has-content {
    background-color: #ffffff;
    border: 2px solid #007aff;
    color: #007aff;
}

.link-edit-fields {
    background: rgba(0,0,0,0.03);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

.links-setup input {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #d1d1d6;
}

/* 6. OROLOGIO */
.clock-widget {
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  color: inherit; /* Segue il contrasto del tema */
  background: transparent; /* Stile Vetro */
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

.clock-display {
  font-size: 19cqw; /* Adatta l'ora alla larghezza della card */
  width: 100%;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}

/* 7. CITAZIONE */
.quote-widget {
  font-style: italic;
  text-align: center;
  padding: 20px;
  font-size: 1.1rem;
  color: inherit; /* Segue il colore del tema o della card */
  justify-content: center;
  font-family: 'Georgia', serif;
}

.quote-text {
  line-height: 1.4;
}

.quote-text::before { content: '“'; font-size: 1.5rem; color: #8e8e93; }
.quote-text::after { content: '”'; font-size: 1.5rem; color: #8e8e93; }

/* 8. GUESTBOOK (CHAT) */
.guestbook-widget {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  justify-content: flex-end; /* Spinge la lista in basso verso l'input */
  background: rgba(255, 255, 255, 0.2); /* Sfondo semitrasparente per far vedere il colore della card */
  border-radius: 12px;
  padding: 10px !important;
}

.guestbook-list {
  flex-grow: 1;
  width: 100%;
  overflow-y: auto;
  font-size: 0.85rem;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 5px;
  text-align: left;
}

.guestbook-entry {
  background: white;
  padding: 8px 12px;
  border-radius: 15px;
  border: 0.5px solid #e5e5ea;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  max-width: 90%;
  align-self: flex-start;
  color: #000000 !important; /* Forza colore nero per i messaggi */
}

.guestbook-entry.own-msg {
  background: #007aff;
  color: inherit; /* Lascia che il JS o il tema decidano */
  align-self: flex-end;
  border: none;
}

.guestbook-entry strong {
  display: block;
  font-size: 0.7rem;
  margin-bottom: 2px;
  opacity: 0.8;
}

.guestbook-setup {
  width: 100%;
  display: flex;
  gap: 5px;
  background: #f2f2f7;
  padding: 5px;
  border-radius: 20px;
}

.gb-msg {
  flex-grow: 1;
  border: none;
  background: transparent;
  padding: 8px 12px;
  outline: none;
  font-size: 0.9rem;
  color: #000000;
}

.btn-guestbook-send {
  background: #007aff;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* 9. OBIETTIVO */
.goal-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding: 20px;
}

.goal-display {
  font-size: 1.4rem; /* Ingrandito leggermente */
  font-weight: 800;
  text-align: center;
  color: #1c1c1e;
  padding: 0;
  margin-top: 15px; /* Aumentato da 10px a 15px per scendere la scritta */
}

.goal-icon {
  font-size: 3rem; /* Ingrandito da 2rem a 3rem */
  margin-bottom: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Sidebar destra statistiche */
.stats-header {
  padding-bottom: 15px;
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
  font-size: 0.9rem;
  color: #1c1c1e !important;
}

.auth-user-label { color: #8e8e93 !important; font-weight: 600; }
.auth-user-val { color: #1c1c1e !important; font-weight: 700; margin-left: 5px; }

.stats-section h4, .visitors-section h4, .connections-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #8e8e93 !important;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: white !important;
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 2px solid #f2f2f7 !important; /* Linee da 2 */
}

.stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: #007aff !important;
}

.stat-label {
  font-size: 0.7rem;
  color: #8e8e93 !important;
}

.visitors-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

.visitor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white !important;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  color: #1c1c1e !important;
  gap: 15px;
}

.visitor-name { font-weight: 600; color: #1c1c1e !important; }
.visitor-time { font-size: 0.75rem; color: #8e8e93 !important; }

.no-data { font-size: 0.8rem; color: #c7c7cc; text-align: center; margin-top: 10px; }

/* ==========================================
   LANDING PAGE (NON LOGGATI)
   ========================================== */
.landing-container {
  display: flex;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  align-items: flex-start;
  gap: 60px;
}

.landing-left {
  max-width: 380px;
  padding: 40px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}

.landing-right {
  flex: 1.2;
  padding: 20px;
}

.landing-headline {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  color: #1c1c1e;
  letter-spacing: -1.5px;
}

.landing-text {
  font-size: 1.2rem;
  color: #8e8e93;
  margin-bottom: 40px;
  line-height: 1.5;
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.feature-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.feature-icon {
  font-size: 2rem;
  background: #f2f2f7;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.feature-item h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.feature-item p {
  color: #8e8e93;
  font-size: 0.95rem;
}

.landing-preview {
  display: flex;
  gap: 15px;
  margin-top: 50px;
}

.preview-card {
  background: white;
  padding: 15px 25px;
  border-radius: 16px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  font-size: 0.9rem;
}

/* Bottone Login Landing */
.btn-landing-login {
  background-color: #007aff; /* Fallback */
  animation: buttonMulticolor 8s infinite linear;
  color: white;
  border: none;
  padding: 12px 35px;
  border-radius: 12px;
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-landing-login:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-landing-login:active {
  transform: translateY(0);
}

/* 10. USER INFO & STATS */
#user-info-display {
  text-align: center;
  margin-top: 15px;
}

#display-real-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: var(--card-color, inherit);
}

#display-username {
  font-size: 0.95rem;
  opacity: 0.7;
  margin: 2px 0 0 0;
  color: var(--card-color, inherit);
}

.user-stats-minimal {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

/* Vecchia classe mantenuta per compatibilità o altri usi */
.stat-item-card {
  color: var(--card-color, inherit);
  padding: 8px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: transform 0.2s;
  cursor: pointer;
}

/* NUOVA CLASSE SPECIFICA PER EFFETTO VETRO FISSO */
.glass-stat-card {
  background: rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  color: #1c1c1e !important;
  padding: 10px 18px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
  transition: transform 0.2s, background 0.2s !important;
}

#home-intro, #user-bio-display {
    text-align: center;
    width: 100%;
}

/* --- LAYOUT DESKTOP OTTIMIZZATO (Avatar a sinistra) --- */
@media (min-width: 1025px) {
    .profile-header-flex {
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 80px !important;
        align-items: center !important;
    }

    #Avatar-Container {
        display: grid !important;
        grid-template-columns: auto auto;
        grid-template-rows: auto auto auto;
        gap: 15px 40px;
        text-align: left;
        width: auto !important;
        max-width: none !important;
    }

    .avatar-slot {
        grid-column: 1;
        grid-row: 1;
        width: clamp(220px, 20vw, 360px) !important;
        height: clamp(220px, 20vw, 360px) !important;
        margin: 0 !important;
    }

    #user-info-display {
        grid-column: 2;
        grid-row: 1;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    #display-real-name, #display-username {
        text-align: left !important;
    }

    .user-stats-minimal {
        grid-column: 1 / span 2 !important;
        grid-row: 2 !important;
        display: flex !important;
        justify-content: center !important;
        margin-top: 15px !important;
        gap: 15px !important;
    }

    .intro-bio-wrapper {
        grid-column: 1 / span 2 !important;
        grid-row: 3 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        text-align: center !important;
        margin: 10px auto 0 auto !important;
        width: 100% !important;
        max-width: 500px !important;
        justify-self: center !important;
    }

    #home-intro, #user-bio-display {
        text-align: center !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        justify-self: center !important;
    }

    #display-bio {
        text-align: center !important;
        width: 100% !important;
    }

    #Banner-Container {
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
}





body.dark-mode .glass-stat-card {
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.glass-stat-card:hover {
  transform: translateY(-2px) !important;
  background: rgba(255, 255, 255, 0.4) !important;
}

.glass-stat-card span {
  font-size: 1.4rem !important;
  font-weight: 800 !important;
}

.glass-stat-card label {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  opacity: 0.8 !important;
}

.stat-item-card span {
  font-size: 1.4rem !important;
  font-weight: 800;
}

.stat-item-card label {
  font-size: 0.8rem !important;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Forza l'effetto vetro se siamo in un tema animato o vetro */
body.animated-bg .stat-item-card,
body.glassy-theme .stat-item-card {
  background: color-mix(in srgb, var(--this-bg, rgba(255, 255, 255, 0.7)), transparent 70%) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Adattamento Layout per Tablet e Schermi Medi */
/* RIMOSSO - SPOSTATO IN Mobile.css */

.mobile-only {
  display: none;
}

/* Adattamento Layout per Mobile (Smartphone) */
/* RIMOSSO - SPOSTATO IN Mobile.css */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 1s ease forwards;
}

/* Fix Links Widget Overlap */
.links-setup {
    z-index: 1000 !important;
}

/* Ensure Links Button Symmetry */
.links-action-buttons button {
    box-sizing: border-box !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.links-action-buttons .btn-f-primary {
    margin-top: 0 !important;
}

/* Nascondi la nav mobile su desktop */
.mobile-bottom-nav {
  display: none !important;
}

/* Animazione Rainbow per Card Demo */
@keyframes rainbow-bg {
    0% { background-color: #ff9500; }
    20% { background-color: #5856d6; }
    40% { background-color: #34c759; }
    60% { background-color: #007aff; }
    80% { background-color: #ff2d55; }
    100% { background-color: #ff9500; }
}

.demo-card-animated {
    animation: rainbow-bg 8s linear infinite !important;
    background-image: none !important;
}

/* === EFFETTI VETRO (GLASS-MORPHISM) === */
/* Applicato a temi colorati e animati per modernizzare l'interfaccia */

body.animated-bg {
  animation: backgroundSoftMulticolor 30s infinite linear !important;
}

#landing-bg-anim {
  backface-visibility: hidden;
  perspective: 1000px;
  transform: translateZ(0); /* Spostata qui l'accelerazione hardware per non rompere il fixed del menu mobile */
}

body.glassy-theme #content-area,
body.glassy-theme .app-layout,
body.glassy-theme .f-page {
  background: transparent !important;
}

body.glassy-theme .stat-item-card,
body.glassy-theme .stat-item,
body.glassy-theme .box-slot,
body.glassy-theme #sidebar-widgets,
body.glassy-theme #sidebar-stats,
body.glassy-theme .mobile-bottom-nav,
body.glassy-theme .f-list-group,
body.glassy-theme .guestbook-entry {
  background: color-mix(in srgb, var(--this-bg, rgba(255, 255, 255, 0.7)), transparent 70%) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

body.glassy-theme .f-card,
body.glassy-theme .stat-card {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Modal Connessioni (Raggi/Riflessi) */
.connections-modal-content {
  max-width: 450px !important;
  height: 60vh !important;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-radius: 24px !important;
  overflow: hidden;
}

.connections-header {
  padding: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.connections-search-wrapper {
  padding: 15px 20px;
  background: rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.connections-search-input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  font-size: 1rem;
  outline: none;
  background: white;
}

.connections-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.connection-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.connection-item:hover {
  background: rgba(0,0,0,0.05);
}

.connection-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.connection-info {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
}

.connection-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c1c1e;
}

.connection-username {
  font-size: 0.8rem;
  color: #8e8e93;
}

.btn-inline-follow {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #007aff;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-inline-follow:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

/* Tab per Modal Connessioni */
.connections-tabs {
  display: flex;
  background: #f2f2f7;
  padding: 4px;
  border-radius: 12px;
  margin: 0 20px 10px 20px;
  gap: 4px;
}

.conn-tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
  color: #8e8e93;
}

.conn-tab-btn.active {
  background: white;
  color: #007aff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* premium Style Toggle Switch */
.f-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.f-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #e5e5ea;
  transition: .4s;
  border-radius: 22px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .switch-slider {
  background-color: #34c759;
}

input:checked + .switch-slider:before {
  transform: translateX(18px);
}

#color-picker-group {
  transition: all 0.3s ease;
}

/* ==========================================
   FOOTER
   ========================================== */
.main-footer {
    margin-top: 0;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 40px 40px 0 0;
    color: #000000 !important;
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
    z-index: 10;
    width: 100% !important; /* Forza larghezza piena */
    left: 0 !important;
}

/* Mostra il footer solo nelle pagine dove è presente nel DOM statico (Home/Profilo) */
body.world-view .main-footer {
    display: none !important;
}

.footer-logo-brand {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-brand {
    max-width: 300px;
    text-align: left;
}

.footer-logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(45deg, #ff9500, #007aff, #34c759);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.95rem;
    color: #8e8e93;
    line-height: 1.6;
}

.footer-links-container {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.footer-links {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 15px 60px;
}

.footer-links a {
    text-decoration: none;
    color: #000000 !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    opacity: 0.8;
}

.footer-links a:hover {
    color: #007aff;
    opacity: 1;
}

.footer-bottom {
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    padding-top: 25px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #000000 !important;
    font-weight: 400;
}

@media (max-width: 768px) {
    .main-footer {
        padding: 40px 20px 110px 20px;
        border-radius: 24px 24px 0 0;
        text-align: center;
        gap: 30px;
        margin-top: 50px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
    }

    .footer-brand {
        text-align: center;
        max-width: 100%;
    }

    .footer-links-container {
        justify-content: center;
        width: 100%;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .footer-links a:hover {
        padding-left: 0;
    }
}

/* === FILTRI WORLD (DESKTOP) === */
.world-filters-bar {
    position: fixed;
    top: 60px; /* Esattamente sotto la main-header */
    left: 50%;
    transform: translateX(-50%) translateY(-100%); /* Nascondi di default sopra l'header */
    width: auto;
    min-width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 1500;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 25px;
    border-radius: 0 0 20px 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.world-filters-bar.open {
    transform: translateX(-50%) translateY(0); /* Mostra la barra */
}

/* === CUSTOM DROPDOWN FILTRI WORLD === */
.world-filter-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 14px;
    min-width: 140px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 10001;
    margin-top: 12px;
    flex-direction: column;
    overflow: hidden;
}

.custom-dropdown-content.show {
    display: flex;
}



/* Animazione Volo Elemento Sidebar rimossa */
.flying-widget-ghost {
    display: none !important;
}

/* === FIX UNIVERSALE IUBENDA OVERLAY (Desktop & Mobile) === */

/* ==========================================
   RELATIONSHIP & SHARED AVATAR
   ========================================== */

.relationship-heart-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 15px 0;
    position: relative;
    z-index: 999;
    min-height: 40px;
}

.relationship-heart {
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.relationship-heart:hover {
    transform: scale(1.2);
}

.relationship-heart svg {
    width: 100%;
    height: 100%;
}

.relationship-heart.inactive {
    filter: grayscale(1);
    opacity: 0.5;
}

.relationship-heart.active svg path {
    fill: url(#multicolor-gradient);
}

.relationship-heart.active {
    animation: heart-beat 2s infinite ease-in-out;
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Shared Avatar Styles */
.avatar-display.shared-avatar {
    position: relative;
    overflow: visible; /* Permette alla foto in drag di uscire se necessario */
    background: transparent !important; /* Rimosso grigio di fondo che creava bordi indesiderati */
}

.avatar-display.shared-avatar .photo-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.avatar-display.shared-avatar .photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: auto; /* Permette il drag */
}

.avatar-display.shared-avatar .photo-wrapper.photo-a {
    -webkit-clip-path: polygon(
      0 0,
      52% 0,
      47% 20%,
      53% 40%,
      47% 60%,
      53% 80%,
      48% 100%,
      0 100%
    );
    clip-path: polygon(
      0 0,
      52% 0,
      47% 20%,
      53% 40%,
      47% 60%,
      53% 80%,
      48% 100%,
      0 100%
    );
    z-index: 1;
}

.avatar-display.shared-avatar .photo-wrapper.photo-b {
    -webkit-clip-path: polygon(
      52% 0,
      100% 0,
      100% 100%,
      48% 100%,
      53% 80%,
      47% 60%,
      53% 40%,
      47% 20%
    );
    clip-path: polygon(
      52% 0,
      100% 0,
      100% 100%,
      48% 100%,
      53% 80%,
      47% 60%,
      53% 40%,
      47% 20%
    );
    z-index: 1;
}

.avatar-display.shared-avatar .seam {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(255,255,255,.9);
    z-index: 2;
    -webkit-clip-path: polygon(
      51.5% 0,
      52.5% 0,
      47.5% 20%,
      53.5% 40%,
      47.5% 60%,
      53.5% 80%,
      48.5% 100%,
      47.5% 100%,
      52.5% 80%,
      46.5% 60%,
      52.5% 40%,
      46.5% 20%
    );
    clip-path: polygon(
      51.5% 0,
      52.5% 0,
      47.5% 20%,
      53.5% 40%,
      47.5% 60%,
      53.5% 80%,
      48.5% 100%,
      47.5% 100%,
      52.5% 80%,
      46.5% 60%,
      52.5% 40%,
      46.5% 20%
    );
    opacity: .9;
}

/* Modal Relazione */
.relationship-preview-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* Stili dedicati per il selettore tab e toggle dei Creator */
.creator-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 25px auto;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
    width: fit-content;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.5px solid rgba(255,255,255,0.15);
}

.creator-toggle-label {
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.creator-toggle-label.active {
    color: #007aff !important;
    opacity: 1 !important;
}

.creator-toggle-label.inactive {
    color: #8e8e93 !important;
    opacity: 0.6 !important;
}

.relationship-preview-avatar {

.relationship-preview-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.rel-type-select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    font-size: 1rem;
    margin-bottom: 20px;
    outline: none;
}

/* ==========================================

/* Sincronizzazione Drag Avatar - Clipping mantenuto */
.photo-wrapper.is-dragging {
    z-index: 100 !important;
}

.photo-wrapper.is-dragging .photo {
    opacity: 0.8;
}

/* Versione Riflessa dello Spacco */
.avatar-display.shared-avatar.mirrored-seam .photo-wrapper.photo-a {
    -webkit-clip-path: polygon(
      0 0,
      48% 0,
      53% 20%,
      47% 40%,
      53% 60%,
      47% 80%,
      52% 100%,
      0 100%
    );
    clip-path: polygon(
      0 0,
      48% 0,
      53% 20%,
      47% 40%,
      53% 60%,
      47% 80%,
      52% 100%,
      0 100%
    );
}

.avatar-display.shared-avatar.mirrored-seam .photo-wrapper.photo-b {
    -webkit-clip-path: polygon(
      48% 0,
      100% 0,
      100% 100%,
      52% 100%,
      47% 80%,
      53% 60%,
      47% 40%,
      53% 20%
    );
    clip-path: polygon(
      48% 0,
      100% 0,
      100% 100%,
      52% 100%,
      47% 80%,
      53% 60%,
      47% 40%,
      53% 20%
    );
}

.avatar-display.shared-avatar.mirrored-seam .seam {
    -webkit-clip-path: polygon(
      48.5% 0,
      47.5% 0,
      52.5% 20%,
      46.5% 40%,
      52.5% 60%,
      46.5% 80%,
      51.5% 100%,
      52.5% 100%,
      47.5% 80%,
      53.5% 60%,
      47.5% 40%,
      53.5% 20%
    );
/* Omino Avatar Placeholder con l'omino 👤 cangiante multicolor (non lo sfondo) */
.multicolor-omino-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    background: linear-gradient(135deg, #ff9500, #ff2d55, #af52de, #007aff, #34c759) !important;
    background-size: 300% 300% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    animation: multicolor-bg-shift 4s infinite alternate linear !important;
    user-select: none;
}

.live-card-item .multicolor-omino-avatar,
.live-card-avatar-centered .multicolor-omino-avatar {
    width: 100% !important;
    height: 100% !important;
    border-radius: 18px !important;
    font-size: 2rem !important;
}

.multicolor-avatar-svg {
    pointer-events: none !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

#modal-relationship, #modal-relationship-details {
    z-index: 100000 !important;
}

#modal-relationship .f-modal-content {
    position: relative !important;
    z-index: 100001 !important;
    pointer-events: auto !important;
}

#btn-send-rel, #btn-cancel-rel {
    position: relative !important;
    z-index: 100005 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}
    font-size: 1.5rem !important;
}
      47.5% 80%,
      53.5% 60%,
      47.5% 40%,
      53.5% 20%
    );
}

/* Cristallo storie e suoi elementi completamente NASCOSTI su Desktop */


/* ANIMAZIONE FRAGMENTIONS SU CARD */
.fragmentions-anim-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease-out;
}

.fragmentions-anim-text {
    width: 90%;
    text-align: center;
    font-size: clamp(1.2rem, 8vw, 2.2rem); /* Scalabile in base alla card */
    font-weight: 900;
    background: linear-gradient(135deg, #ff9500, #ff2d55, #af52de, #007aff, #34c759);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: multicolor-bg-shift 2s linear infinite, popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: -1px;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseZoomHighlight {
    0% { transform: scale(1); filter: brightness(1); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
    50% { transform: scale(1.3); filter: brightness(1.2); box-shadow: 0 0 80px rgba(0, 122, 255, 1), 0 0 30px rgba(0, 122, 255, 0.6); }
    100% { transform: scale(1); filter: brightness(1); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
}

.marquee-content {
    display: block;
    width: 100%;
    color: #ffffff !important;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1rem;
    line-height: 40px;
    text-align: center;
}

.highlight-pulse-effect {
    animation: pulseZoomHighlight 1s ease-in-out 3 !important; /* 3 battiti potenti */
    z-index: 200000 !important;
    position: relative !important;
    pointer-events: auto !important;
    border: 4px solid #007aff !important;
    background-color: white !important;
    outline: 5000px solid rgba(0, 0, 0, 0.5); /* Effetto oscuramento rapido */
}

.my-card-selection-item {
    aspect-ratio: 1;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.my-card-selection-item:hover {
    transform: scale(1.05);
    border-color: #007aff;
}

/* Segmented Control premium Style */
.f-segmented-control {
    background: rgba(118, 118, 128, 0.12);
    padding: 2px;
    border-radius: 9px;
    display: flex;
    width: 240px; /* Default width */
    max-width: 100%;
    position: relative;
    cursor: pointer;
    margin: 0 auto;
}

#private-toggle-bg {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    background: white;
    border-radius: 7px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.segmented-item {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1;
    transition: color 0.3s;
    color: #1c1c1e;
}

.segmented-item.active {
    color: #000;
}

body.dark-mode .f-segmented-control {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode #private-toggle-bg {
    background: #636366;
}

body.dark-mode .segmented-item {
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .segmented-item.active {
    color: #fff;
}

/* City Dropdown Menu */
.city-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #c6c6c8;
  border-radius: 12px;
  z-index: 99999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  margin-top: 4px;
  text-align: left;
}

.city-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  color: #1c1c1e;
  border-bottom: 0.5px solid #e5e5ea;
}

.city-dropdown-item:last-child {
  border-bottom: none;
}

.city-dropdown-item:hover {
  background-color: #f2f2f7;
  color: #007aff;
  font-weight: 600;
}

body.dark-mode .city-dropdown-menu {
  background: #1c1c1e;
  border-color: #3a3a3c;
  color: #ffffff;
}

body.dark-mode .city-dropdown-item {
  color: #ffffff;
  border-bottom-color: #2c2c2e;
}

body.dark-mode .city-dropdown-item:hover {
  background-color: #2c2c2e;
  color: #0a84ff;
}

/* City Picker Modal Styles */
.city-picker-item:hover {
  background-color: #f2f2f7;
  color: #007aff !important;
}

body.dark-mode #city-picker-modal .city-picker-card {
  background: #1c1c1e !important;
}

body.dark-mode #city-picker-modal h3 {
  color: #ffffff !important;
}

body.dark-mode #city-search-input {
  background: #2c2c2e !important;
  color: #ffffff !important;
  border-color: #3a3a3c !important;
}

body.dark-mode .city-picker-item {
  color: #ffffff !important;
  border-bottom-color: #2c2c2e !important;
}

body.dark-mode .city-picker-item:hover {
  background-color: #2c2c2e !important;
}

/* 3D T-Shirt Modal & Object Styles */
@keyframes rotateTshirt3D {
  0% { transform: rotateY(0deg) rotateX(4deg); }
  50% { transform: rotateY(180deg) rotateX(-4deg); }
  100% { transform: rotateY(360deg) rotateX(4deg); }
}

.tshirt-3d-scene {
  perspective: 1000px;
  width: 260px;
  height: 300px;
  margin: 15px auto;
  position: relative;
}

.tshirt-3d-object {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateTshirt3D 10s infinite linear;
}

.tshirt-3d-scene:hover .tshirt-3d-object {
  animation-play-state: paused;
}

body.dark-mode #tshirt-modal .city-picker-card,
body.dark-mode #qr-display-modal .city-picker-card {
  background: #1c1c1e !important;
  color: #ffffff !important;
}

body.dark-mode #tshirt-modal h3,
body.dark-mode #qr-display-modal h3 {
  color: #ffffff !important;
}

body.dark-mode #tshirt-modal input,
body.dark-mode #tshirt-modal select,
body.dark-mode #tshirt-modal textarea {
  background: #2c2c2e !important;
  color: #ffffff !important;
  border-color: #3a3a3c !important;
}

