/* Reset base e impostazioni generali */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Prevenire lo scroll orizzontale */
html, body {
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
}

/* Container principale - VERSIONE CORRETTA */
.app-container {
    height: 100vh;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    position: relative;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    transition: none;
    margin: 0 auto;
}

/* Container della chat - VERSIONE CORRETTA */
.chat-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    height: 100%;
    background-color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 1px 8px rgba(0, 0, 0, 0.07);
    border-radius: 0;
    transition: none;
    position: relative;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto;
    overflow: hidden;
}

/* Header fisso con gradiente moderno */
.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #364f6b 0%, #2c3e50 100%);
    color: white;
    text-align: center;
    flex: 0 0 auto;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1100;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: sparkle 3s infinite linear;
}

@keyframes sparkle {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

/* Stile per il logo AIVEK nell'header della chat */
.chat-header .main-logo {
    font-weight: 700;
    font-size: 2rem;
    margin: 0;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chat-header p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 300;
}

.chat-footer {
    flex: 0 0 auto;
    border-top: 1px solid rgba(0,0,0,0.05);
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
    position: sticky;
    bottom: 0;
    z-index: 1100;
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,250,252,0.98) 100%);
    border-top: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 -10px 22px rgba(15,23,42,0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.mode-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(15,23,42,0.75);
    font-weight: 600;
    margin-bottom: 12px;
}

.mode-status i {
    color: #3498db;
}


/* Menu a tre puntini e dropdown */
.menu-button {
    position: relative;
    z-index: 99998;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s ease;
}

.menu-button:hover {
    transform: scale(1.1);
}

.menu-button:active {
    transform: scale(0.95);
}

.menu-button.active {
    color: #FFD54F;
}

.menu-dropdown {
    position: relative;
    display: inline-block;
    z-index: 10000;
}

.dropdown-content {
    display: none;
    position: fixed;
    right: 15px;
    top: 60px;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    z-index: 99999;
    border-radius: 12px;
    padding: 15px;
    animation: fadeIn 0.2s ease;
    transform-origin: top right;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dropdown-content.show {
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.menu-item {
    padding: 8px 0;
}

/* Toggle switch per Fun Mode */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

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

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 20px;
    transition: .4s;
    margin-right: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

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

input:checked + .toggle-slider {
    background-color: #FF5722;
}

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

.toggle-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Container scrollabile per i messaggi */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f9fafc;
    background-image: radial-gradient(circle at center, #ffffff 0%, #f5f7fa 100%);
    scroll-behavior: smooth;
}

.chat-messages {
    display: flex;
    flex-direction: column;
}

/* Stili per i messaggi con animazioni */
.message {
    margin-bottom: 15px;
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    word-break: break-word;
    line-height: 1.5;
    animation: messageAppear 0.3s ease-out forwards;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
}

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

.user-message {
    align-self: flex-end;
    margin-left: auto;
    background: linear-gradient(135deg, #42a5f5 0%, #2196f3 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.ai-message {
    align-self: flex-start;
    margin-right: auto;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8eaed 100%);
    color: #333;
    border-bottom-left-radius: 5px;
}

.message.ai-message {
    transition: all 0.2s ease-out;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 1000px;
    }
}

.component-message {
    align-self: flex-start;
    margin-right: auto;
    background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%);
    color: #0c5460;
    border-bottom-left-radius: 5px;
    border-left: 3px solid #03a9f4;
}

/* Indicatore thinking con animazione migliorata */
.thinking {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 15px;
    margin: 10px 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-radius: 18px;
    align-self: flex-start;
    max-width: 80%;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
}

