/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
:root {
    --primary-bg: #0a0e27;
    --secondary-bg: #0f1629;
    --accent-bg: #1a1f3a;
    --primary-color: #3b82f6;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}
/* Landing Page Styles */
.hero {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height - tiene conto delle barre del browser */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: radial-gradient(circle at center, var(--accent-bg) 0%, var(--primary-bg) 100%);
}
.logo {
    font-size: 3rem;
    font-weight: 200;
    letter-spacing: 0.1em;
    margin-bottom: 3rem;
    position: relative;
    background: linear-gradient(to right, #10b981 0%, #10b981 50%, transparent 50%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    background-size: 200% 100%;
    animation: waterFill 3s ease-out forwards;
}
@keyframes waterFill {
    from { background-position: 100% 0; }
    to { background-position: 0% 0; }
}
.quote-container {
    height: 80px;
    position: relative;
    margin-bottom: 3rem;
    width: 90%;
    max-width: 600px;
    text-align: center;
}
.quote {
    position: absolute;
    width: 100%;
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0;
    animation: fadeInOut 12s infinite;
    line-height: 1.4;
}
.quote:nth-child(1) { animation-delay: 0s; }
.quote:nth-child(2) { animation-delay: 3s; }
.quote:nth-child(3) { animation-delay: 6s; }
.quote:nth-child(4) { animation-delay: 9s; }
@keyframes fadeInOut {
    0%, 25%, 100% { opacity: 0; transform: translateY(10px); }
    5%, 20% { opacity: 1; transform: translateY(0); }
}
.cta-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.4);
}
.subtitle {
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 300;
}
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}
.scroll-indicator::before {
    content: '';
    width: 4px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: scroll 2s infinite;
}
@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}
/* Demo Section */
.demo-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    background: var(--secondary-bg);
    position: relative;
}
.demo-title {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 3rem;
    opacity: 0.9;
}
.content-demo {
    width: 90%;
    max-width: 400px;
    height: 600px;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: var(--accent-bg);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.content-demo::-webkit-scrollbar {
    display: none;
}
.content-card {
    min-height: 600px;
    padding: 3rem 2.5rem;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}
.content-type {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.5;
    margin-bottom: 1.5rem;
}
.content-text {
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-weight: 300;
}
.content-action {
    font-size: 0.9rem;
    opacity: 0.7;
    font-style: italic;
}
/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.auth-modal.active {
    opacity: 1;
    pointer-events: all;
}
.auth-content {
    background: var(--accent-bg);
    padding: 3rem;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    position: relative;
}
.close-auth {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.close-auth:hover {
    opacity: 1;
}
.auth-content h2 {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 1rem;
}
.auth-subtitle {
    opacity: 0.8;
    margin-bottom: 2rem;
}
.email-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
}
.email-input::placeholder {
    color: var(--text-muted);
}
.auth-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}
.auth-button:hover {
    background: #2563eb;
}
.auth-info {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 1rem;
    text-align: center;
}
.auth-message {
    margin-top: 1rem;
    text-align: center;
}
.auth-message .error {
    color: #ef4444;
}
.auth-message .success {
    color: #10b981;
}
.auth-message .loading {
    color: var(--primary-color);
}
/* Footer */
.footer {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--primary-bg);
}
.footer-tagline {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.9rem;
}
.footer-links a {
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s;
}
.footer-links a:hover {
    opacity: 1;
}
/* App Styles */
.app-container {
    height: 100vh;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: var(--secondary-bg);
}
.app-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 1.5rem;
    background: linear-gradient(to bottom, var(--secondary-bg) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* AGGIUNTI: Stili per header brand */
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.header-logo {
    width: 32px;
    height: 32px;
}
.logo-small {
    font-size: 1.2rem;
    font-weight: 200;
    letter-spacing: 0.05em;
    color: #10b981;
}
.menu-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-primary);
    opacity: 0.7;
    transition: opacity 0.3s;
}
.menu-icon:hover {
    opacity: 1;
}
/* Content Scroll */
.content-scroll {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.content-scroll::-webkit-scrollbar {
    display: none;
}
/* MODIFICATO: Aumentato padding bottom per far spazio ai reaction buttons */
.content-item {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem 9rem; /* Aumentato da 6rem a 9rem */
    position: relative;
}
.content-item:nth-child(odd) {
    background: radial-gradient(circle at center, var(--accent-bg) 0%, var(--secondary-bg) 100%);
}
.content-item:nth-child(even) {
    background: radial-gradient(circle at top right, var(--accent-bg) 0%, var(--secondary-bg) 100%);
}
.content-wrapper {
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.content-category {
    font-size: 0.7rem; /* Ridotto da 0.75rem */
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.5;
    margin-bottom: 1.5rem; /* Ridotto da 2rem */
}
.content-main {
    font-size: 1.08rem; /* Ulteriormente ridotto per desktop */
    line-height: 1.55; /* Leggermente più compatto */
    font-weight: 300;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.content-highlight {
    color: #10b981; /* Usa il verde del brand invece del blu */
    font-weight: 500; /* Aumentato da 400 per maggiore enfasi */
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3); /* Aggiunto glow sottile */
}
.content-prompt {
    font-size: 0.85rem; /* Ridotto da 0.95rem */
    opacity: 0.7;
    font-style: italic;
    margin-top: 1.5rem; /* Ridotto da 2rem */
}
/* MODIFICATO: Reaction Bar - aumentato bottom per renderlo più visibile */
.reaction-bar {
    position: absolute;
    bottom: 5rem;
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem; /* RIDOTTO da 1rem per più spazio */
    background: rgba(26, 31, 58, 0.98);
    backdrop-filter: blur(10px);
    padding: 0.8rem 0.6rem; /* RIDOTTO padding orizzontale */
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 20;
}
/* FIX 1: Reaction bar più in basso SOLO su desktop */
@media (min-width: 769px) {
    .reaction-bar {
        bottom: 3.5rem; /* Più in basso su desktop */
    }
}
.reaction-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* IMPORTANTE per centratura */
    gap: 0.3rem; /* RIDOTTO da 0.5rem */
    transition: all 0.3s;
    opacity: 0.6;
    padding: 0.4rem; /* RIDOTTO da 0.5rem */
    min-width: 65px; /* RIDOTTO da 80px */
}
/* NUOVO: Share button */
.share-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: all 0.3s;
    opacity: 0.6;
    padding: 0.4rem;
    min-width: 65px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.share-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
}
.share-btn.active {
    opacity: 0.6 !important;
    color: var(--text-primary) !important;
}
/* Separatore visivo */
.share-btn::before {
    content: '';
    position: absolute;
    left: -0.25rem;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}
