/* --- GiodaLab Custom Styles --- */

/* --- Variabili Colore Brand --- */
:root {
    --blu-petrolio: #1D6A73;
    --ocra-dorato: #F1B24C;
    --grigio-grafite: #3C3C3C;
    --crema-calda: #FAF3E3;
    --rosso-pomodoro: #C94B3B;
}

/* --- Stili Generali e Tipografia --- */
body {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    background-color: var(--crema-calda);
    color: var(--grigio-grafite);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', serif;
    color: var(--blu-petrolio);
    font-weight: 700;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

section {
    border-bottom: 1px solid rgba(60, 60, 60, 0.1);
}

main > section:last-of-type {
    border-bottom: none;
}


/* --- Header & Navigation --- */
.navbar {
    background-color: var(--crema-calda) !important;
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--grigio-grafite);
    text-decoration: none;
}

.logo span {
    color: var(--rosso-pomodoro);
}

.nav-link {
    color: var(--grigio-grafite);
    font-weight: 400;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--rosso-pomodoro);
}

/* --- Pulsanti CTA --- */
.btn {
    padding: 10px 25px;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 600; /* Leggermente bold per leggibilità */
    transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}
/* --- Pulsanti CTA --- */
.cta-button {
    background-color: var(--rosso-pomodoro);
    border-color: var(--rosso-pomodoro);
    color: #fff;
}


.cta-button:hover {
    background-color: #A94234; /* Rosso più scuro */
    border-color: #A94234;
    color: #fff;
    transform: translateY(-2px);
}


/* --- Card Personalizzate --- */
.about-card {
    border: none;
}

.about-card h3, .lab-card h3 {
     color: var(--blu-petrolio);
}

.about-card h3 span {
    margin-right: 10px;
}

.about-card-ocra {
    border: none;
    border-left: 5px solid var(--ocra-dorato) !important;
}

.about-card-petrolio{
    border: none;
    border-left: 5px solid var(--blu-petrolio) !important;
}

.about-card-rosso{
    border: none;
    border-left: 5px solid var(--rosso-pomodoro) !important;
}

.lab-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
}

.lab-card .card-img-top {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.lab-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}


/* --- Contatti & Footer --- */
.email-link {
    font-weight: 600;
    color: var(--rosso-pomodoro);
    text-decoration: none;
}

.email-link:hover {
    text-decoration: underline;
}

footer {
    background-color: #f5ebd9; /* Una tonalità leggermente più scura del body */
    color: rgba(60, 60, 60, 0.7);
}


/* --- Stili per Chat Assistant --- */
.chat-container {
    position: fixed;
    z-index: 1000;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    flex-direction: column;

    /* FIX PER TRANSIZIONE FLUIDA: Specifichiamo le proprietà da animare */
    transition: width 0.4s ease-in-out, height 0.4s ease-in-out, bottom 0.4s ease-in-out, right 0.4s ease-in-out;

    /* Default (Mobile First): A tutto schermo quando APERTO */
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
}

.chat-container.collapsed {
    /* Stile quando CHIUSO (uguale per mobile e desktop) */
    width: 350px;
    max-width: 90%;
    height: 48px; /* Altezza fissa per un'animazione stabile */
    bottom: 20px;
    right: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Media Query per schermi più grandi */
@media (min-width: 768px) {
    .chat-container:not(.collapsed) {
        /* Stile quando APERTO su schermi GRANDI */
        width: 50vw;
        max-width: 600px;
        height: 70vh;
        max-height: 700px;
        bottom: 20px;
        right: 20px;
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }

    /* Arrotonda gli angoli superiori dell'header quando la chat è aperta su desktop */
    .chat-container:not(.collapsed) .chat-header {
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }
}


.chat-header {
    background-color: var(--blu-petrolio);
    color: #fff;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* header quando la chat è chiusa */
.chat-container.collapsed .chat-header {
    height: 100%;
    border-radius: 10px; /* Si adatta perfettamente al contenitore genitore */
}


.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
    position: relative;
    z-index: 2;
}

.chat-toggle-icon {
    font-size: 0;
    width: 12px;
    height: 12px;
    position: relative;
    z-index: 2;
}

.chat-toggle-icon::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 0;
    width: 8px;
    height: 8px;
    border-style: solid;
    border-color: #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform 0.3s ease-in-out;
}

.chat-container.collapsed .chat-toggle-icon::before {
    transform: rotate(-135deg);
}


.gioda-app-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: 100%;
    transition: visibility 0s, opacity 0.3s ease-in-out;
    visibility: visible;
    opacity: 1;
    overflow: hidden;
}

.chat-container.collapsed .gioda-app-container {
    visibility: hidden;
    opacity: 0;
    height: 0;
}

.gioda-chat-window {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
}

.gioda-input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #ddd;
    gap: 10px;
}

#gioda-user-input {
    flex-grow: 1;
    margin-right: 0;
}

#gioda-send-btn {
    flex-shrink: 0;
    background-color: var(--rosso-pomodoro);
    border-color: var(--rosso-pomodoro);
    color: #fff;
    transition: background-color 0.3s;
}

#gioda-send-btn:hover {
    background-color: #A94234;
    border-color: #A94234;
}

/* Messaggi nel chat window */
.user-message, .gioda-message {
    padding: 8px 12px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 80%;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    background-color: var(--ocra-dorato);
    color: var(--grigio-grafite);
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.gioda-message {
    background-color: #e9ecef;
    color: var(--grigio-grafite);
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

/*
 * Stili per la pagina
 */

.page-item-type {
    text-transform: uppercase;
    color: var(--rosso-pomodoro);
    font-weight: bold;
}

/* --- NUOVI STILI HOMEPAGE V2 --- */

/* Nuove utility per i colori del brand */
.brand-bg-petrolio { background-color: var(--blu-petrolio); }
.brand-bg-ocra { background-color: var(--ocra-dorato); }
.brand-bg-grafite { background-color: var(--grigio-grafite); }
.brand-text-rosso { color: var(--rosso-pomodoro); }
.brand-text-petrolio { color: var(--blu-petrolio); }
.brand-text-crema { color: var(--crema-calda); }
.brand-text-grafite { color: var(--grigio-grafite); }
.brand-text-ocra { color: var(--ocra-dorato); }

/* Stile per il pulsante CTA rosso */
.btn-cta-rosso {
    background-color: #C94B3B;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.btn-cta-rosso:hover {
    color: white;
    background-color: #a94234;
    transform: scale(1.05);
}

/* Stile per le card "Attrezzi" */
.card-tool {
    transition: transform 0.3s ease;
}

.card-tool:hover {
    transform: scale(1.05);
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

.animate-bounce {
    animation: bounce 2s infinite;
}
