/* ==============================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ============================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-dark: #09040e;
    --bg-deep: #0e0717;
    --bg-card: rgba(22, 11, 36, 0.65);
    --border-glass: rgba(255, 255, 255, 0.06);
    --primary: #ff2a74;
    --primary-glow: rgba(255, 42, 116, 0.4);
    --secondary: #7b2cbf;
    --secondary-glow: rgba(123, 44, 191, 0.4);
    --accent: #00f5d4;
    --accent-glow: rgba(0, 245, 212, 0.4);
    --text-main: #f3eefc;
    --text-muted: #9b8cb8;
    --gradient-primary: linear-gradient(135deg, #ff2a74, #7b2cbf);
    --gradient-accent: linear-gradient(135deg, #00f5d4, #7b2cbf);
    --gradient-dark: linear-gradient(180deg, #09040e 0%, #150924 100%);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-main: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    --blur: 16px;
}

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

html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden !important;
}

body {
    background: var(--gradient-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
}


h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Sfondo con particelle sfuocate (glows di atmosfera) */
.ambient-glow-1 {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--primary-glow) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

.ambient-glow-2 {
    position: fixed;
    bottom: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--secondary-glow) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(80px);
}

/* ==============================================================================
   COMPONENTI VETRO (GLASSMORPHISM)
   ============================================================================== */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    box-shadow: var(--shadow-main);
}

.glass-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.glass-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px var(--primary-glow);
}

.glass-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px !important;
}

/* Pulsanti */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 14px 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 14px 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* ==============================================================================
   PAGINE DI AUTENTICAZIONE (LOGIN / REGISTER)
   ============================================================================== */