.reaction-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
}
.reaction-btn.active {
    opacity: 1;
    color: var(--primary-color);
}
.reaction-icon {
    font-size: 1.3rem !important; /* RIDOTTO */
    line-height: 1 !important;
    display: block !important;
}
.reaction-label {
    font-size: 0.55rem !important; /* RIDOTTO */
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;
}
/* Mobile specific */
@media (max-width: 768px) {
    .reaction-bar {
        gap: 0.3rem; /* ULTRA RIDOTTO */
        padding: 0.7rem 0.4rem;
    }
    .reaction-btn,
    .share-btn {
        min-width: 60px; /* MINIMO ASSOLUTO */
        padding: 0.3rem;
    }
    .reaction-icon {
        font-size: 1.2rem !important;
    }
    .reaction-label {
        font-size: 0.5rem !important;
    }
}
/* Minimal Progress Bar - AGGIORNATO con larghezza contenuta */
.minimal-progress-bar {
    position: fixed;
    top: 60px; /* Sotto l'header */
    left: 50%; /* Centrata */
    transform: translateX(-50%); /* Centrata perfettamente */
    width: 35%; /* Larghezza contenuta su desktop */
    height: 4px; /* Leggermente aumentata da 3px */
    background: rgba(255, 255, 255, 0.1);
    z-index: 90;
    overflow: hidden;
    border-radius: 2px; /* Bordi arrotondati per eleganza */
}
.minimal-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.minimal-progress-fill.resetting {
    transition: width 0.1s ease !important;
}
/* Effetto glow sottile quando si muove */
.minimal-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}
/* FIX 2: Progress bar più larga su mobile per visibilità */
@media (max-width: 768px) {
    .minimal-progress-bar {
        width: 85%; /* Più larga su mobile */
        height: 3px; /* Più sottile su mobile */
        top: 56px; /* Aggiusta per header mobile */
    }
}
/* Menu Overlay */
.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-bg);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    padding: 2rem;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.menu-overlay.active {
    transform: translateX(0);
}
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}
.menu-title {
    font-size: 1.5rem;
    font-weight: 300;
}
.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.close-btn:hover {
    opacity: 1;
}
.menu-section {
    margin-bottom: 0.8rem;
}
.menu-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}
.saved-count {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}
.menu-link {
    display: block;
    padding: 0.7rem 0;
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
    border-bottom: 1px solid var(--border-color);
}
.menu-link:hover {
    opacity: 1;
}
/* Mobile Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }
    .quote {
        font-size: 1.2rem;
    }
    .content-main {
        font-size: 1rem; /* Ancora più piccolo su mobile */
    }
    .content-text {
        font-size: 1.1rem;
    }
    .reaction-bar {
        bottom: 4rem; /* Mantiene la posizione corretta su mobile */
        gap: 0.8rem;
        padding: 0.9rem 1rem;
        width: calc(100% - 2rem); /* Larghezza responsive */
        max-width: 380px;
    }
    .auth-content {
        padding: 2rem;
    }
    .content-item {
        padding: 3rem 1.5rem 8rem; /* Aumentato padding bottom */
    }
    .reaction-icon {
        font-size: 1.3rem; /* Ridotto su mobile */
    }
    .reaction-label {
        font-size: 0.65rem; /* Più piccolo su mobile */
    }
}
/* PWA Styles */
@media (display-mode: standalone) {
    .app-header {
        padding-top: 2rem; /* Account for iOS status bar */
    }
}
/* Footer bottom - minimal version */
.footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}
.footer-email {
    color: #10b981;
    text-decoration: none;
    transition: all 0.3s;
}
.footer-email:hover {
    opacity: 0.8;
}
.footer-divider {
    opacity: 0.3;
}
.footer-made {
    opacity: 0.7;
}
/* Mobile responsive */
@media (max-width: 480px) {
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
    }
    .footer-divider {
        display: none;
    }
}
/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 22, 41, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1rem;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}
.cookie-banner.show {
    transform: translateY(0);
}
.cookie-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.cookie-text {
    flex: 1;
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
}
.cookie-emoji {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}
.cookie-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.cookie-link {
    color: #10b981;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}
.cookie-link:hover {
    opacity: 0.8;
}
.cookie-button {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.cookie-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}
/* Mobile */
@media (max-width: 640px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
}
/* FIX VIEWPORT MOBILE PER ANDROID - INIZIO */
@media (max-width: 768px) and (max-height: 800px) {
    .hero {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 1rem;
    }
    .logo-container {
        margin-bottom: 2rem;
    }
    .quote-container {
        height: 60px;
        margin-bottom: 2rem;
    }
    .cta-button {
        margin-bottom: 0.5rem;
        padding: 0.875rem 2rem;
    }
    .subtitle {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    .scroll-indicator {
        bottom: 1rem;
        transform: scale(0.9);
    }
}
@media (max-height: 700px) {
    .logo-image {
        width: 50px;
        height: 50px;
    }
    .logo {
        font-size: 2.5rem;
    }
    .quote-container {
        height: 50px;
        margin-bottom: 1.5rem;
    }
    .quote {
        font-size: 1.1rem;
    }
}
/* FIX VIEWPORT MOBILE PER ANDROID - FINE */
/* FIX APP MOBILE ANDROID con gesture navigation */
@media (max-width: 768px) and (hover: none) {
    .reaction-bar {
        bottom: 5.5rem; /* Extra spazio per gesture bar */
    }
}
/* Demo Progress Bar */
.demo-progress-bar {
    position: absolute;
    top: calc(50% - 100px);
    right: 20px;
    width: 3px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}
.demo-progress-fill {
    height: 33.33%; /* 1/3 perché ci sono 3 cards */
    width: 100%;
    background: linear-gradient(180deg, #10b981 0%, #3b82f6 100%);
    transition: transform 0.3s ease;
    transform: translateY(0);
}
/* Mobile */
@media (max-width: 768px) {
    .demo-progress-bar {
        right: 10px;
        height: 150px;
        width: 2px;
    }
}

/* ==========================================
   LA STORIA DEL GIORNO
   ========================================== */

/* Banner Invito */
.story-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.story-banner.active {
    opacity: 1;
    pointer-events: all;
}
.story-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
}
.story-banner-content {
    position: relative;
    background: linear-gradient(135deg, var(--accent-bg) 0%, var(--secondary-bg) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 340px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.story-banner.active .story-banner-content {
    transform: translateY(0);
}
.story-banner-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}
.story-banner-title {
    font-size: 1.4rem;
    font-weight: 300;
    color: #10b981;
    margin-bottom: 0.5rem;
}
.story-banner-subtitle {
    font-size: 1.1rem;
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}
.story-banner-message {
    font-size: 0.95rem;
    opacity: 0.7;
    line-height: 1.6;
    margin-bottom: 2rem;
}
.story-banner-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.story-banner-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.story-banner-later {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.story-banner-later:hover {
    background: rgba(255, 255, 255, 0.05);
}
.story-banner-now {
    background: #10b981;
    color: white;
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.3);
}
.story-banner-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* Pulsantino Reminder - Posizionato all'altezza dell'icona AI/HUMAN */
/* z-index 90: sopra i contenuti ma sotto menu (200) e modali (1000+) */
.story-reminder {
    position: fixed;
    top: 90px; /* Allineato verticalmente con .floating-source-icon (AI/HUMAN) */
    left: 45px; /* Allineato orizzontalmente con .floating-echo-icon */
    z-index: 90;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}
.story-reminder.visible {
    opacity: 1;
    transform: translateY(0);
}
.story-reminder-btn {
    width: 48px;  /* Stessa dimensione di .echo-icon-btn */
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: pulse-story 2s ease-in-out infinite;
}
.story-reminder-btn:hover {
    transform: scale(1.1);
    border-color: #8b5cf6;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}
@keyframes pulse-story {
    0%, 100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3); }
}

/* Reader Fullscreen */
.story-reader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: linear-gradient(180deg, #0d1117 0%, #0a0e27 50%, #0f1629 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
}
.story-reader.active {
    opacity: 1;
    pointer-events: all;
}
.story-reader-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    cursor: pointer;
}
.story-reader-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}
.story-reader-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
.story-reader-header {
    text-align: center;
    padding: 2rem 0;
    flex-shrink: 0;
}
.story-reader-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #10b981;
    opacity: 0.8;
}
.story-reader-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 400;
    margin-top: 0.75rem;
    font-style: italic;
    opacity: 0.95;
    letter-spacing: 0.02em;
}
.story-reader-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.story-reader-content::-webkit-scrollbar {
    display: none;
}
.story-moment {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.story-moment.active {
    opacity: 1;
    transform: translateY(0);
}
.story-moment.fading-out {
    opacity: 0;
    transform: translateY(-10px);
}
.story-moment-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 400;
    text-align: center;
    letter-spacing: 0.01em;
}
.story-line {
    display: block;
}
.story-reader-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1.5rem 0;
    padding-bottom: 180px; /* Spazio per la barra reazioni (bottom: 3rem + altezza barra) */
}
.story-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1rem;
}
.story-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}
.story-progress-dot:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
}
.story-progress-dot.active {
    background: rgba(16, 185, 129, 0.5);
}
.story-progress-dot.current {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    transform: scale(1.3);
}
.story-progress-dot.completed {
    cursor: default;
    opacity: 0.5;
}
.story-progress-dot.completed:hover {
    transform: none;
}
.story-tap-hint {
    font-size: 0.85rem;
    opacity: 0.4;
    animation: pulse-opacity 2s ease-in-out infinite;
}
@keyframes pulse-opacity {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.6; }
}

