
/* Navigazione World */
.world-nav-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    pointer-events: auto;
}

#load-world {
    font-weight: 800;
    color: #007aff;
    text-decoration: none;
    font-size: 1.15rem;
    letter-spacing: 2px;
    transition: transform 0.2s, opacity 0.2s, color 0.2s;
    user-select: none;
    -webkit-user-select: none;
    padding: 10px 20px;
    cursor: pointer;
}

#load-world:hover {
    transform: scale(1.1);
    color: #0051a8;
}

.world-card {
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 100;
    transition: box-shadow 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Stili base migrati da JS */
    position: absolute;
    top: 0;
    left: 0;
    width: 180px;
    height: 180px;
    border-radius: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    will-change: transform;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.3);
    contain: layout style paint;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    background-color: var(--bg-color, rgba(255, 255, 255, 0.75));
    color: var(--text-color, white);
    padding: 14px;
    box-sizing: border-box;
}

/* Rimuove il padding per le card a tutto schermo */
.world-card.full-image {
    padding: 0 !important;
}

/* Dimensioni Mobile */
@media (max-width: 768px) {
    .world-card {
        width: 150px;
        height: 150px;
        border-radius: 22px;
        padding: 8px;
    }
}

/* Varianti per tipo */
.world-card.type-avatar,
.world-card.type-user_search {
    width: 180px !important;
    height: 180px !important;
    border-radius: 50% !important;
}

@media (max-width: 768px) {
    .world-card.type-avatar,
    .world-card.type-user_search {
        width: 150px !important;
        height: 150px !important;
    }
}

.world-card.type-gallery,
.world-card.type-slider,
.world-card.type-mood {
    width: 180px !important;
    height: 180px !important;
    padding: 0;
}

@media (max-width: 768px) {
    .world-card.type-gallery,
    .world-card.type-slider,
    .world-card.type-mood {
        width: 150px !important;
        height: 150px !important;
    }
}

/* Stili per immagini galleria */
.world-card-img-container {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    border-radius: inherit;
    position: absolute;
    top: 0;
    left: 0;
}

.world-card-img {
    width: 100% !important;
    height: 100% !important;
    min-width: 105% !important;
    min-height: 105% !important;
    object-fit: cover !important;
    object-position: var(--pos, center);
    transform: scale(var(--zoom, 1.1));
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Stili Slider */
.slider-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 102%;
    min-height: 102%;
    background-size: cover;
    background-position: var(--pos, center);
    transform: scale(var(--zoom, 1.1));
    background-repeat: no-repeat;
    transition: opacity 1s ease-in-out;
    border-radius: inherit;
}

.slider-layer.layer-1 { opacity: 1; }
.slider-layer.layer-2 { opacity: 0; }

.world-card:hover {
    box-shadow: 0 30px 60px rgba(0,0,0,0.3) !important;
    filter: blur(0px) !important;
    opacity: 1 !important;
    z-index: 500; /* Resta sotto l'header (2000) */
}

/* EFFETTO VIRAL - Bordo Multicolor animato */
.card-viral-effect {
    border: 3px solid transparent !important;
    animation: borderMulticolor 6s infinite linear !important;
    box-shadow: 0 0 20px rgba(255, 149, 0, 0.4) !important;
}