html.auth-page-html, html.auth-page-html body {
    height: auto !important;
    min-height: 100% !important;
    overflow: auto !important;
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    padding: 48px 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-size: 2.8rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 8px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.auth-footer a:hover {
    text-shadow: 0 0 8px var(--primary-glow);
}

.alert-error {
    background: rgba(255, 42, 116, 0.15);
    border: 1px solid var(--primary);
    color: #ffb3c6;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
}

/* Griglia per la selezione degli interessi */
.interests-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.interest-pill-checkbox {
    cursor: pointer;
    display: inline-block;
    user-select: none;
}

.interest-pill-checkbox input {
    display: none;
}

.interest-pill-checkbox span {
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    white-space: nowrap;
}

.interest-pill-checkbox:hover span {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.interest-pill-checkbox input:checked + span {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* ==============================================================================
   LAYOUT PRINCIPALE (INDEX APP)
   ============================================================================== */
.app-header {
    height: 72px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 4, 14, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.app-logo {
    font-size: 1.8rem;
    font-family: var(--font-heading);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
    cursor: pointer;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.btn-logout:hover {
    color: var(--primary);
}

.main-container {
    flex: 1;
    display: grid;
    grid-template-columns: 380px 1fr;
    height: calc(100vh - 72px);
    overflow: hidden;
}

.main-container.sidebar-hidden {
    grid-template-columns: 1fr;
}

.main-content {
    min-height: 0;
}


/* Sidebar dei match e della chat */
.sidebar {
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    background: rgba(14, 7, 23, 0.4);
}

.sidebar-tabs {
    display: grid;
    grid-template-columns: 1fr;
    border-bottom: 1px solid var(--border-glass);
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    padding: 18px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(255, 42, 116, 0.03);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Lista delle Chat Attive */
.chats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    /* Previene overflow fuori dalla sidebar */
    min-width: 0;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-glass);
}

.chat-item.active {
    background: rgba(123, 44, 191, 0.15);
    border-color: rgba(123, 44, 191, 0.3);
}

.chat-item img {
    width: 50px;
    height: 50px;
    min-width: 50px;  /* non si restringe mai */
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary);
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;   /* fondamentale per text-overflow nei figli */
    overflow: hidden;
}

.chat-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 6px;
    min-width: 0;
}

.chat-name-row h4 {
    font-size: 0.93rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.chat-time {
    font-size: 0.73rem;
    color: var(--text-muted);
    flex-shrink: 0;   /* l'ora non si comprime mai */
    white-space: nowrap;
}

.chat-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================================================================
   SHUFFLE RADAR (connected2.me style)
   ============================================================================== */
.shuffle-section {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 36px;
    padding: 30px 40px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.shuffle-radar-container {
    width: 170px;
    height: 170px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-center-btn {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 10;
    box-shadow: 0 0 25px var(--primary-glow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.radar-center-btn i {
    font-size: 1.5rem;
}

.radar-center-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 35px var(--primary);
}

/* Onde concentriche animate */
.radar-wave {
    position: absolute;
    border: 1px solid rgba(0, 245, 212, 0.35);
    background: radial-gradient(circle, rgba(0, 245, 212, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    width: 90px;
    height: 90px;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    box-shadow: inset 0 0 15px rgba(0, 245, 212, 0.1), 0 0 15px rgba(0, 245, 212, 0.1);
}

/* Avvia l'animazione di pulsazione radar di base */
.wave1 { animation: radarPulse 3s linear infinite; }
.wave2 { animation: radarPulse 3s linear infinite; animation-delay: 1s; }
.wave3 { animation: radarPulse 3s linear infinite; animation-delay: 2s; }

@keyframes radarPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

/* Stato durante la ricerca attiva dello Shuffle */
.shuffle-radar-container.searching .radar-center-btn {
    background: var(--gradient-accent);
    box-shadow: 0 0 30px var(--accent-glow);
    pointer-events: none;
}

.shuffle-radar-container.searching .radar-center-btn i {
    animation: spin 1.2s linear infinite;
}

.shuffle-radar-container.searching .radar-wave {
    border-color: rgba(255, 42, 116, 0.4);
    background: radial-gradient(circle, rgba(255, 42, 116, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    box-shadow: inset 0 0 15px rgba(255, 42, 116, 0.1), 0 0 15px rgba(255, 42, 116, 0.1);
    animation-duration: 1.5s; /* Onde molto più veloci */
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.shuffle-text-info h3 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shuffle-text-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ==============================================================================
   BACHECA DISCOVER (connected2.me style)
   ============================================================================== */
.discover-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title-row h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.section-title-row p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.discover-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.discover-card:hover {
    transform: translateY(-4px);
    border-color: rgba(123, 44, 191, 0.25);
    box-shadow: 0 12px 30px rgba(123, 44, 191, 0.15);
}

.card-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.card-avatar-row img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card-name-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.card-name-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.card-bio-text {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    margin-bottom: 16px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    min-height: 52px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Colora i tag in base al testo per renderli dinamici e accattivanti */
.tag-pill.tag-musica { border-color: rgba(255, 42, 116, 0.3); color: #ff6097; }
.tag-pill.tag-sport { border-color: rgba(0, 245, 212, 0.3); color: #40ffd9; }
.tag-pill.tag-cinema { border-color: rgba(123, 44, 191, 0.3); color: #b060ff; }
.tag-pill.tag-viaggi { border-color: rgba(255, 183, 3, 0.3); color: #ffd166; }
.tag-pill.tag-tecnologia { border-color: rgba(6, 214, 160, 0.3); color: #52ffcf; }
.tag-pill.tag-cucina { border-color: rgba(239, 71, 111, 0.3); color: #ff6b8b; }
.tag-pill.tag-fotografia { border-color: rgba(17, 138, 178, 0.3); color: #4cc9f0; }
.tag-pill.tag-lettura { border-color: rgba(244, 162, 97, 0.3); color: #ffb57f; }

.btn-chat-direct {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-family: var(--font-heading);
    font-weight: 600;
}

/* ==============================================================================
   AREA DI CHAT COMPLETA
   ============================================================================= */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(9, 4, 14, 0.4);
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(14, 7, 23, 0.6);
}

.chat-partner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-partner-info img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.chat-partner-info h3 {
    font-size: 1.05rem;
}

.chat-partner-info span {
    font-size: 0.75rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg-bubble {
    max-width: 65%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.msg-bubble.incoming {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.msg-bubble.outgoing {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.msg-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    padding: 20px 24px;
    border-top: 1px solid var(--border-glass);
    background: rgba(14, 7, 23, 0.6);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
}

.btn-send {
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    width: 50px;
    height: 50px;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: all 0.3s ease;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 18px var(--primary-glow);
}

.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.chat-placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ==============================================================================
   MODAL DI IMPOSTAZIONI / PROFILO
   ============================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.profile-modal {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    position: relative;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--primary);
}

.profile-modal-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
}

.profile-modal-avatar-section img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-change-avatar {
    margin-top: 12px;
    font-size: 0.8rem;
    padding: 6px 14px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
}

/* ==============================================================================
   ANIMAZIONI
   ============================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* ==============================================================================
   RESPONSIVITÀ (MEDIA QUERIES)
   ============================================================================== */
@media (max-width: 900px) {
    body {
        height: 100vh !important;
        height: 100dvh !important;
        overflow: hidden !important;
        position: relative !important;
    }

    .bottom-nav {
        display: flex !important; /* Show bottom nav on mobile */
    }

    .main-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        height: calc(100vh - 72px - 65px) !important;
        height: calc(100dvh - 72px - 65px) !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        transition: height 0.3s ease;
    }
    
    .dashboard-container,
    .profile-container,
    .stories-page-container,
    .secrets-container,
    .admin-container {
        padding-bottom: 95px !important;
    }
    
    .sidebar {
        display: none;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        border-right: none !important;
        background: rgba(14, 7, 23, 0.4);
    }

    .main-content {
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Elegant coordinator body classes */
    body.show-sidebar-mobile .sidebar {
        display: flex !important;
    }
    
    body.show-sidebar-mobile .main-content {
        display: none !important;
    }
    
    body.chat-active-mobile .bottom-nav {
        display: none !important;
    }
    
    body.chat-active-mobile .main-container {
        height: calc(100vh - 72px) !important;
        height: calc(100dvh - 72px) !important;
    }

    .shuffle-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 24px;
        gap: 20px;
    }

    .shuffle-radar-container {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0 20px;
    }
}

/* ==============================================================================
   NEOFEX VIP & CHAT ANONIMA PROGRESSIVA
   ============================================================================== */

/* Stili per le Card e Badge dei VIP */
@keyframes goldGlow {
    0% { box-shadow: 0 8px 32px 0 rgba(255, 183, 3, 0.15), 0 0 10px rgba(255, 183, 3, 0.05); border-color: rgba(255, 255, 255, 0.06); }
    100% { box-shadow: 0 8px 32px 0 rgba(255, 183, 3, 0.35), 0 0 20px rgba(255, 183, 3, 0.5); border-color: rgba(255, 183, 3, 0.85); }
}

.discover-card.vip {
    border: 1px solid rgba(255, 183, 3, 0.4) !important;
    background: linear-gradient(135deg, rgba(22, 11, 36, 0.75), rgba(45, 30, 10, 0.65)) !important;
    animation: goldGlow 3s ease infinite alternate;
}

.vip-crown {
    color: #ffb703;
    text-shadow: 0 0 8px rgba(255, 183, 3, 0.8);
    margin-left: 8px;
    animation: crownPulse 2s ease infinite alternate;
}

@keyframes crownPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 1px rgba(255, 183, 3, 0.4)); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 5px rgba(255, 183, 3, 0.9)); }
}

/* Sfocatura Avatar per Chat Anonima */
.masked-avatar {
    filter: blur(14px) grayscale(0.2);
    transition: filter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.95);
}

.masked-avatar.revealed {
    filter: blur(0px) grayscale(0);
    transform: scale(1);
}

/* Barra di Progresso dell'interazione in Chat Header */
.interaction-bar-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 200px;
    margin-left: auto;
    margin-right: 16px;
    text-align: right;
}

.interaction-bar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.interaction-bar-label strong {
    color: var(--accent);
    text-shadow: 0 0 6px var(--accent-glow);
}

.interaction-bar-bg {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.interaction-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 8px var(--accent-glow);
    border-radius: 4px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulsante di Sblocco immediato VIP */
.btn-vip-reveal {
    background: linear-gradient(135deg, #ffb703, #fb8500);
    color: #000 !important;
    border: none;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 6px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 10px rgba(255, 183, 3, 0.4);
    transition: all 0.3s ease;
    margin-right: 12px;
}

.btn-vip-reveal:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(255, 183, 3, 0.7);
    filter: brightness(1.1);
}

.btn-vip-reveal i {
    font-size: 0.85rem;
}

/* Contenitore VIP all'interno del Profilo Modal */
.profile-vip-card {
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.06) 0%, rgba(22, 11, 36, 0.8) 100%);
    border: 1px solid rgba(255, 183, 3, 0.2);
    border-radius: 18px;
    padding: 18px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-vip-info {
    flex: 1;
}

.profile-vip-info h4 {
    color: #ffb703;
    font-size: 1.15rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 8px rgba(255, 183, 3, 0.2);
}

.profile-vip-info p {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.btn-toggle-vip {
    background: linear-gradient(135deg, #ffb703, #fb8500);
    color: #000;
    font-weight: 800;
    font-family: var(--font-heading);
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 183, 3, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-toggle-vip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 183, 3, 0.55);
}

.btn-toggle-vip.active {
    background: linear-gradient(135deg, #ffe169, #ffb703, #fb8500) !important;
    color: #000 !important;
    border: 1px solid #fff !important;
    box-shadow: 0 0 20px rgba(255, 183, 3, 0.8), inset 0 0 8px rgba(255, 255, 255, 0.6) !important;
    font-weight: 800;
    animation: goldVipGlow 1.5s ease-in-out infinite alternate !important;
}

.btn-toggle-vip.active:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 0 30px rgba(255, 183, 3, 0.95), inset 0 0 10px rgba(255, 255, 255, 0.8) !important;
}

.profile-modal.vip-glow {
    border: 2px solid #ffb703 !important;
    box-shadow: 0 0 35px rgba(255, 183, 3, 0.45), var(--shadow-main) !important;
    animation: vipModalGlow 3s ease infinite alternate, scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.profile-page-card.vip-glow {
    border: 2px solid #ffb703 !important;
    box-shadow: 0 0 35px rgba(255, 183, 3, 0.45), var(--shadow-main) !important;
    animation: vipModalGlow 3s ease infinite alternate, scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes goldVipGlow {
    0% { box-shadow: 0 0 12px rgba(255, 183, 3, 0.6), inset 0 0 4px rgba(255, 255, 255, 0.4); }
    100% { box-shadow: 0 0 24px rgba(255, 183, 3, 0.9), inset 0 0 10px rgba(255, 255, 255, 0.8); }
}

@keyframes vipModalGlow {
    0% { box-shadow: 0 0 20px rgba(255, 183, 3, 0.3), var(--shadow-main); border-color: rgba(255, 183, 3, 0.4); }
    100% { box-shadow: 0 0 40px rgba(255, 183, 3, 0.6), var(--shadow-main); border-color: rgba(255, 183, 3, 0.95); }
}

.vip-limit-tag {
    background: rgba(255, 183, 3, 0.12);
    border: 1px solid rgba(255, 183, 3, 0.25);
    color: #ffd166;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 6px;
    display: inline-block;
}

/* ==============================================================================
   STORIES, UNREAD BADGES, AND TOAST NOTIFICATIONS
   ============================================================================== */

/* Badge Notifiche nella Sidebar */
.unread-badge {
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 8px var(--primary);
    margin-left: 8px;
    animation: badgePulse 1.5s infinite alternate;
}

@keyframes badgePulse {
    0% { transform: scale(1); box-shadow: 0 0 6px var(--primary); }
    100% { transform: scale(1.15); box-shadow: 0 0 12px var(--primary); }
}

/* Toast Notifications Container */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Single Toast Item */
.toast-notification {
    pointer-events: auto;
    width: 320px;
    background: rgba(22, 11, 36, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--primary);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px var(--primary-glow);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    opacity: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.toast-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--primary);
}

/* Stories Layout */
.stories-container {
    padding: 16px 24px;
    margin-bottom: 5px;
    overflow: hidden;
}

.stories-tray {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.stories-tray::-webkit-scrollbar {
    height: 4px;
}

.stories-tray::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.story-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-width: 76px;
    user-select: none;
}

.story-avatar-wrapper {
    position: relative;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

/* Neon animated spinning border for unviewed stories */
.story-avatar-wrapper::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}

.story-bubble.viewed .story-avatar-wrapper::after {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

/* Special vip outline stories */
.story-bubble.vip .story-avatar-wrapper::after {
    background: linear-gradient(135deg, #ffb703, #fb8500, #ffb703);
    box-shadow: 0 0 12px rgba(255, 183, 3, 0.5);
    animation: goldRotate 4s linear infinite;
}

@keyframes goldRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.story-avatar-wrapper img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-dark);
}

.story-bubble span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 76px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.story-bubble:hover span {
    color: var(--text-main);
}

/* Plus Badge for Current User Add Story Bubble */
.story-add-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
    border: 2px solid var(--bg-dark);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Story gradients */
.gradient-pink { background: linear-gradient(135deg, #ff2a74, #7b2cbf); }
.gradient-cyan { background: linear-gradient(135deg, #00f5d4, #7b2cbf); }
.gradient-gold { background: linear-gradient(135deg, #ffb703, #fb8500); }
.gradient-purple { background: linear-gradient(135deg, #7b2cbf, #2d00f7); }

.gradient-preview {
    display: block;
    width: 100%;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.gradient-option-label input {
    display: none;
}

.gradient-option-label input:checked + .gradient-preview {
    border-color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Fullscreen Story Viewer */
.story-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.story-viewer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.story-viewer-container {
    width: 100%;
    max-width: 450px;
    height: 100vh;
    max-height: 800px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 42, 116, 0.15);
}

@media (max-width: 480px) {
    .story-viewer-container {
        max-height: 100vh;
        border-radius: 0;
    }
}

/* Indicators progress bars */
.story-progress-bar {
    position: absolute;
    top: 15px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10002;
}

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

.story-progress-fill {
    height: 100%;
    background: #ffffff;
    width: 0%;
    /* Transition is set dynamically via JS */
}

/* Header inside story viewer */
.story-viewer-header {
    position: absolute;
    top: 30px;
    left: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10001;
    pointer-events: auto;
}

.story-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-author-info img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.story-author-info h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.story-author-info span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.story-viewer-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.4rem;
    transition: color 0.2s;
    padding: 5px;
}

.story-viewer-close:hover {
    color: #fff;
}

/* Story Content Body */
.story-viewer-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 40px;
}

.story-text-display {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    max-width: 90%;
}

.story-image-display {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

.story-image-caption {
    position: absolute;
    bottom: 40px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 12px 18px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    word-break: break-word;
}

/* Click target controls for prev/next */
.story-nav-click {
    position: absolute;
    top: 80px;
    bottom: 0;
    width: 50%;
    z-index: 10000;
    cursor: pointer;
}

.story-nav-click.left {
    left: 0;
}

.story-nav-click.right {
    right: 0;
}

/* ==============================================================================
   BOTTOM NAVIGATION BAR FOR MOBILE (GLASSMORPHISM & GLOWS)
   ============================================================================== */
.bottom-nav {
    display: none; /* Desktop hidden */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(14, 7, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-glass);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s;
}

.bottom-nav-item:hover i {
    transform: translateY(-2px);
}

.bottom-nav-item.active {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

.bottom-nav-item.active i {
    color: var(--primary);
    filter: drop-shadow(0 0 6px var(--primary-glow));
    transform: scale(1.15) translateY(-2px);
}

/* Red neon pulsate badge for total unread counts */
.unread-badge-total {
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 0 10px var(--primary);
    position: absolute;
    top: -6px;
    right: -10px;
    animation: totalBadgePulse 1.2s infinite alternate;
}

@keyframes totalBadgePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 5px var(--primary); }
    100% { transform: scale(1.15); box-shadow: 0 0 12px var(--primary); }
}

/* ==============================================================================
   PAGINA PROFILO DEDICATA (RESPONSIVE & ANIMATA)
   ============================================================================== */
.profile-container {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    width: 100%;
}

.profile-page-card {
    max-width: 580px;
    margin: 0 auto;
    padding: 36px;
    position: relative;
    width: 100%;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==============================================================================
   RESPONSIVITÀ CHAT HEADER SU MOBILE
   ============================================================================== */
@media (max-width: 600px) {
    .chat-header {
        padding: 10px 14px;
        gap: 8px;
    }
    
    .chat-partner-info {
        gap: 6px;
    }
    
    .chat-partner-info img {
        width: 36px;
        height: 36px;
    }
    
    .chat-partner-info h3 {
        font-size: 0.95rem;
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .btn-back-chat {
        flex-shrink: 0;
        padding: 8px 10px !important;
        min-width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .back-btn-text {
        display: none !important;
    }

    .interaction-bar-container {
        width: 105px !important;
        margin-right: 0 !important;
        gap: 2px;
    }

    .btn-vip-reveal {
        padding: 6px 8px !important;
        font-size: 0.7rem !important;
        margin-right: 2px !important;
        flex-shrink: 0;
    }
}

/* ==============================================================================
   DEDICATED STORIES SCREEN, VIP FILTERS & DESKTOP NAVIGATION
   ============================================================================== */

/* Desktop Navigation Menu */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 auto;
}

.desktop-nav-item {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.desktop-nav-item i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.desktop-nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-glass);
}

.desktop-nav-item:hover i {
    transform: scale(1.1);
}

.desktop-nav-item.active {
    color: var(--primary);
    background: rgba(255, 42, 116, 0.08);
    border-color: rgba(255, 42, 116, 0.2);
    box-shadow: 0 0 15px rgba(255, 42, 116, 0.1);
}

.desktop-nav-item.active i {
    color: var(--primary);
}

/* Stories Page Styling */
.stories-page-container {
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.stories-page-header {
    border: 1px solid var(--border-glass);
}

/* VIP Filter Pills */
.stories-filter-pills {
    display: flex;
}

.filter-pill {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-pill:hover {
    color: var(--text-main);
}

.filter-pill.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Stories Responsive Grid */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 24px;
    width: 100%;
}

/* Glassmorphism Story Card */
.story-card {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid var(--border-glass);
    background: rgba(22, 11, 36, 0.5);
    height: 250px;
}

.story-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 12px 35px rgba(255, 42, 116, 0.2), 0 0 15px var(--primary-glow);
}

/* Special styling for VIP Story Cards */
.story-card.vip {
    border-color: rgba(255, 183, 3, 0.45);
    background: linear-gradient(135deg, rgba(22, 11, 36, 0.75), rgba(45, 30, 10, 0.65));
    animation: goldGlow 3s ease infinite alternate;
}

.story-card.vip:hover {
    border-color: rgba(255, 183, 3, 1);
    box-shadow: 0 12px 35px rgba(255, 183, 3, 0.35), 0 0 25px rgba(255, 183, 3, 0.6);
}

/* Card Preview Area */
.story-card-preview {
    flex: 1;
    height: 180px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.story-preview-text {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
    max-width: 85%;
    padding: 12px;
}

.story-preview-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.video-preview {
    position: relative;
}

.video-play-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    font-size: 0.9rem;
    z-index: 2;
    transition: transform 0.3s ease;
}

.story-card:hover .video-play-overlay {
    transform: scale(1.1);
}

/* Card Meta Footer */
.story-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(9, 4, 14, 0.5);
    border-top: 1px solid var(--border-glass);
    z-index: 2;
}

.story-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.story-card-meta {
    flex: 1;
    min-width: 0;
}

.story-card-meta h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.story-card-meta span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Hide desktop navigation on mobile screens */
@media (max-width: 900px) {
    .desktop-nav {
        display: none !important;
    }
}

/* ==============================================================================
   5-TAB BOTTOM NAVIGATION & RESPONSIVITY FOR MOBILE
   ============================================================================== */
@media (max-width: 600px) {
    .bottom-nav-item {
        font-size: 0.65rem !important;
        gap: 2px !important;
    }
    .bottom-nav-item i {
        font-size: 1.1rem !important;
    }
}

/* ==============================================================================
   GALLERIA FOTOGRAFICA PROFILO (MAX 6 FOTO)
   ============================================================================== */
.profile-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
    width: 100%;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover {
    border-color: rgba(255, 42, 116, 0.3);
    box-shadow: 0 4px 15px rgba(255, 42, 116, 0.15);
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-item .btn-delete-photo {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 42, 116, 0.85);
    border: none;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
    opacity: 0;
    z-index: 10;
}

.gallery-item:hover .btn-delete-photo {
    opacity: 1;
}

.gallery-item .btn-delete-photo:hover {
    background: #ff2a74;
    transform: scale(1.15);
    box-shadow: 0 0 10px var(--primary-glow);
}

.gallery-placeholder {
    aspect-ratio: 1 / 1;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.01);
}

.gallery-placeholder:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: rgba(255, 42, 116, 0.04);
    box-shadow: 0 0 12px var(--primary-glow);
}

.gallery-placeholder i {
    font-size: 1.4rem;
    margin-bottom: 6px;
    transition: transform 0.2s;
}

.gallery-placeholder:hover i {
    transform: scale(1.1);
}

.gallery-placeholder span {
    font-size: 0.72rem;
    font-weight: 500;
}

/* ==============================================================================
   BACHECA SEGRETI (INSEGRETO NEON STYLE)
   ============================================================================== */
.secret-card {
    border-radius: 24px;
    border: 1px solid var(--border-glass);
    background: rgba(22, 11, 36, 0.6);
    box-shadow: var(--shadow-main);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.secret-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
}

.secret-card-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-muted);
}

.secret-card-header i {
    font-size: 1.1rem;
}

.secret-card-header.uomo i {
    color: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent-glow));
}

.secret-card-header.donna i {
    color: var(--primary);
    filter: drop-shadow(0 0 4px var(--primary-glow));
}

.secret-card-header.altro i {
    color: var(--secondary);
    filter: drop-shadow(0 0 4px var(--secondary-glow));
}

.secret-card-body {
    padding: 40px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    text-align: center;
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    word-break: break-word;
    position: relative;
    overflow: hidden;
}

.secret-card-body::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.05);
    font-family: serif;
    line-height: 1;
}

.secret-card-footer {
    padding: 14px 24px;
    background: rgba(9, 4, 14, 0.5);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;  /* mai su due righe */
}

.secret-action-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 7px 13px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;   /* impedisce il wrap del testo */
    flex-shrink: 1;
}

.secret-action-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.secret-action-btn i {
    font-size: 1.05rem;
}

.secret-action-btn.vote-btn:hover, .secret-action-btn.vote-btn.active {
    color: var(--accent) !important;
    border-color: rgba(0, 245, 212, 0.2) !important;
    background: rgba(0, 245, 212, 0.06) !important;
    box-shadow: 0 0 12px var(--accent-glow) !important;
}

.secret-action-btn.comment-btn:hover, .secret-action-btn.comment-btn.active {
    color: var(--primary) !important;
    border-color: rgba(255, 42, 116, 0.2) !important;
    background: rgba(255, 42, 116, 0.06) !important;
    box-shadow: 0 0 12px var(--primary-glow) !important;
}

/* ==============================================================================
   AREA COMMENTI PROFILATI
   ============================================================================== */
.secret-comments-box {
    border-top: 1px solid var(--border-glass);
    background: rgba(10, 5, 18, 0.6);
    backdrop-filter: blur(8px);
    padding: 20px 24px;
    display: none; /* JS toggling */
    flex-direction: column;
    gap: 16px;
}

.secret-comments-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 6px;
}

.secret-comments-list::-webkit-scrollbar {
    width: 5px;
}

.secret-comments-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}

.comment-avatar.vip {
    border-color: #ffb703;
    box-shadow: 0 0 8px rgba(255, 183, 3, 0.4);
}

.comment-content-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px 12px;
    border-radius: 12px;
    flex: 1;
    min-width: 0;
}

.comment-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-username {
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 0.88rem;
}

.comment-username i {
    font-size: 0.75rem;
    margin-left: 4px;
}

.comment-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.comment-text {
    color: rgba(255, 255, 255, 0.85);
    word-break: break-word;
}

.comment-input-form {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    width: 100%;
}

.comment-input {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    border-radius: 12px !important;
    flex: 1;
}

.btn-comment-submit {
    padding: 0 16px !important;
    border-radius: 12px !important;
    font-size: 0.88rem !important;
    height: 42px;
}

/* ==============================================================================
   COMPONENTI TELL (DOMANDE E RISPOSTE ANONIME)
   ============================================================================== */
.tell-card {
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    transition: all 0.25s ease;
    animation: slideUp 0.3s ease;
}

.tell-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
}

.tell-question-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tell-question-icon {
    color: var(--accent);
    font-size: 1.2rem;
    margin-top: 2px;
    filter: drop-shadow(0 0 3px var(--accent-glow));
}

.tell-question-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.45;
    word-break: break-word;
}

.tell-answer-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 14px;
}

.tell-answer-icon {
    color: var(--primary);
    font-size: 1.2rem;
    margin-top: 2px;
    filter: drop-shadow(0 0 3px var(--primary-glow));
}

.tell-answer-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.45;
    word-break: break-word;
}

.tell-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 10px;
}

.tell-action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 0.8rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tell-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    transform: translateY(-1px);
}

.tell-action-btn.delete-btn:hover {
    background: rgba(255, 42, 116, 0.1) !important;
    border-color: rgba(255, 42, 116, 0.2) !important;
    color: var(--primary) !important;
    box-shadow: 0 0 10px var(--primary-glow);
}

.tell-action-btn.answer-btn:hover {
    background: rgba(0, 245, 212, 0.1) !important;
    border-color: rgba(0, 245, 212, 0.2) !important;
    color: var(--accent) !important;
    box-shadow: 0 0 10px var(--accent-glow);
}

.tell-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 40px 20px;
    font-style: italic;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

/* ==============================================================================
   SPICY / HOT ZONE STYLING (RED NEON & BURST EFFECTS)
   ============================================================================== */

/* Bordo piccante rosso neon per segreti/storie hot */
.secret-card.spicy {
    border-color: rgba(255, 42, 116, 0.7) !important;
    box-shadow: 0 0 15px rgba(255, 42, 116, 0.4) !important;
}

.secret-card-header.spicy {
    background: rgba(255, 42, 116, 0.25) !important;
    border-bottom: 1px solid rgba(255, 42, 116, 0.4) !important;
    color: #ff2a74 !important;
    text-shadow: 0 0 8px rgba(255, 42, 116, 0.5) !important;
}

/* Switches cyberpunk */
.cyber-switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: rgba(255,255,255,0.7);
    transition: .4s;
    border-radius: 50%;
}

.cyber-switch-label input:checked + .cyber-switch-slider {
    background-color: rgba(255, 42, 116, 0.2);
    border-color: #ff2a74;
    box-shadow: 0 0 8px rgba(255, 42, 116, 0.4);
}

.cyber-switch-label input:checked + .cyber-switch-slider.hot {
    background-color: rgba(255, 183, 3, 0.2);
    border-color: #ffb703;
    box-shadow: 0 0 8px rgba(255, 183, 3, 0.4);
}

.cyber-switch-label input:checked + .cyber-switch-slider:before {
    transform: translateX(22px);
    background-color: #ff2a74;
    box-shadow: 0 0 8px rgba(255, 42, 116, 0.8);
}

.cyber-switch-label input:checked + .cyber-switch-slider.hot:before {
    background-color: #ffb703;
    box-shadow: 0 0 8px rgba(255, 183, 3, 0.8);
}

/* Cassetto Giphy */
.giphy-drawer {
    background: rgba(14, 7, 23, 0.95);
    border-top: 1px solid var(--border-glass);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.giphy-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.giphy-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding-top: 4px;
}

.giphy-results-grid img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.giphy-results-grid img:hover {
    border-color: var(--accent);
    transform: scale(1.03);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Pulsanti multimediali in chat */
.btn-chat-media {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.btn-chat-media:hover {
    color: var(--accent);
    background: rgba(0, 245, 212, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Foto sfocata con consenso in chat */
.chat-media-blurred-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    max-width: 250px;
    margin: 8px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
}

.chat-media-image {
    width: 100%;
    display: block;
    border-radius: 16px;
    object-fit: cover;
    max-height: 200px;
    transition: filter 0.5s ease;
}

.chat-media-image.blurred {
    filter: blur(18px) brightness(0.65);
}

.chat-media-consent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    text-align: center;
    z-index: 2;
}

.chat-media-consent-overlay span {
    font-size: 0.8rem;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.chat-media-approve-btn {
    background: linear-gradient(135deg, var(--accent), #15e6cd);
    border: none;
    border-radius: 10px;
    color: #0e0717;
    padding: 6px 12px;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

.chat-media-approve-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Onde Shuffle Piccanti (Hot Scan) */
.radar-wave.hot {
    border-color: rgba(255, 42, 116, 0.35) !important;
}

/* Pulsante Mutual Crush */
.btn-toggle-crush.active {
    background: #ff2a74 !important;
    color: #0e0717 !important;
    border-color: #ff2a74 !important;
    box-shadow: 0 0 15px rgba(255, 42, 116, 0.6) !important;
}
.btn-toggle-crush:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(255, 42, 116, 0.4) !important;
}

/* Animazione Mutual Crush Overlay */
@keyframes heartGlow {
    from { transform: scale(1); filter: drop-shadow(0 0 8px rgba(255, 42, 116, 0.5)); }
    to { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(255, 42, 116, 0.95)); }
}
.heart-pulse-glow {
    animation: heartGlow 0.8s ease infinite alternate !important;
}

/* Responsività Pagina Profilo */
@media (max-width: 600px) {
    .profile-container {
        padding: 15px 10px 95px 10px !important;
    }
    .profile-page-card {
        padding: 20px 16px !important;
    }
    .profile-preferences-grid {
        gap: 8px !important;
    }
    .profile-preferences-grid .form-group label {
        font-size: 0.78rem !important;
    }
    .profile-preferences-grid .glass-input {
        padding: 10px 8px !important;
        font-size: 0.9rem !important;
    }
    .profile-preferences-grid select.glass-select {
        padding-right: 28px !important;
        background-position: right 6px center !important;
        background-size: 16px !important;
    }
}

/* ==============================================================================
   VIP CUSTOMIZATIONS & BORDERS 👑🛰️
   ============================================================================== */

/* Cyber Cyan Bordo Rotante */
.border-cyber-cyan {
    position: relative;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    animation: cyanPulse 2s ease infinite alternate;
    border: 3.5px solid #00f0ff !important;
}
@keyframes cyanPulse {
    0% { box-shadow: 0 0 8px rgba(0, 240, 255, 0.4), inset 0 0 4px rgba(0, 240, 255, 0.2); }
    100% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.8), inset 0 0 10px rgba(0, 240, 255, 0.4); }
}

/* Ruby Glow Bordo Pulsante */
.border-ruby-glow {
    position: relative;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
    animation: rubyPulse 1.8s ease infinite alternate;
    border: 3.5px solid #ff0055 !important;
}
@keyframes rubyPulse {
    0% { box-shadow: 0 0 8px rgba(255, 0, 85, 0.4), inset 0 0 4px rgba(255, 0, 85, 0.2); }
    100% { box-shadow: 0 0 22px rgba(255, 0, 85, 0.9), inset 0 0 12px rgba(255, 0, 85, 0.5); }
}

/* Gold Pulse Bordo Regale con Corona */
.border-gold-pulse {
    position: relative;
    box-shadow: 0 0 15px rgba(255, 183, 3, 0.4);
    animation: goldPulse 2s ease infinite alternate;
    border: 3.5px solid #ffb703 !important;
}
@keyframes goldPulse {
    0% { box-shadow: 0 0 8px rgba(255, 183, 3, 0.4), inset 0 0 4px rgba(255, 183, 3, 0.2); }
    100% { box-shadow: 0 0 24px rgba(255, 183, 3, 0.95), inset 0 0 14px rgba(255, 183, 3, 0.5); }
}

/* VIP Crown Badge Overlay */
.vip-crown-badge {
    position: absolute;
    top: -6px;
    right: -4px;
    background: linear-gradient(135deg, #ffb703, #fb8500);
    color: #0e0717;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    border: 1.5px solid #fff;
    box-shadow: 0 0 8px rgba(255, 183, 3, 0.8);
    z-index: 10;
    animation: crownBounce 2s ease infinite;
}
@keyframes crownBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ==============================================================================
   GAMEPAD ICEBREAKER CHAT CARD 🎮
   ============================================================================== */
.msg-bubble.icebreaker {
    background: linear-gradient(135deg, rgba(22, 11, 36, 0.95) 0%, rgba(98, 0, 238, 0.25) 100%) !important;
    border: 1.5px solid #00f0ff !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.35), inset 0 0 10px rgba(0, 240, 255, 0.1) !important;
    color: #fff !important;
    padding: 16px 20px !important;
    border-radius: 18px !important;
    max-width: 85% !important;
    text-align: center !important;
    font-family: var(--font-heading) !important;
    font-weight: 500 !important;
    margin: 15px auto !important;
    position: relative;
    animation: icebreakerGlow 3s ease infinite alternate;
}
@keyframes icebreakerGlow {
    0% { box-shadow: 0 0 10px rgba(0, 240, 255, 0.2), border-color: #00f0ff; }
    100% { box-shadow: 0 0 25px rgba(0, 240, 255, 0.5), border-color: #ff00ff; }
}
.msg-bubble.icebreaker i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
    color: #00f0ff;
    animation: gamepadFlash 1.5s infinite alternate;
}
@keyframes gamepadFlash {
    0% { filter: drop-shadow(0 0 2px rgba(0, 240, 255, 0.4)); }
    100% { filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.9)); }
}

/* ==============================================================================
   ADMIN TERMINAL PANEL 🛡️
   ============================================================================== */
.admin-container {
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
.admin-table {
    color: var(--text-main);
    font-size: 0.9rem;
}
.admin-table th {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}
.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}
.admin-reporter-badge {
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #00f0ff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    display: inline-block;
}
.admin-reported-badge {
    background: rgba(255, 0, 85, 0.12);
    border: 1px solid rgba(255, 0, 85, 0.25);
    color: #ff0055;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    display: inline-block;
}
.admin-btn-action {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
}
.admin-btn-action.ban {
    background: linear-gradient(135deg, #ff0055, #9b003c);
    color: #fff;
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.35);
}
.admin-btn-action.ban:hover {
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.65);
    transform: translateY(-1px);
}
.admin-btn-action.resolve {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
}
.admin-btn-action.resolve:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    transform: translateY(-1px);
}

.admin-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.admin-tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}
.admin-tab-btn.active {
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.2), rgba(255, 0, 85, 0.05));
    border: 1px solid rgba(255, 0, 85, 0.4);
    color: #ff0055;
    text-shadow: 0 0 8px rgba(255, 0, 85, 0.4);
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.15);
}

