﻿/* ========== INVENI CSS - VERSIONE COMPLETA ========== */

/* 1. VARIABILI & RESET */
:root {
    --primario: #2563eb;
    --primario-scuro: #1d4ed8;
    --secondario: #10b981;
    --successo: #10b981;
    --facebook: #1877F2;
    --sfondo: #ffffff;
    --sfondo-chiaro: #f8fafc;
    --sfondo-grigio: #f1f5f9;
    --testo: #1a1a1a;
    --testo-chiaro: #4b5563;
    --testo-grigio: #64748b;
    --bordo: #e2e8f0;
    --ombra: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ombra-pesante: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--testo);
    background-color: var(--sfondo);
}

/* 2. LAYOUT UTILITY */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center {
    text-align: center;
}

/* 3. NAVIGAZIONE - MODIFICATO PER LOGO A SINISTRA */
.nav-inveni {
    background: var(--sfondo);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    margin: 0;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between; /* LOGO A SINISTRA, PULSANTI A DESTRA */
    align-items: center;
}

/* LOGO SECTION - SPOSTATO COMPLETAMENTE A SINISTRA */
.logo-section {
    margin-right: auto; /* Spinge tutto il resto a destra */
    flex-shrink: 0; /* Impedisce al logo di ridimensionarsi */
}

/* LOGO ALLINEATO A SINISTRA */
.logo-inveni {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0; /* IMPEDISCE AL LOGO DI RIDIMENSIONARSI */
}

.logo-img {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.2));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primario);
    letter-spacing: -0.5px;
}

/* MENU DI NAVIGAZIONE (NASCOSTO PER ORA) */
.nav-menu {
    display: none; /* NASCONDIMI IL MENU ORIGINALE */
}

/* Badge Autore in Homepage (MODIFICATO per sfondo chiaro) */
.autore-badge-home {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc; /* Sfondo chiaro invece che scuro */
    border: 1px solid #d1d5db; /* Bordo grigio invece che bianco trasparente */
    border-radius: 0.5rem;
    color: #374151; /* Testo scuro invece che chiaro */
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    max-width: 180px;
    overflow: hidden;
    position: relative;
}

.autore-nome-home {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.menu-chevron-home {
    font-size: 0.8rem;
    margin-left: 0.3rem;
    transition: transform 0.3s ease;
    color: #6b7280; /* Grigio per la freccia */
}

.autore-badge-home:hover {
    background: #f1f5f9; /* Grigio più scuro al hover */
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); /* Ombra più leggera */
}

/* Menu in homepage (correggi colori per sfondo chiaro) */
.menu-autore-overlay-home {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: transparent;
}

.menu-autore-tendina-home {
    position: absolute;
    top: 60px;
    right: 20px;
    background: white; /* Sfondo bianco invece di blu petrolio */
    border: 1px solid #e2e8f0; /* Bordo grigio chiaro */
    border-radius: 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); /* Ombra più leggera */
    z-index: 10000;
    min-width: 250px;
    overflow: hidden;
}

/* Header del menu (correggi per sfondo chiaro) */
.menu-autore-header {
    padding: 1rem;
    background: #f8fafc; /* Grigio chiaro */
    border-bottom: 1px solid #e2e8f0;
}