.thinking span {
    margin-left: 10px;
    color: #5f6368;
    font-size: 14px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.dot-flashing {
    display: inline-block;
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #3498db;
    animation: dotFlashing 1s infinite linear alternate;
    animation-delay: 0s;
    margin: 0;
}

.dot-flashing::before,
.dot-flashing::after {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0;
}

.dot-flashing::before {
    left: -15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #3498db;
    animation: dotFlashing 1s infinite alternate;
    animation-delay: 0.5s;
}

.dot-flashing::after {
    left: 15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #3498db;
    animation: dotFlashing 1s infinite alternate;
    animation-delay: 1s;
}

@keyframes dotFlashing {
    0% { background-color: #3498db; }
    50%, 100% { background-color: rgba(52, 152, 219, 0.2); }
}

/* Footer fisso con effetti migliorati */
.chat-footer {
    flex: 0 0 auto;
    border-top: 1px solid rgba(0,0,0,0.05);
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
    position: sticky;
    bottom: 0;
    z-index: 1100;
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,250,252,0.98) 100%);
    border-top: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 -10px 22px rgba(15,23,42,0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* Quick buttons */
.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    padding: 12px;
    gap: 8px;
    justify-content: center;
    background-color: #fafbfc;
}

.quick-btn {
    border: none;
    border-radius: 50px;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.quick-btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.quick-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(to right, #2980b9, #3498db);
}

.btn-success {
    background: linear-gradient(to right, #27ae60, #2ecc71);
}

.btn-danger {
    background: linear-gradient(to right, #c0392b, #e74c3c);
}

.btn-warning {
    background: linear-gradient(to right, #f39c12, #f1c40f);
    color: #212529;
}

/* Area di input */
.chat-input {
    display: flex;
    padding: 12px 15px;
    background-color: white;
    border-top: 1px solid #f0f0f0;
    position: relative;
    z-index: 100;
}

.chat-input textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 12px 18px;
    resize: none;
    outline: none;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) inset;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.chat-input textarea:focus {
    border-color: #3498db;
    box-shadow: 0 1px 3px rgba(52, 152, 219, 0.2) inset;
}

.btn-send {
    width: 45px;
    height: 45px;
    margin-left: 10px;
    background: linear-gradient(45deg, #2196F3, #42a5f5);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
    transition: all 0.2s;
}

.btn-send:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
}

.btn-send:active {
    transform: scale(0.95);
}

/* ======== LANDING PAGE STYLES ======== */

.landing-page {
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    padding-top: 70px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
}

.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    width: min(100%, 960px);
    margin: 0 auto;
    text-align: center;
    align-items: center;
    min-height: 90vh;
    display: flex;
    justify-content: center;
    padding: 50px 0;
    position: relative;
}

.hero-content {
    max-width: 800px;
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.hero-title {
    font-size: 5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #364f6b 0%, #2980b9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    animation: pulse 3s infinite alternate;
}

.hero-subtitle {
    font-size: 1.6rem;
    color: #555;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-description {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.cta-container {
    margin: 30px 0;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #2196F3, #42a5f5);
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(33, 150, 243, 0.4);
    color: white;
}

.cta-button:active {
    transform: translateY(1px);
    box-shadow: 0 5px 10px rgba(33, 150, 243, 0.3);
}

.cta-button span {
    position: relative;
    z-index: 1;
    margin-right: 10px;
}

.cta-button i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.cta-button:hover i {
    transform: translateX(5px);
}

.cta-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #2196F3, #1565C0);
    transition: all 0.3s ease;
    z-index: 0;
}

.cta-button:hover:before {
    left: 0;
}

.cta-button.secondary {
    background: linear-gradient(45deg, #2c3e50, #4a6572);
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.3);
}

.cta-button.secondary:hover {
    box-shadow: 0 15px 30px rgba(44, 62, 80, 0.4);
}

.cta-button.secondary:before {
    background: linear-gradient(45deg, #2c3e50, #1e272e);
}

/* Features Section */
.features-section {
    padding-top: 120px;
    padding-bottom: 80px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: -80px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 50px;
    font-weight: 700;
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 50px;
}

.feature-card {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: all 0.4s ease;
    border: 1px solid #f0f0f0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background-color: rgba(255, 255, 255, 0.9);
}

.feature-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: #2196F3;
    margin-bottom: 20px;
    height: 70px;
    width: 70px;
    line-height: 70px;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.1);
    margin: 0 auto 20px;
    transition: all 0.4s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.15);
    color: #1565C0;
}

.feature-card h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

.center {
    text-align: center;
}

/* Footer */
.landing-footer {
    text-align: center;
    padding: 30px 0;
    color: #777;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    margin-top: 50px;
}

/* Sfondo animato per landing page */
.animated-background {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow:hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    pointer-events: none;
}

.cube {
    position: absolute;
    top: 80vh;
    left: 45vw;
    width: 10px;
    height: 10px;
    border: 1px solid rgba(33, 150, 243, 0.2);
    transform-origin: top left;
    transform: scale(0) rotate(0deg) translate(-50%, -50%);
    animation: cube 12s ease-in forwards infinite;
    opacity: 0;
}

.cube:nth-child(2) {
    animation-delay: 2s;
    left: 25vw;
    top: 40vh;
    border-color: rgba(33, 150, 243, 0.3);
}

.cube:nth-child(3) {
    animation-delay: 4s;
    left: 75vw;
    top: 50vh;
    border-color: rgba(52, 152, 219, 0.2);
}

.cube:nth-child(4) {
    animation-delay: 6s;
    left: 90vw;
    top: 10vh;
    border-color: rgba(46, 204, 113, 0.2);
}

.cube:nth-child(5) {
    animation-delay: 8s;
    left: 10vw;
    top: 85vh;
    border-color: rgba(155, 89, 182, 0.2);
}

@keyframes cube {
    from {
        transform: scale(0) rotate(0deg) translate(-50%, -50%);
        opacity: 1;
    }
    to {
        transform: scale(20) rotate(960deg) translate(-50%, -50%);
        opacity: 0;
    }
}

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

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

/* Sezione Changelog */
.changelog-section {
    padding: 80px 0;
    background-color: #f9fafc;
    position: relative;
    overflow: hidden;
}

.changelog-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
}