/* KPI CARDS */
.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    width: 100%;
}
.admin-kpi-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}
.admin-kpi-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}
.admin-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--kpi-color, #ff0055);
    box-shadow: 0 0 10px var(--kpi-color, #ff0055);
}
.admin-kpi-icon {
    font-size: 1.5rem;
    color: var(--kpi-color, #ff0055);
    text-shadow: 0 0 8px rgba(255, 0, 85, 0.3);
    align-self: flex-start;
}
.admin-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-main);
    line-height: 1;
}
.admin-kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ADMIN USERS GRID & CARDS */
.admin-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
}
.admin-user-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}
.admin-user-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}
.admin-user-card.banned {
    border-color: rgba(255, 0, 85, 0.4);
    background: rgba(255, 0, 85, 0.02);
}
.admin-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}
.admin-user-info {
    flex: 1;
    overflow: hidden;
}
.admin-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-user-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-user-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.admin-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}
.admin-badge.vip {
    background: rgba(255, 183, 3, 0.15);
    border: 1px solid rgba(255, 183, 3, 0.3);
    color: #ffb703;
}
.admin-badge.adm {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
}
.admin-badge.ban {
    background: rgba(255, 0, 85, 0.15);
    border: 1px solid rgba(255, 0, 85, 0.3);
    color: #ff0055;
}
.admin-badge.adult {
    background: rgba(181, 23, 158, 0.15);
    border: 1px solid rgba(181, 23, 158, 0.3);
    color: #b5179e;
}
.admin-user-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}
.admin-btn-action-small {
    flex: 1;
    min-width: 75px;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-align: center;
}
.admin-btn-action-small:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}
.admin-btn-action-small.active {
    background: rgba(255, 183, 3, 0.15);
    border-color: rgba(255, 183, 3, 0.4);
    color: #ffb703;
}
.admin-btn-action-small.active-admin {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.4);
    color: #00f0ff;
}
.admin-btn-action-small.ban-btn {
    border-color: rgba(255, 0, 85, 0.4);
    color: #ff0055;
}
.admin-btn-action-small.ban-btn:hover {
    background: rgba(255, 0, 85, 0.1);
}
.admin-btn-action-small.unban-btn {
    border-color: rgba(46, 204, 113, 0.4);
    color: #2ecc71;
}
.admin-btn-action-small.unban-btn:hover {
    background: rgba(46, 204, 113, 0.1);
}