.menu-autore-nome {
    font-weight: 600;
    color: #1a1a1a; /* Testo scuro */
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.menu-autore-email {
    font-size: 0.85rem;
    color: #64748b; /* Grigio medio */
    margin-bottom: 0.25rem;
}

.menu-autore-livello {
    font-size: 0.8rem;
    color: #10b981; /* Verde */
    font-weight: 500;
}

/* Separatore (correggi per sfondo chiaro) */
.menu-autore-separatore {
    height: 1px;
    background: #e2e8f0; /* Grigio chiaro */
    margin: 0.5rem 0;
}

/* Voci del menu (correggi per sfondo chiaro) */
.menu-autore-voce {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    color: #374151; /* Testo scuro */
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
}

    .menu-autore-voce:hover {
        background: #f1f5f9; /* Grigio chiaro al hover */
    }

    .menu-autore-voce i {
        width: 20px;
        text-align: center;
        opacity: 0.8;
        color: #64748b; /* Grigio per le icone */
    }

/* Voce logout con colore speciale */
.menu-autore-logout {
    color: #dc2626; /* Rosso invece di arancione chiaro */
}

    .menu-autore-logout:hover {
        background: #fee2e2; /* Rosso molto chiaro */
    }

/* Assicurati che nav-buttons abbia position relative */
.nav-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.btn-ai {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .btn-ai:hover {
        background: #0da271;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(16, 185, 129, 0.2);
    }

.btn-login {
    background: #f8fafc;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

    .btn-login:hover {
        background: #f1f5f9;
        border-color: #9ca3af;
        transform: translateY(-1px);
    }

.btn-signup {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

    .btn-signup:hover {
        background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
    }

/* 4. PULSANTI GENERALI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primario) 0%, var(--primario-scuro) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    }

.btn-outline {
    background: transparent;
    color: var(--primario);
    border: 2px solid var(--primario);
}

    .btn-outline:hover {
        background: rgba(37, 99, 235, 0.05);
        transform: translateY(-2px);
    }

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-facebook {
    background: var(--facebook);
    color: white;
    gap: 0.5rem;
}

    .btn-facebook:hover {
        background: #166ada;
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(24, 119, 242, 0.4);
    }


.btn-guida {
    background: linear-gradient(135deg, #10b981 0%, #0da271 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    border: none;
}

    .btn-guida:hover {
        background: linear-gradient(135deg, #0da271 0%, #0b8a62 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    }


/* 5. HERO SECTION */
.hero-section {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../immagini/sfondo-inveni.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
    color: white;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #f1f5f9;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 6. SEZIONI GENERALI */
.section {
    padding: 5rem 2rem;
}

.section-light {
    background: var(--sfondo);
}

.section-gray {
    background: var(--sfondo-grigio);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--testo);
    letter-spacing: -0.025em;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--testo-grigio);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 7. CARD COME FUNZIONA */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--sfondo);
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    box-shadow: var(--ombra);
    border: 1px solid var(--bordo);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

    .card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    }

.card-icon {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, var(--primario) 0%, var(--primario-scuro) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--testo);
}

.card-text {
    color: var(--testo-grigio);
    line-height: 1.6;
    font-size: 1rem;
}

/* 8. SEZIONE UTILIZZATORI */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.user-card {
    background: var(--sfondo);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--bordo);
    transition: all 0.3s ease;
}

    .user-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }

.user-icon {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, var(--primario) 0%, var(--primario-scuro) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    margin: 0 auto 1.5rem;
}

.user-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--testo);
}

.user-text {
    color: var(--testo-grigio);
    line-height: 1.5;
    font-size: 0.95rem;
}

/* 9. SEZIONE PARTNER */
.partner-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--sfondo-chiaro);
    border-radius: 1.5rem;
    padding: 3rem;
    text-align: center;
    box-shadow: var(--ombra-pesante);
    border: 1px solid var(--bordo);
    transition: all 0.3s ease;
}

    .partner-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
    }

.partner-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: block;
    object-fit: cover;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 4px solid var(--sfondo);
}

.partner-logo-fallback {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--successo) 0%, #0da271 100%);
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.partner-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--testo);
}

.partner-text {
    color: var(--testo-chiaro);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.partner-actions {
    margin-top: 1.5rem;
}

.partner-footnote {
    text-align: center;
    margin-top: 3rem;
    color: #94a3b8;
    font-size: 0.95rem;
    font-style: italic;
}

/* 10. CALL TO ACTION */
.section-cta {
    background: var(--sfondo);
}

.cta-box {
    background: linear-gradient(135deg, var(--sfondo-chiaro) 0%, var(--sfondo-grigio) 100%);
    border-radius: 1.5rem;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--bordo);
    text-align: center;
}

.cta-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--testo);
}

.cta-text {
    font-size: 1.125rem;
    color: var(--testo-grigio);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}






/* 11. FOOTER */
.footer {
    background: var(--testo);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-copyright {
    color: #cbd5e1;
}

.footer-contact {
    margin-top: 0.5rem;
}

    .footer-contact a {
        color: #93c5fd;
        text-decoration: none;
    }

        .footer-contact a:hover {
            text-decoration: underline;
        }



/* ========== CHAT AI OVERLAY ========== */
.ai-chat-panel {
    position: fixed;
    top: 90px; /* Sotto la navbar */
    right: 20px;
    width: 360px;
    height: calc(100vh - 110px); /* Altezza totale meno navbar e margini */
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--bordo);
}

/* Header chat */
.ai-chat-header {
    background: linear-gradient(135deg, var(--primario) 0%, var(--primario-scuro) 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
}

    .ai-chat-title small {
        font-size: 0.75rem;
        opacity: 0.8;
        font-weight: 400;
    }

.ai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .ai-close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
    }