/* Riflessione Finale */
.story-reflection {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    text-align: center;
    padding: 2rem 1rem;
}
.story-reflection.active {
    opacity: 1;
    transform: translateY(0);
}
.story-reflection-divider {
    display: none; /* Rimosso come richiesto */
}
.story-reflection-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 500;
    color: #10b981;
    line-height: 1.7;
    margin-bottom: 2rem;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}
.story-reflection-actions {
    display: flex;
    justify-content: center;
}
.story-save-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.story-save-btn:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
}
.story-save-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .story-banner-content {
        padding: 2rem 1.5rem;
    }
    .story-banner-icon {
        font-size: 2.5rem;
    }
    .story-banner-title {
        font-size: 1.2rem;
    }
    .story-reader-container {
        padding: 1.5rem;
    }
    .story-reader-title {
        font-size: 1.3rem;
    }
    .story-moment-text {
        font-size: 1.05rem;
        line-height: 1.75;
    }
    .story-reader-footer {
        padding-bottom: 160px; /* Spazio per barra reazioni su mobile */
    }
    .story-reminder {
        top: 95px; /* Allineato con .floating-source-icon su mobile */
        left: 35px; /* Allineato con .floating-echo-icon su mobile */
    }
    .story-reminder-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* PWA adjustments per story reminder */