/* ADMIN CONTENT GRID & CARDS */
.admin-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    width: 100%;
}
.admin-content-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
}
.admin-content-card:hover {
    background: rgba(255, 255, 255, 0.05);
}
.admin-content-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-content-author-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.admin-content-meta {
    flex: 1;
    overflow: hidden;
}
.admin-content-author {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-content-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.admin-content-preview {
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.15);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
    min-height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-content-badge-type {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}
.admin-content-badge-type.story {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
}
.admin-content-badge-type.secret {
    background: rgba(155, 89, 182, 0.15);
    border: 1px solid rgba(155, 89, 182, 0.3);
    color: #9b59b6;
}
.admin-content-badge-hot {
    background: rgba(255, 0, 85, 0.15);
    border: 1px solid rgba(255, 0, 85, 0.3);
    color: #ff0055;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    font-weight: bold;
}

/* ==============================================================================
   THE RED ROOM (+18 SPICY ZONE DEDICATA) 🔞🔥❤️
   ============================================================================== */
.hot-container {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    width: 100%;
}

@media (max-width: 900px) {
    .hot-container {
        padding-bottom: 95px !important;
    }
}

.text-hot-neon {
    color: #ff0055 !important;
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.6), 0 0 20px rgba(255, 0, 85, 0.3) !important;
}