/* Area messaggi */
.ai-chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--sfondo-chiaro);
}

.ai-welcome {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--bordo);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

    .ai-welcome p {
        margin-bottom: 0.75rem;
        color: var(--testo);
    }

    .ai-welcome ul {
        margin-left: 1.25rem;
        margin-bottom: 0.75rem;
        color: var(--testo-grigio);
    }

    .ai-welcome li {
        margin-bottom: 0.25rem;
    }

/* Input area */
.ai-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--bordo);
    background: white;
    flex-shrink: 0;
}

.ai-input {
    flex: 1;
    padding: 0.85rem 1rem;
    border: 1px solid var(--bordo);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

    .ai-input:focus {
        outline: none;
        border-color: var(--primario);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.ai-send-btn {
    background: var(--primario);
    color: white;
    border: none;
    width: 48px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .ai-send-btn:hover {
        background: var(--primario-scuro);
        transform: translateY(-1px);
    }

/* Messaggi della chat (se implementati dopo) */
.ai-message {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    max-width: 85%;
}

    .ai-message.user {
        background: var(--primario);
        color: white;
        margin-left: auto;
        border-bottom-right-radius: 4px;
    }

    .ai-message.bot {
        background: white;
        border: 1px solid var(--bordo);
        margin-right: auto;
        border-bottom-left-radius: 4px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

/* Responsive */
@media (max-width: 768px) {
    .ai-chat-panel {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
        top: 80px;
        height: calc(100vh - 90px);
    }

}

@media (max-width: 576px) {
    .ai-chat-panel {
        width: calc(100% - 1rem);
        right: 0.5rem;
        left: 0.5rem;
    }
}



/* ========== CHAT AI OVERLAY ========== */
.ai-chat-panel {
    position: fixed;
    top: 100px; /* Sotto la navbar */
    right: 20px;
    width: 360px;
    height: calc(100vh - 110px); /* Altezza totale meno navbar e margini */
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--bordo);
}

/* Header chat */
.ai-chat-header {
    background: linear-gradient(135deg, var(--primario) 0%, var(--primario-scuro) 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
}

    .ai-chat-title small {
        font-size: 0.75rem;
        opacity: 0.8;
        font-weight: 400;
    }

.ai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .ai-close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
    }

/* Area messaggi */
.ai-chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--sfondo-chiaro);
}

.ai-welcome {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--bordo);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

    .ai-welcome p {
        margin-bottom: 0.75rem;
        color: var(--testo);
    }

    .ai-welcome ul {
        margin-left: 1.25rem;
        margin-bottom: 0.75rem;
        color: var(--testo-grigio);
    }

    .ai-welcome li {
        margin-bottom: 0.25rem;
    }

/* Input area */
.ai-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--bordo);
    background: white;
    flex-shrink: 0;
}