.timeline {
    max-width: 800px;
    margin: 0 auto 50px;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 120px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #2196F3 0%, rgba(33, 150, 243, 0.3) 100%);
}

.timeline-item {
    display: flex;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.timeline-date {
    width: 120px;
    padding-right: 20px;
    text-align: right;
    font-weight: 600;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    color: #2c3e50;
}

.timeline-date .year {
    font-size: 0.85em;
    opacity: 0.7;
}

.timeline-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    flex: 1;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.timeline-content::before {
    content: none;
    
}

.timeline-content h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-content p {
    margin-bottom: 15px;
    color: #666;
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: #2196F3;
    color: white;
}

.badge.improvement {
    background-color: #4CAF50;
}

.badge.release {
    background-color: #9C27B0;
}

.badge.bugfix {
    background-color: #F44336;
}

/* Responsive per la sezione changelog */
@media (max-width: 768px) {
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        flex-direction: column;
    }
    
    .timeline-date {
        width: auto;
        padding-left: 60px;
        padding-right: 0;
        text-align: left;
        margin-bottom: 10px;
    }
    
    .timeline-content {
        width: 100%;
    }
    
    .timeline-content::before {
        left: -22px;
        top: -22px;
    }
}

@media (max-width: 480px) {
    .timeline-content {
        padding: 15px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-date {
        padding-left: 45px;
    }
    
    .timeline-content::before {
        width: 10px;
        height: 10px;
        left: -17px;
        top: -17px;
    }
}

/* Mobile optimizations for landing */
@media (max-width: 720px) {
    .landing-container {
        padding: 0 16px 48px;
    }

    .hero-section {
        padding: 110px 0 60px;
        text-align: center;
    }

    .hero-content {
        gap: 18px;
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .hero-description p {
        max-width: 100%;
        font-size: 0.95rem;
    }

    .cta-container,
    .cta-container.center {
        display: flex;
        justify-content: center;
    }

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

    .feature-card {
        text-align: left;
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 18px;
    }

    .feature-card .feature-icon {
        flex-shrink: 0;
        font-size: 1.8rem;
    }

    .feature-card h3 {
        font-size: 1.1rem;
    }

    .feature-card p {
        font-size: 0.92rem;
    }

    .feature-link {
        margin-top: 6px;
        font-size: 0.9rem;
    }

    .timeline {
        gap: 20px;
    }

    .timeline-item {
        flex-direction: column;
        gap: 8px;
        padding: 18px 16px;
        border-radius: 18px;
        background: rgba(255,255,255,0.88);
        box-shadow: 0 18px 32px rgba(15,23,42,0.18);
    }

    .timeline-date {
        width: 100%;
        display: flex;
        justify-content: space-between;
        font-size: 0.9rem;
        color: rgba(15,23,42,0.65);
        padding: 0;
    }

    .timeline-content h3 {
        font-size: 1.05rem;
    }

    .timeline-content p {
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .timeline .badge {
        align-self: flex-start;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .feature-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 16px;
    }

    .feature-card .feature-icon {
        font-size: 1.6rem;
    }

    .timeline-item {
        padding: 16px;
    }

    .landing-footer {
        padding: 32px 0;
        font-size: 0.85rem;
    }
}

/* Media queries per mobile */
@media (max-width: 768px) {
    .app-container {
        padding: 0;
    }
    
    .chat-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 18px 20px;
        box-shadow: 0 12px 24px rgba(15,23,42,0.18);
    }
    
    .chat-header h2 {
        font-size: 1.2rem;
    }
    
    .quick-buttons {
        padding: 8px;
    }
    
    .quick-btn {
        padding: 7px 14px;
        font-size: 12px;
    }
    
    .message {
        max-width: 85%;
        padding: 10px 15px;
        font-size: 14px;
    }

    .chat-messages-container {
        padding: 20px 16px 120px;
    }
    
    .chat-footer {
        padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cta-button {
        padding: 14px 28px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
}



/* Fix per iPhone e altri dispositivi iOS */
.chat-container {
    padding-bottom: env(safe-area-inset-bottom);
}

.chat-footer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

/* Fun Mode Styles */
.fun-mode .chat-header {
    background: linear-gradient(45deg, #FF5722, #FF9800, #FFEB3B, #4CAF50, #2196F3, #9C27B0);
    background-size: 400% 400%;
    animation: gradientBG 10s ease infinite;
}

.fun-mode .message.ai-message {
    background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
    color: #333;
}

.fun-mode .btn-send {
    background: linear-gradient(45deg, #FF5722, #9C27B0);
}

.fun-mode .thinking {
    background: linear-gradient(135deg, #E1BEE7 0%, #CE93D8 100%);
}

@keyframes gradientBG {
    0% {background-position: 0% 50%;}
    50% {background-position: 100% 50%;}
    100% {background-position: 0% 50%;}
}

/* Gestione tastiera mobile */
body.keyboard-open .chat-messages-container {
    padding-bottom: 120px;
}

@supports (-webkit-touch-callout: none) {
    .app-container {
        height: -webkit-fill-available;
    }
    
    body.keyboard-open .chat-header {
        position: sticky;
        top: 0;
    }
}

/* Stili per il link alla pagina di changelog completo */
.view-all-changelog {
    text-align: center;
    margin: 30px 0;
}

.changelog-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.changelog-link span {
    margin-right: 8px;
}

.changelog-link:hover {
    background: #2c3e50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
}

.changelog-link:active {
    transform: translateY(0);
}

/* Menu Header Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

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

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #364f6b 0%, #2980b9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.nav-item {
    margin: 0 5px;
    position: relative;
}

.nav-item a {
    display: block;
    padding: 10px 15px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.nav-item a:hover {
    color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
}

.nav-item.active a {
    color: #2196F3;
    font-weight: 600;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: #2196F3;
    border-radius: 3px;
}

.nav-cta {
    background-color: #2196F3;
    color: white !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background-color: #1976D2 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger-icon {
    display: block;
    position: relative;
    width: 24px;
    height: 18px;
}

.hamburger-icon .line {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: #2c3e50;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: 0.25s ease-in-out;
}

.hamburger-icon .line:nth-child(1) {
    top: 0;
}

.hamburger-icon .line:nth-child(2) {
    top: 8px;
}

.hamburger-icon .line:nth-child(3) {
    top: 16px;
}

.mobile-menu-toggle.active .hamburger-icon .line:nth-child(1) {
    top: 8px;
    transform: rotate(135deg);
}

.mobile-menu-toggle.active .hamburger-icon .line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon .line:nth-child(3) {
    top: 8px;
    transform: rotate(-135deg);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        flex-direction: column;
        background-color: #fff;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        padding: 20px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        align-items: flex-start;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-item {
        margin: 10px 0;
        width: 100%;
    }

    .nav-item.active::after {
        display: none;
    }

    .nav-item a {
        padding: 12px 15px;
        width: 100%;
    }

    .nav-item.cta-item {
        margin-top: 20px;
    }

    .nav-cta {
        text-align: center;
        display: block;
        width: 100%;
    }
    
    .landing-page {
        padding-top: 70px;
    }
    
    .hero-section {
        min-height: calc(90vh - 70px);
    }
}

/* Effetto scroll: header diventa più compatto quando si scorre la pagina */
.site-header.scrolled {
    height: 60px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

.site-header.scrolled .header-container {
    height: 60px;
}

.site-header.scrolled .logo-text {
    font-size: 1.6rem;
}

/* Stili per il menu divider */
.menu-divider {
    height: 1px;
    background-color: rgba(0,0,0,0.1);
    margin: 10px 0;
}

.menu-button-item {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 8px 0;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-button-item:hover {
    color: #2196F3;
}

.menu-button-item i {
    margin-right: 8px;
    font-size: 14px;
}

/* Miglioramenti desktop */
@media (min-width: 769px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
        overflow-x: hidden;
    }
    
    .app-container {
        height: 100vh;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px;
        position: relative;
    }
    
    .chat-container {
        width: 100%;
        max-width: 900px;
        height: 85vh;
        background: white;
        border-radius: 20px;
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        overflow: hidden;
    }
    
    .chat-header {
        background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
        color: white;
        padding: 25px 30px;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    }
    
    .chat-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
        pointer-events: none;
    }
    
    .header-content h2 {
        font-size: 1.8rem;
        font-weight: 600;
        margin: 0;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .header-content p {
        margin: 5px 0 0 0;
        opacity: 0.9;
        font-size: 0.95rem;
        font-weight: 300;
    }
    
    .menu-button {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        color: white;
        width: 45px;
        height: 45px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
    }
    
    .menu-button:hover {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    
    .chat-messages-container {
        flex: 1;
        padding: 0;
        background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
        position: relative;
    }
    
    .chat-messages {
        height: 100%;
        overflow-y: auto;
        padding: 30px;
        scroll-behavior: smooth;
    }
    
    .chat-messages::-webkit-scrollbar {
        width: 8px;
    }
    
    .chat-messages::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 10px;
    }
    
    .chat-messages::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #667eea, #764ba2);
        border-radius: 10px;
        border: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #5a6fd8, #6b42a0);
    }
    
    .message {
        margin: 20px 0;
        padding: 18px 24px;
        border-radius: 18px;
        max-width: 80%;
        position: relative;
        line-height: 1.6;
        font-size: 15px;
        animation: slideInMessage 0.3s ease-out;
    }
    
    @keyframes slideInMessage {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .user-message {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        margin-left: auto;
        margin-right: 0;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        border-bottom-right-radius: 8px;
    }
    
    .user-message::before {
        content: '';
        position: absolute;
        bottom: 0;
        right: -8px;
        width: 0;
        height: 0;
        border-left: 8px solid #764ba2;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }
    
    .ai-message {
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        color: #2c3e50;
        margin-left: 0;
        margin-right: auto;
        border: 2px solid rgba(102, 126, 234, 0.1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        border-bottom-left-radius: 8px;
    }
    
    .ai-message::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: -10px;
        width: 0;
        height: 0;
        border-right: 10px solid #f8f9fa;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }
    
    .chat-footer {
        background: linear-gradient(to top, #ffffff 0%, #f8f9fa 100%);
        padding: 25px 30px;
        border-radius: 0 0 20px 20px;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.05);
    }
    
    .quick-buttons {
        display: flex;
        gap: 12px;
        margin-bottom: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .quick-btn {
        padding: 10px 16px;
        border: none;
        border-radius: 25px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        backdrop-filter: blur(10px);
    }
    
    .quick-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        transition: left 0.5s;
    }
    
    .quick-btn:hover::before {
        left: 100%;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #3498db, #2980b9);
        color: white;
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    }
    
    .btn-success {
        background: linear-gradient(135deg, #2ecc71, #27ae60);
        color: white;
        box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    }
    
    .btn-danger {
        background: linear-gradient(135deg, #e74c3c, #c0392b);
        color: white;
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    }
    
    .btn-warning {
        background: linear-gradient(135deg, #f39c12, #e67e22);
        color: white;
        box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
    }
    
    .chat-input {
        display: flex;
        gap: 15px;
        align-items: flex-end;
        background: white;
        padding: 15px;
        border-radius: 25px;
        box-shadow: 
            0 5px 15px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
        border: 2px solid rgba(102, 126, 234, 0.1);
        transition: all 0.3s ease;
    }
    
    .chat-input:focus-within {
        border-color: rgba(102, 126, 234, 0.3);
        box-shadow: 
            0 5px 15px rgba(0, 0, 0, 0.1),
            0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    #userInput {
        flex: 1;
        border: none;
        outline: none;
        resize: none;
        font-size: 15px;
        line-height: 1.5;
        color: #2c3e50;
        background: transparent;
        max-height: 120px;
        min-height: 20px;
    }
    
    #userInput::placeholder {
        color: #bdc3c7;
        font-style: italic;
    }
    
    .btn-send {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 18px;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .btn-send:hover {
        transform: translateY(-2px) scale(1.05);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    
    .btn-send:active {
        transform: translateY(0) scale(0.95);
    }
    
    .dropdown-content {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 15px;
        box-shadow: 
            0 20px 40px rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        min-width: 280px;
        animation: dropdownSlide 0.3s ease-out;
    }
    
    @keyframes dropdownSlide {
        from {
            opacity: 0;
            transform: translateY(-10px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    .menu-item {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .menu-item:last-child {
        border-bottom: none;
    }
    
    .toggle-switch {
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
    }
    
    .toggle-slider {
        width: 50px;
        height: 26px;
        background: #ddd;
        border-radius: 26px;
        position: relative;
        transition: all 0.3s ease;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .toggle-slider::before {
        content: '';
        position: absolute;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: white;
        top: 2px;
        left: 2px;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    input[type="checkbox"]:checked + .toggle-slider {
        background: linear-gradient(135deg, #667eea, #764ba2);
    }
    
    input[type="checkbox"]:checked + .toggle-slider::before {
        transform: translateX(24px);
    }
    
    .speed-slider {
        width: 100%;
        height: 6px;
        border-radius: 3px;
        background: #ddd;
        outline: none;
        margin: 10px 0;
        cursor: pointer;
    }
    
    .speed-slider::-webkit-slider-thumb {
        appearance: none;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea, #764ba2);
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }
    
    .speed-slider::-webkit-slider-thumb:hover {
        transform: scale(1.2);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    
    .thinking {
        display: flex;
        align-items: center;
        padding: 15px 20px;
        margin: 15px 0;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 15px;
        border-left: 4px solid #667eea;
        max-width: 80%;
        animation: slideInMessage 0.3s ease-out;
    }
    
    .typewriter-text {
        overflow: hidden;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    .ai-message {
        overflow: hidden;
        animation: expandContainer 0.3s ease-out;
    }
    
    @keyframes expandContainer {
        from {
            max-height: 0;
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            max-height: 1000px;
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .message.ai-message {
        transition: all 0.2s ease-out;
        animation: fadeInUp 0.3s ease-out;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
            max-height: 0;
        }
        to {
            opacity: 1;
            transform: translateY(0);
            max-height: 1000px;
        }
    }
    
    .modal {
        backdrop-filter: blur(10px);
    }
    
    .modal-content {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: 20px;
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.25),
            0 0 0 1px rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        max-width: 500px;
        animation: modalSlide 0.3s ease-out;
    }
    
    @keyframes modalSlide {
        from {
            opacity: 0;
            transform: translateY(-30px) scale(0.9);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    .modal-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 20px 25px;
        border-radius: 20px 20px 0 0;
        position: relative;
        overflow: hidden;
    }
    
    .modal-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
        pointer-events: none;
    }
    
    .star-rating i {
        font-size: 24px;
        color: #ddd;
        cursor: pointer;
        transition: all 0.3s ease;
        margin: 0 3px;
    }
    
    .star-rating i:hover,
    .star-rating i.active {
        color: #ffc107;
        transform: scale(1.2);
        text-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    }
    
    .form-control {
        border: 2px solid rgba(102, 126, 234, 0.1);
        border-radius: 10px;
        padding: 12px 15px;
        transition: all 0.3s ease;
        background: rgba(255, 255, 255, 0.8);
    }
    
    .form-control:focus {
        border-color: rgba(102, 126, 234, 0.3);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        background: white;
    }
    
    .btn-primary, .btn-secondary {
        padding: 12px 24px;
        border-radius: 25px;
        font-weight: 500;
        transition: all 0.3s ease;
        border: none;
        cursor: pointer;
        position: relative;
        overflow: hidden;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    
    .btn-secondary {
        background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
        color: white;
        box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
    }
    
    .btn-primary:hover, .btn-secondary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    }
}

/* CSS di sicurezza per espansione contenitore */
.message {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    min-height: auto !important;
}

.message .typewriter-text {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    min-height: 1.5em;
    display: block;
}

.chat-messages {
    overflow-y: auto;
    overflow-x: hidden;
}

.chat-messages-container {
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-bottom: calc(50px + env(safe-area-inset-bottom));
}

.ai-message,
.user-message,
.component-message {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.99);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.8s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    font-size: 5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 10px;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.splash-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 768px) {
    .splash-logo {
        font-size: 3.5rem;
        letter-spacing: 6px;
    }
}

/* Stili per funzionalità premium */
.premium-features {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-button {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background-color: #f5f7fa;
    cursor: pointer;
    transition: all 0.2s;
}

.feature-button:hover {
    background-color: #e4e8f0;
}

.premium-locked {
    opacity: 0.7;
    position: relative;
}

.premium-locked:hover {
    background-color: #f5f7fa;
}

.premium-locked::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.premium-badge {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: bold;
}

.premium-upgrade-banner {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    border-left: 3px solid #3498db;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.premium-upgrade-banner a {
    color: #3498db;
    font-weight: 600;
    text-decoration: none;
}

.premium-upgrade-banner a:hover {
    text-decoration: underline;
}

.menu-label-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-hint {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.mode-selector-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

@media (min-width: 768px) {
    .mode-selector-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(47, 79, 79, 0.04);
    border: 1px solid rgba(47, 79, 79, 0.08);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    position: relative;
}

.mode-option:hover {
    border-color: rgba(33, 150, 243, 0.35);
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.12);
    transform: translateY(-2px);
}

.mode-option.active {
    border-color: rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.18);
}

.mode-option .mode-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 150, 243, 0.12);
    color: #2196F3;
    font-size: 18px;
}

.mode-option.active .mode-icon {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    color: #5a6fd8;
}

.mode-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.mode-option.active .mode-title {
    color: #5a6fd8;
}

.mode-description {
    font-size: 12px;
    color: #606f7b;
    line-height: 1.4;
}

.mode-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 8px;
    border-radius: 30px;
    background: rgba(33, 150, 243, 0.12);
    color: #1c77c3;
    align-self: flex-start;
}

.mode-option.active .mode-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.custom-mode-hint {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(44, 62, 80, 0.7);
    line-height: 1.5;
}

.features-section .feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}

.features-section .feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}