.btn-hot {
    background: linear-gradient(135deg, #ff0055, #ff2a74) !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 42, 116, 0.5) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.btn-hot:hover {
    box-shadow: 0 0 25px rgba(255, 42, 116, 0.85) !important;
    transform: scale(1.03) !important;
}

/* Onde scarlatte specifiche del radar Hot */
.radar-wave.hot {
    border-color: rgba(255, 0, 85, 0.3) !important;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.15), inset 0 0 10px rgba(255, 0, 85, 0.15) !important;
}

/* Interruttore Cyber Switch scarlatto */
.cyber-switch-slider.hot:before {
    background-color: #ff0055 !important;
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.8) !important;
}

input:checked + .cyber-switch-slider.hot {
    border-color: rgba(255, 0, 85, 0.6) !important;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.3) !important;
}

/* ============================================================
   MOOD SELECTOR — FREQUENZA HOT 🛰️
   ============================================================ */

.mood-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mood-pill {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 0.02em;
    white-space: nowrap;
    font-family: var(--font-body);
}

.mood-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-2px) scale(1.04);
}

/* --- Glow attivo per ogni mood --- */

/* 💋 Flirt → Rubino */
.mood-pill.active[data-mood="flirt"] {
    background: rgba(255, 0, 85, 0.18);
    border-color: #ff0055;
    color: #ff4488;
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.55), inset 0 0 8px rgba(255, 0, 85, 0.1);
    text-shadow: 0 0 6px rgba(255, 0, 85, 0.5);
    transform: translateY(-2px) scale(1.04);
}