@media (display-mode: standalone) {
    .story-reminder {
        top: calc(90px + env(safe-area-inset-top, 0px)); /* Allineato con icona AI/HUMAN in PWA */
    }
}

/* ==========================================
   STORIE PERSE - Stili speciali (Approccio Ibrido)
   ========================================== */

/* Banner per storia persa - leggero accento diverso */
.story-banner-content.story-banner-missed .story-banner-title {
    color: #a78bfa; /* Viola più chiaro per distinguere */
}

.story-banner-content.story-banner-missed .story-banner-icon {
    opacity: 0.9;
}

/* Reader label per storia persa */
.story-reader-label-missed {
    color: #a78bfa !important;
    font-style: italic;
}

/* ==========================================
   STORY READER - REACTION BAR (in basso)
   ========================================== */
.story-reader-reactions {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.story-reader-reactions.visible {
    opacity: 1;
}

/* Icone floating nel story reader - posizionate sopra la barra reazioni */
.story-reader .floating-echo-icon {
    position: absolute;
    bottom: calc(3rem + 140px);
    left: 30px;
    z-index: 15;
}
.story-reader .floating-note-icon {
    position: absolute;
    bottom: calc(3rem + 140px);
    right: 30px;
    z-index: 15;
}

/* ==========================================
   STORY CARD (nel menu salvati)
   ========================================== */
.story-card {
    /* Sfondo distintivo: sfumatura viola/blu invece di verde */
    background: radial-gradient(
        ellipse at center,
        rgba(99, 102, 241, 0.15) 0%,
        rgba(139, 92, 246, 0.08) 40%,
        var(--primary-bg) 100%
    ) !important;
    border-left: 3px solid rgba(139, 92, 246, 0.5);
    cursor: pointer;
}
.story-card:hover {
    border-left-color: #8b5cf6;
}
/* Reaction bar nelle story card - IDENTICA ai contenuti */
.story-card .reaction-bar {
    /* Eredita tutto da .reaction-bar, nessuna modifica */
}
/* Reaction bar compatta (3 pulsanti senza Semina) - centrata */
.reaction-bar.reaction-bar-compact,
.story-card .reaction-bar.reaction-bar-compact {
    justify-content: center !important;
    width: -webkit-fit-content !important;
    width: -moz-fit-content !important;
    width: fit-content !important;
    max-width: none !important;
    min-width: 0 !important;
}
.reaction-bar.reaction-bar-compact .reaction-btn {
    flex: 0 0 auto; /* Non espandere, mantieni dimensione naturale */
}
/* Override anche per mobile */
@media (max-width: 768px) {
    .reaction-bar.reaction-bar-compact,
    .story-card .reaction-bar.reaction-bar-compact {
        width: -webkit-fit-content !important;
        width: -moz-fit-content !important;
        width: fit-content !important;
        max-width: none !important;
    }
}
.story-wrapper {
    padding-bottom: 0; /* Rimosso padding extra per allineare reaction bar */
}
.story-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.story-badge {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(99, 102, 241, 0.2));
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.story-date {
    font-size: 0.75rem;
    opacity: 0.5;
}
.story-title-main {
    font-size: 1.4rem;
    font-style: italic;
    font-weight: 300;
    color: #c4b5fd;
    margin: 1rem 0;
    line-height: 1.5;
}
.story-preview {
    font-size: 0.95rem;
    opacity: 0.6;
    font-style: italic;
    line-height: 1.6;
}
.story-tap-to-read {
    margin-top: 1.5rem;
    text-align: center;
}
.story-tap-to-read span {
    font-size: 0.8rem;
    color: #8b5cf6;
    opacity: 0.7;
    padding: 0.4rem 1rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 15px;
    display: inline-block;
}

/* Mobile per story card */
@media (max-width: 768px) {
    .story-title-main {
        font-size: 1.2rem;
    }
    .story-reader .floating-echo-icon {
        bottom: calc(3rem + 120px);
        left: 20px;
    }
    .story-reader .floating-note-icon {
        bottom: calc(3rem + 120px);
        right: 20px;
    }
}

/* ==========================================
   MODAL ECO STORIA
   ========================================== */
.story-echo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.story-echo-modal.active {
    opacity: 1;
    pointer-events: all;
}
.story-echo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
}
.story-echo-content {
    position: relative;
    background: linear-gradient(135deg, var(--accent-bg) 0%, var(--secondary-bg) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.story-echo-modal.active .story-echo-content {
    transform: translateY(0);
}
.story-echo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #3b82f6;
    font-size: 1rem;
}
.story-echo-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.story-echo-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
.story-echo-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
}
.story-echo-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}
.story-echo-textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
}
.story-echo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.story-echo-count {
    font-size: 0.8rem;
    opacity: 0.5;
}
.story-echo-submit {
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    background: #3b82f6;
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.story-echo-submit:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}
.story-echo-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ==========================================
   MODAL NOTE STORIA
   ========================================== */