@keyframes borderMulticolor {
    0%   { border-color: #ff9500; box-shadow: 0 0 20px rgba(255, 149, 0, 0.4); }
    12%  { border-color: #007aff; box-shadow: 0 0 20px rgba(0, 122, 255, 0.4); }
    25%  { border-color: #34c759; box-shadow: 0 0 20px rgba(52, 199, 89, 0.4); }
    37%  { border-color: #ff2d55; box-shadow: 0 0 20px rgba(255, 45, 85, 0.4); }
    50%  { border-color: #5856d6; box-shadow: 0 0 20px rgba(88, 86, 214, 0.4); }
    62%  { border-color: #ffcc00; box-shadow: 0 0 20px rgba(255, 204, 0, 0.4); }
    75%  { border-color: #5ac8fa; box-shadow: 0 0 20px rgba(90, 200, 250, 0.4); }
    87%  { border-color: #af52de; box-shadow: 0 0 20px rgba(175, 82, 222, 0.4); }
    100% { border-color: #ff9500; box-shadow: 0 0 20px rgba(255, 149, 0, 0.4); }
}

.world-card .author-tag {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    background: none;
    color: white;
    padding: 0;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.world-card:hover .author-tag {
    opacity: 1;
}

.world-title {
    font-size: 3.5rem; /* Ridimensionato per stare in alto */
    font-weight: 900;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    justify-content: center;
    gap: 2px;
}

.letter-multicolor {
    display: inline-block;
    animation: textMulticolor 8s infinite linear;
}

/* Delay per effetto lettera per lettera */
.letter-multicolor:nth-child(1) { animation-delay: 0s; }
.letter-multicolor:nth-child(2) { animation-delay: -0.5s; }
.letter-multicolor:nth-child(3) { animation-delay: -1s; }
.letter-multicolor:nth-child(4) { animation-delay: -1.5s; }
.letter-multicolor:nth-child(5) { animation-delay: -2s; }

.world-overlay {
    position: fixed;
    top: 80px; /* Torna in alto */
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10; /* Base bassa per l'overlay */
    pointer-events: none;
}

.world-title-container {
    position: fixed; /* Forza fixed per stare sopra tutto */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
    z-index: 11000 !important; /* Molto alto per stare sopra le card (1000) */
    pointer-events: none;
}


.world-subtitle {
    color: white;
}

.text-multicolor {
    display: inline-block;
    animation: textMulticolor 8s infinite linear;
    font-weight: 900;
}

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


.world-card-emoji {
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.world-card.full-image .world-card-emoji {
    object-fit: cover !important;
}

.world-card-text {
    z-index: 2;
    display: block;
    position: relative;
}

/* Nascondi la rotellina delle impostazioni durante la modalità World (Desktop & Mobile) */
body.world-view .header-settings,
body.world-view #load-settings,
body.world-view #mobile-settings-item,
body:has(.world-title) .header-settings,
body:has(.world-title) #load-settings,
body:has(.world-title) #mobile-settings-item {
    display: none !important;
}

/* Stile Desktop per Titolo World */
@media (min-width: 1024px) {
    .world-title {
        font-size: 8rem;
        letter-spacing: 10px;
        text-shadow: 0 10px 40px rgba(0,0,0,0.5);
    }
}

/* RIMOSSO - SPOSTATO IN Mobile.css */

/* Stile Citazioni nel World (identico al profilo) */
.world-card-text.world-quote-text {
    font-family: 'Georgia', serif !important;
    font-style: italic !important;
    text-transform: none !important;
}

.world-card-text.world-quote-text::before {
    content: '“';
    font-size: 1.5rem;
    color: #8e8e93;
    margin-right: 4px;
    font-weight: 700;
}

/* === FILTRI WORLD (DESKTOP & MOBILE) === */
.world-filters-bar {
    position: fixed;
    top: 60px; /* Sotto la header */
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), top 0.3s ease;
    width: 90%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 1500;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 15px 20px 22px 20px;
    border-radius: 0 0 25px 25px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-top: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    overflow: visible;
}

body.has-marquee .world-filters-bar {
    top: 90px;
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.search-row {
    margin-bottom: 2px;
}

.top-row {
    margin-bottom: 2px;
}

.bottom-row {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 8px;
}

.world-filters-bar.open {
    transform: translateX(-50%) translateY(0);
}

/* Rimpicciolisce e adatta i filtri al mobile */
@media (max-width: 768px) {
    .world-filters-bar {
        width: 98%;
        gap: 8px;
        padding: 15px 15px 25px 15px; /* Aumentato padding bottom */
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(35px);
        border-radius: 0 0 30px 30px;
    }
    .filter-row {
        gap: 8px;
    }
    .world-filter-btn {
        padding: 5px 12px !important;
        font-size: 0.75rem !important;
    }
    .world-filter-input {
        max-width: 90px !important;
        font-size: 0.75rem !important;
    }
}

.world-filter-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 6px 18px;
    font-size: 0.8rem;
    color: #1c1c1e;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.world-filter-btn:hover {
    background: white;
}

.world-filter-btn.active {
    animation: buttonMulticolor 8s infinite linear;
    color: white !important;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.custom-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    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: 12000; /* Assicura che sia SOPRA la scritta WORLD */
    margin-top: 12px;
    flex-direction: column;
    overflow: hidden;
}

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

.dropdown-item {
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1c1c1e;
    cursor: pointer;
    border-bottom: 0.5px solid rgba(0,0,0,0.05);
    transition: background 0.2s;
    white-space: nowrap;
}

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

.dropdown-item:hover {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

@media (max-width: 768px) {
    .custom-dropdown-content {
        position: fixed;
        top: 110px; /* Sotto la barra filtri mobile */
        width: 80%;
        max-width: 280px;
    }
}

/* Lente per aprire i filtri */
.world-filter-toggle {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 100%);
    margin-top: 0;
    z-index: 1505;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
    border-radius: 0 0 15px 15px;
    padding: 0 !important;
    width: 60px;
    height: 32px;
    cursor: pointer;
    font-size: 1.6rem !important;
    color: #007aff;
    transition: all 0.3s ease;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* === RICERCA INTEGRATA NEI FILTRI (v21.22) === */
.search-row {
    width: 100%;
    padding: 0 10px;
}

#world-search-input {
    width: 100%;
    border: 1.5px solid rgba(0, 122, 255, 0.2);
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
    font-weight: 600;
    transition: all 0.3s ease;
}

#world-search-input:focus {
    border-color: #007aff;
    background: white;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.1);
}

.world-filter-toggle .toggle-arrow {
    display: inline-block;
    transition: transform 0.4s ease;
    pointer-events: none;
    font-size: 1.1rem;
}

.world-filter-toggle.bar-open .toggle-arrow {
    transform: rotate(360deg) scale(1.3);
    color: #ff9500;
}