/* 💬 Chat Audace → Ciano */
.mood-pill.active[data-mood="chat"] {
    background: rgba(0, 240, 255, 0.14);
    border-color: #00f0ff;
    color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.5), inset 0 0 8px rgba(0, 240, 255, 0.08);
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
    transform: translateY(-2px) scale(1.04);
}

/* 📷 Scambio Foto → Oro */
.mood-pill.active[data-mood="scambio"] {
    background: rgba(255, 183, 3, 0.16);
    border-color: #ffb703;
    color: #ffb703;
    box-shadow: 0 0 12px rgba(255, 183, 3, 0.5), inset 0 0 8px rgba(255, 183, 3, 0.08);
    text-shadow: 0 0 6px rgba(255, 183, 3, 0.5);
    transform: translateY(-2px) scale(1.04);
}

/* 🎲 Gioco di Ruolo → Viola */
.mood-pill.active[data-mood="gioco"] {
    background: rgba(181, 23, 158, 0.18);
    border-color: #b5179e;
    color: #d94eb3;
    box-shadow: 0 0 12px rgba(181, 23, 158, 0.55), inset 0 0 8px rgba(181, 23, 158, 0.1);
    text-shadow: 0 0 6px rgba(181, 23, 158, 0.5);
    transform: translateY(-2px) scale(1.04);
}