.story-note-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.story-note-modal.active {
    opacity: 1;
    pointer-events: all;
}
.story-note-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
}
.story-note-content {
    position: relative;
    background: linear-gradient(135deg, var(--accent-bg) 0%, var(--secondary-bg) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.story-note-modal.active .story-note-content {
    transform: translateY(0);
}
.story-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #a855f7;
    font-size: 1rem;
}
.story-note-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.story-note-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}
.story-note-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
}
.story-note-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}
.story-note-textarea:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
}
.story-note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.story-note-count {
    font-size: 0.8rem;
    opacity: 0.5;
}
.story-note-status {
    font-size: 0.75rem;
    color: #a855f7;
    opacity: 0.8;
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .story-echo-content,
    .story-note-content {
        max-width: 95%;
        padding: 1.2rem;
    }
    .story-echo-textarea,
    .story-note-textarea {
        min-height: 100px;
    }
    .story-reaction-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    .story-actions-bar {
        gap: 0.8rem;
    }
    .story-action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    z-index: 10001;
    animation: slideUpSuccess 0.3s ease-out;
}
.toast-notification.toast-success {
    background: #10b981;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}
.toast-notification.toast-info {
    background: #3b82f6;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}
.toast-notification.toast-error {
    background: #ef4444;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

/* ==========================================
   UPDATE NOTIFICATION (Version Manager)
   ========================================== */
.update-notification {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 90%;
    animation: slideDown 0.3s ease-out;
}
.update-notification-icon {
    font-size: 1.2rem;
}
.update-notification-content {
    flex: 1;
}
.update-notification-content strong {
    display: block;
}
.update-notification-content span {
    font-size: 0.9rem;
    opacity: 0.9;
}
.update-notification-btn {
    background: white;
    color: #10b981;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
}
@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}