.ai-input {
    flex: 1;
    padding: 0.85rem 1rem;
    border: 1px solid var(--bordo);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

    .ai-input:focus {
        outline: none;
        border-color: var(--primario);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.ai-send-btn {
    background: var(--primario);
    color: white;
    border: none;
    width: 48px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .ai-send-btn:hover {
        background: var(--primario-scuro);
        transform: translateY(-1px);
    }

/* Messaggi della chat (se implementati dopo) */
.ai-message {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    max-width: 85%;
}

    .ai-message.user {
        background: var(--primario);
        color: white;
        margin-left: auto;
        border-bottom-right-radius: 4px;
    }

    .ai-message.bot {
        background: white;
        border: 1px solid var(--bordo);
        margin-right: auto;
        border-bottom-left-radius: 4px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        white-space: pre-wrap; /* Mantiene gli spazi e i ritorni a capo */
        word-break: break-word;
    }

/* Contenitore principale dei messaggi */
.ai-messages {
    width: 100%;
    padding-right: 5px; /* piccolo spazio per lo scroll */
}

/* Messaggio del bot (risposta AI) */
.ai-message.bot {
    max-width: 100%;
    width: fit-content;
    margin-right: auto; /* allineato a sinistra */
    word-wrap: break-word;
}

/* Messaggio dell'utente (opzionale, per bilanciare) */
.ai-message.user {
    max-width: 80%;
    margin-left: auto; /* allineato a destra */
    word-wrap: break-word;
}


/* Responsive */
@media (max-width: 768px) {
    .ai-chat-panel {
        width: calc(100% - 2rem);
        right: 1rem;
        left: 1rem;
        top: 80px;
        height: calc(100vh - 90px);
    }
}

@media (max-width: 576px) {
    .ai-chat-panel {
        width: calc(100% - 1rem);
        right: 0.5rem;
        left: 0.5rem;
    }
}




/* 12. RESPONSIVE */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

        .hero-actions .btn {
            width: 100%;
            max-width: 300px;
        }

    .card-grid,
    .users-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 3rem 1rem;
    }

    /* NAVBAR MOBILE */
    .nav-actions {
        gap: 0.5rem;
    }

    .btn-chat,
    .btn-login,
    .btn-signup {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .logo-text {
        display: none;
    }

    .logo-img {
        height: 60px;
    }
}

@media (max-width: 576px) {
    .nav-actions {
        gap: 0.25rem;
    }

    .btn-chat span,
    .btn-login span,
    .btn-signup span {
        display: none;
    }

    .btn-chat,
    .btn-login,
    .btn-signup {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

        .btn-chat i,
        .btn-login i,
        .btn-signup i {
            margin: 0;
        }
}

/* 13. MAPPA STYLES */
.mappa-container {
    position: relative;
    width: 100%;
    height: 600px;
    min-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.mappa-viewport {
    width: 100%;
    height: 100%;
}

.mappa-caricamento {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.mappa-errori {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(254, 226, 226, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: #dc2626;
}

/* 14. PULSANTE DRAG GOOGLE MAPS STYLE */
.google-control-drag-container {
    position: absolute;
    top: 110px;
    right: 11px;
    z-index: 1000;
}

.google-control-drag {
    width: 40px !important;
    height: 40px !important;
    background-color: #fff;
    border: 2px solid #fff;
    border-radius: 2px;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    outline: none;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 400;
}

    .google-control-drag:hover {
        background-color: #f8f9fa;
        border-color: #f8f9fa;
        color: rgba(0, 0, 0, 0.9);
        box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 8px -1px;
    }

    .google-control-drag.active {
        background-color: #1a73e8 !important;
        border-color: #1a73e8 !important;
        color: white !important;
    }

        .google-control-drag.active:hover {
            background-color: #0d62d9 !important;
            border-color: #0d62d9 !important;
        }

    .google-control-drag i {
        font-size: 20px !important;
        line-height: 1;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .google-control-drag::after,
    .google-control-drag::before {
        display: none !important;
        content: none !important;
    }

/* 15. ICONA CONO BUSSOLA GOOGLE MAPS STYLE */
.google-control-cono-container {
    position: absolute;
    top: 156px;
    right: 11px;
    z-index: 999;
}

.google-control-cono {
    width: 40px !important;
    height: 40px !important;
    background-color: #fff;
    border: 2px solid #fff;
    border-radius: 2px;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    outline: none;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 400;
}

    .google-control-cono:not(:disabled):hover {
        background-color: #f8f9fa;
        border-color: #f8f9fa;
        color: rgba(0, 0, 0, 0.9);
        box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 8px -1px;
    }

    .google-control-cono.active {
        background-color: #1a73e8 !important;
        border-color: #1a73e8 !important;
        color: white !important;
    }

        .google-control-cono.active:hover {
            background-color: #0d62d9 !important;
            border-color: #0d62d9 !important;
        }

    .google-control-cono:disabled {
        background-color: #f8f9fa;
        border-color: #e9ecef;
        color: #adb5bd;
        cursor: not-allowed;
        opacity: 0.6;
    }

    .google-control-cono i {
        font-size: 20px !important;
        line-height: 1;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .google-control-cono::after,
    .google-control-cono::before {
        display: none !important;
        content: none !important;
    }

    .google-control-cono i.fa-filter {
        font-size: 20px !important;
        width: 20px !important;
        height: 20px !important;
        line-height: 20px !important;
    }

@media (max-width: 768px) {
    .google-control-cono-container {
        top: 150px;
        right: 8px;
    }
}



/* PULSANTE GUIDA COMPLETA - EVIDENTE */
.btn-guida-completa {
    background: linear-gradient(135deg, #10b981 0%, #0da271 100%);
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

    .btn-guida-completa::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.7s;
        z-index: -1;
    }

    .btn-guida-completa:hover {
        background: linear-gradient(135deg, #0da271 0%, #0b8a62 100%);
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
        color: white !important;
    }

        .btn-guida-completa:hover::before {
            left: 100%;
        }

    .btn-guida-completa:active {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }

    /* Icona opzionale nel pulsante */
    .btn-guida-completa i {
        margin-right: 0.5rem;
        font-size: 1.1rem;
    }