/* 👀 Curioso/a → Arancione */
.mood-pill.active[data-mood="curioso"] {
    background: rgba(251, 133, 0, 0.16);
    border-color: #fb8500;
    color: #fb8500;
    box-shadow: 0 0 12px rgba(251, 133, 0, 0.5), inset 0 0 8px rgba(251, 133, 0, 0.08);
    text-shadow: 0 0 6px rgba(251, 133, 0, 0.5);
    transform: translateY(-2px) scale(1.04);
}

/* 🔞 Trasgressivo → Rosso Scarlatto Scuro */
.mood-pill.active[data-mood="trasgressivo"] {
    background: rgba(217, 4, 41, 0.18);
    border-color: #d90429;
    color: #ff3355;
    box-shadow: 0 0 12px rgba(217, 4, 41, 0.6), inset 0 0 8px rgba(217, 4, 41, 0.1);
    text-shadow: 0 0 6px rgba(217, 4, 41, 0.5);
    transform: translateY(-2px) scale(1.04);
}

/* 💖 Connessione → Magenta Rosa Cuori */
.mood-pill.active[data-mood="romantico"] {
    background: rgba(255, 112, 166, 0.16);
    border-color: #ff70a6;
    color: #ff70a6;
    box-shadow: 0 0 12px rgba(255, 112, 166, 0.5), inset 0 0 8px rgba(255, 112, 166, 0.08);
    text-shadow: 0 0 6px rgba(255, 112, 166, 0.5);
    transform: translateY(-2px) scale(1.04);
}

/* Badge mood nelle card Hot Discover */
.mood-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid;
}
.mood-badge-flirt        { color: #ff4488; border-color: rgba(255,0,85,0.4);     background: rgba(255,0,85,0.1); }
.mood-badge-chat         { color: #00f0ff; border-color: rgba(0,240,255,0.4);    background: rgba(0,240,255,0.08); }
.mood-badge-scambio      { color: #ffb703; border-color: rgba(255,183,3,0.4);    background: rgba(255,183,3,0.08); }
.mood-badge-gioco        { color: #d94eb3; border-color: rgba(181,23,158,0.4);   background: rgba(181,23,158,0.08); }
.mood-badge-curioso      { color: #fb8500; border-color: rgba(251,133,0,0.4);    background: rgba(251,133,0,0.08); }
.mood-badge-trasgressivo { color: #ff3355; border-color: rgba(217,4,41,0.4);     background: rgba(217,4,41,0.08); }
.mood-badge-romantico    { color: #ff70a6; border-color: rgba(255,112,166,0.4);  background: rgba(255,112,166,0.08); }

/* Responsive mobile */
@media (max-width: 600px) {
    .mood-pills-row {
        gap: 8px;
    }
    .mood-pill {
        padding: 7px 13px;
        font-size: 0.8rem;
    }
}

/* ============================================================
   FAB — BOTTONE AGGIUNGI STORIA FLOTTANTE
   ============================================================ */
.stories-fab {
    position: fixed;
    bottom: 90px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    display: none;      /* visibile solo quando storiesScreen è attivo (JS) */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(255, 42, 116, 0.55), 0 0 0 0 rgba(255, 42, 116, 0.4);
    animation: fabPulse 2.6s ease-in-out infinite;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
    z-index: 9999;
}

.stories-fab:hover {
    transform: scale(1.12) rotate(90deg);
    box-shadow: 0 6px 32px rgba(255, 42, 116, 0.75);
}

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(255,42,116,0.55), 0 0 0 0 rgba(255,42,116,0.35); }
    50%       { box-shadow: 0 4px 24px rgba(255,42,116,0.55), 0 0 0 10px rgba(255,42,116,0); }
}

/* ============================================================
   FAB — BOTTONE AGGIUNGI SEGRETO FLOTTANTE
   ============================================================ */
.secrets-fab {
    position: fixed;
    bottom: 90px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    display: none;      /* visibile solo quando secretsScreen è attivo (JS) */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(123, 44, 191, 0.55), 0 0 0 0 rgba(123, 44, 191, 0.4);
    animation: secretsFabPulse 2.6s ease-in-out infinite;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
    z-index: 9999;
}

.secrets-fab:hover {
    transform: scale(1.12) rotate(90deg);
    box-shadow: 0 6px 32px rgba(123, 44, 191, 0.75);
}

@keyframes secretsFabPulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(123,44,191,0.55), 0 0 0 0 rgba(123,44,191,0.35); }
    50%       { box-shadow: 0 4px 24px rgba(123,44,191,0.55), 0 0 0 10px rgba(123,44,191,0); }
}

/* ==============================================================================
   RAFFORZAMENTO CHAT UI, STICKY LAYOUT & UNIFORM PAGES
   ============================================================================== */

/* 1. PULSANTE '+' E MENU ALLEGATI IN CHAT */
.chat-attachment-container {
    position: relative;
    display: flex;
    align-items: center;
}
.btn-chat-attachment-toggle {
    color: #00f0ff;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}
.btn-chat-attachment-toggle:hover {
    background: rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.45);
    transform: scale(1.08);
}
.btn-chat-attachment-toggle.active {
    transform: rotate(45deg);
    border-color: #ff0055 !important;
    color: #ff0055 !important;
    background: rgba(255, 0, 85, 0.15) !important;
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.4) !important;
}

.chat-attachment-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    bottom: 52px;
    left: 0;
    z-index: 1000;
    width: 190px;
    padding: 6px;
    background: rgba(14, 7, 23, 0.88);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.65), 0 0 15px rgba(0, 240, 255, 0.1);
    animation: slideUp 0.2s ease-out;
}
.attachment-menu-item {
    text-align: left;
    background: transparent;
    border: none;
    padding: 10px 14px;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--text-muted);
}
.attachment-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(2px);
}
.attachment-menu-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* 2. CHAT UNREAD HIGHLIGHT (EVIDENZIAZIONE CHAT ATTIVE NON LETTE) */
.chat-item.unread {
    background: rgba(0, 240, 255, 0.04) !important;
    border-left: 3px solid #00f0ff !important;
    box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.08) !important;
}
.chat-item.unread:hover {
    background: rgba(0, 240, 255, 0.08) !important;
}
.chat-item.unread .chat-preview {
    color: #00f0ff !important;
    font-weight: 700 !important;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
}
.chat-item.unread .chat-name-row h4 {
    color: #ffffff !important;
    font-weight: 800 !important;
}
.chat-item.unread .unread-badge {
    background: var(--gradient-primary) !important;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.65) !important;
    animation: secretsFabPulse 2s ease-in-out infinite !important;
}

/* ==============================================================================
   PANNELLO DI CONTROLLO & RESPONSIVE NAV USER
   ============================================================================== */
.btn-control-panel:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px var(--primary-glow) !important;
    transform: translateY(-1px);
}
.btn-control-panel:active {
    transform: translateY(1px);
}

.btn-avatar-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-avatar-profile:hover {
    transform: scale(1.08);
}
.btn-avatar-profile:hover img {
    border-color: var(--accent) !important;
    box-shadow: 0 0 12px var(--accent-glow);
}
.btn-avatar-profile:active {
    transform: scale(0.95);
}

@media (max-width: 600px) {
    .btn-control-panel {
        display: none !important;
    }
}

/* ==============================================================================
   FUNZIONALITÀ PREMIUM & GAMIFICATION: REAZIONI, SCRITTURA, QUIZ DI COPPIA
   ============================================================================== */

:root {
    --purple-neon: #a020f0;
    --purple-glow: rgba(160, 32, 240, 0.4);
}

/* 1. NEON REACTIONS STYLE */
.msg-bubble-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.msg-bubble {
    position: relative;
}

/* Reactions Badge Row */
.msg-reactions-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: -6px;
    margin-bottom: 4px;
    z-index: 5;
    pointer-events: auto;
}

.msg-mine + .msg-reactions-badge-row {
    justify-content: flex-end;
    margin-right: 12px;
}

.msg-partner + .msg-reactions-badge-row {
    justify-content: flex-start;
    margin-left: 12px;
}

.msg-reaction-badge {
    background: rgba(14, 7, 23, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.1);
}

.msg-reaction-badge:hover {
    border-color: #00f0ff;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
    transform: scale(1.05);
}

.msg-reaction-badge.active-user {
    background: rgba(0, 240, 255, 0.1);
    border-color: #00f0ff;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* Reaction Picker Popup overlay */
.msg-reaction-picker {
    position: absolute;
    bottom: calc(100% + 4px);
    background: rgba(14, 7, 23, 0.95);
    border: 1.5px solid #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    gap: 8px;
    z-index: 100;
    pointer-events: auto;
    animation: typingBlink 0.15s ease-out;
}

.msg-mine .msg-reaction-picker {
    right: 10px;
}

.msg-partner .msg-reaction-picker {
    left: 10px;
}

.msg-reaction-emoji {
    font-size: 1.15rem;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.msg-reaction-emoji:hover {
    transform: scale(1.35);
    filter: drop-shadow(0 0 6px #00f0ff);
}

/* Double Cyan Checkmarks for read receipts */
.msg-time-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.msg-checkmark {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    display: inline-block;
}

.msg-checkmark.read {
    color: #00f0ff !important;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}

/* 2. CHAT TYPING INDICATOR */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(14, 7, 23, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-heading);
    animation: fadeIn 0.3s ease;
}

.typing-name {
    color: #00f0ff;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 240, 255, 0.2);
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background-color: #00f0ff;
    border-radius: 50%;
    opacity: 0.3;
    box-shadow: 0 0 5px #00f0ff;
    animation: typingBlink 1.4s infinite both;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBlink {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.3;
        transform: scale(1);
    }
}

/* 3. PAIR TRIVIA & COMPATIBILITY GAUGE STYLE */
.quiz-question-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.3s ease;
}

.quiz-question-card.answered {
    border-color: rgba(160, 32, 240, 0.3);
    background: rgba(160, 32, 240, 0.02);
}

.quiz-question-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

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

.quiz-btn-option {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--text-main);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-btn-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.quiz-btn-option.selected {
    background: rgba(160, 32, 240, 0.15);
    border-color: var(--purple-neon);
    color: #fff;
    box-shadow: 0 0 10px var(--purple-glow);
}

.quiz-btn-option.partner-selected {
    border-color: #00f0ff;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.quiz-btn-option.both-selected {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.15), rgba(0, 240, 255, 0.1));
    border-color: var(--purple-neon);
    box-shadow: 0 0 10px var(--purple-glow), 0 0 10px rgba(0, 240, 255, 0.2);
    color: #fff;
}

.quiz-badge-answer-status {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    margin-top: 4px;
    align-self: flex-start;
    font-family: var(--font-heading);
}

.quiz-badge-answer-status.pending {
    background: rgba(255, 183, 3, 0.1);
    color: #ffb703;
    border: 1px solid rgba(255, 183, 3, 0.2);
}

.quiz-badge-answer-status.completed {
    background: rgba(0, 240, 255, 0.1);
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

/* Cyan Cyber-switch-slider variation */
.cyber-switch-slider.cyan::before {
    background-color: var(--text-muted);
}

input:checked + .cyber-switch-slider.cyan {
    border-color: #00f0ff !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

input:checked + .cyber-switch-slider.cyan::before {
    background-color: #00f0ff !important;
    box-shadow: 0 0 6px #00f0ff;
    transform: translateX(20px);
}



