body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    height: 100%;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: -webkit-fill-available;
    overflow: hidden;
    position: fixed; /* Importante per iOS */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.header {
    background-color: #003876;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.glacom-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.login {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.signup {
    background-color: white;
    color: #003876;
}

.logo {
    height: 40px;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 60px); /* Sottrai altezza header */
    height: calc(-webkit-fill-available - 60px); /* Per iOS */
}

.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f0f0f0;
    max-width: 400px;
    height: 100%;
    position: relative; /* Importante per iOS */
}

.features-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    overflow-y: auto;
    padding: 20px;
}

.chat-box {
    flex-grow: 1;
    background-color: #ffffff;
    border-radius: 10px 10px 0 0;
    margin: 20px 20px 0 20px;
    padding: 20px;
    overflow-y: auto;
}


.chat-input-container {
    background-color: #ffffff;
    border-radius: 0;
    padding: 15px;
    border-top: 1px solid #ddd;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    align-items: flex-end; /* Allinea gli elementi al fondo */
    min-height: 40px;
}

.chat-input input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

.chat-input button {
    padding: 10px;
    background-color: #003876;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.feature-box {
    background-color: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 20px;
}



/* Reset base per input e textarea su iOS */
input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}




/* Contenitore principale del quiz */
.quiz {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
}

/* Immagine del quiz */
.quiz-image {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 0 0 24px 0;
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.quiz-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    margin: 0 auto;
    display: block;
}

/* Domanda */
.quiz-question {
    margin-bottom: 24px;
    text-align: center;
}

#quizQuestion {
    font-size: 1.2rem;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.5;
    margin-bottom: 8px;
}

.quiz-category {
    display: inline-block;
    font-size: 0.9rem;
    color: #666;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 8px;
}

/* Bottoni opzioni */
.quiz-options {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.quiz-option {
    min-width: 120px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #003876;
    border-radius: 25px;
    background: #fff;
    color: #003876;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.quiz-option:hover {
    background: #003876;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 56, 118, 0.2);
}

.quiz-option:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Progress dots */
.quiz-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
}

.quiz-progress-dots {
    display: flex;
    gap: 8px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: #003876;
    transform: scale(1.2);
}

.progress-dot.completed {
    background: #4CAF50;
}

.quiz-counter {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 15px;
}

/* Quiz result */
.quiz-result {
    text-align: center;
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
}

.quiz-result.success {
    background: #e8f5e9;
    border: 1px solid #4CAF50;
    color: #2e7d32;
}

.quiz-result.failure {
    background: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
}

.quiz-result button {
    margin-top: 16px;
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    background: #003876;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-result button:hover {
    background: #002d5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 56, 118, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .quiz {
        padding: 16px;
        margin: 10px;
    }

    .quiz-question {
        font-size: 1rem;
    }

    .quiz-options {
        flex-direction: column;
        padding: 0 20px;
    }

    .quiz-option {
        width: 100%;
    }

    .quiz-progress {
        flex-direction: column;
        gap: 12px;
    }
}










/* School Search Styles */
.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-controls input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.geo-btn, .search-btn {
    padding: 8px 16px;
    background-color: #003876;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.school-card {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.school-card h3 {
    margin-top: 0;
    color: #003876;
}

.school-card p {
    margin: 5px 0;
}

.school-card a {
    color: #003876;
    text-decoration: none;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .main-content {
        height: calc(100vh - 110px);
    }
    
    .chat-section {
        max-width: none;
        height: 100%;
    }
    
    /* Quando features-section è attiva */
    .features-section.active + .chat-section {
        display: none;
    }
    
    .features-section.active {
        height: 100%;
        overflow-y: auto;
        display: block;
    }
    
    #gl-chatbot-body-content {
        height: calc(100vh - 180px);
    }
    
    .gl-message {
        max-width: 85%;
    }
}


/* Calendar Styles */
.feature-box {
    background-color: #f0f0f0;
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 20px;
    position: relative;
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.calendar-header h2 {
    margin: 0;
}

.current-month {
    color: #666;
    font-weight: normal;
}

.calendar-container {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
    overflow: hidden; /* Rimuove lo scroll */
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #003876;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
}

.nav-btn.prev {
    left: -16px;
}

.nav-btn.next {
    right: -16px;
}

.weekdays-header {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Cambiato da 7 a 5 colonne */
    gap: 5px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.calendar-day {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 4px;
}

.calendar-day.today {
    border: 2px solid #003876;
}

.day-number {
    text-align: center;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.time-slots {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-slot {
    text-align: center;
    padding: 4px;
    border-radius: 3px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-slot.available {
    background-color: #f0f9f0;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.time-slot.available:hover {
    background-color: #e8f5e9;
}

.time-slot.selected {
    background-color: #003876;
    color: white;
    border: 1px solid #002d5f;
}

.time-slot:not(.available) {
    background-color: #f5f5f5;
    color: #9e9e9e;
    cursor: default;
    border: 1px solid #e0e0e0;
}

/* Responsive Calendar */
@media (max-width: 768px) {
    .calendar-container {
        padding: 10px;
        margin: 0;
        width: 100%;
        min-width: 0; /* Rimuove la larghezza minima */
        
    }
    
    .weekdays-header, 
    .calendar-days {
        display: grid;
        grid-template-columns: repeat(5, 1fr); /* Forza 5 colonne uguali */
        gap: 4px;
        width: 100%;
    }
    
    .calendar-day {
        padding: 8px 2px; /* Riduce il padding orizzontale */
        min-width: 0; /* Rimuove la larghezza minima */
        font-size: 0.9em; /* Riduce leggermente il testo */
    }

    .time-slot {
        padding: 4px 2px;
        font-size: 0.85em;
    }

    /* Migliora la leggibilità dei numeri del giorno */
    .day-number {
        font-size: 0.95em;
        margin-bottom: 4px;
    }

    /* Rimuovi proprietà che causano scroll */
    .calendar-days,
    .weekdays-header {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(5, minmax(0, 1fr)); /* Usa minmax per evitare overflow */
    }

    /* Aggiusta i bottoni di navigazione */
    .nav-btn {
        width: 24px;
        height: 24px;
        font-size: 0.9em;
    }
    
    .nav-btn.prev {
        left: 0px;
    }
    
    .nav-btn.next {
        right: 0px;
    }
    
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    background-color: white;
    padding: 12px 15px; /* Aumentato il padding per dare più spazio */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 8px;
    color: #666;
    font-size: 0.8em;
    cursor: pointer;
    transition: color 0.2s;
    flex: 1;
}

.mobile-nav-btn.active {
    color: #003876;
}

.mobile-nav-btn svg {
    width: 24px;
    height: 24px;
}

/* Update existing media query */
@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        justify-content: space-around;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .main-content {
        flex-direction: column;
    }
    
    .chat-section {
        max-width: none;
    }
    
    .features-section {
        display: none;
        padding: 10px;
    }

    .features-section.active {
        display: block;
    }

    /* Adjust main content padding to account for navigation */
    .main-content {
        padding-top: 0;
    }
}

.mobile-close-btn {
    display: none;
}

@media (max-width: 768px) {
    .features-section.active {
        position: relative;  /* questo è fondamentale per il posizionamento del bottone */
    }

    .mobile-close-btn {
        display: flex;
        position: absolute;
        top: 20px;
        right: 20px;
        background: #003876;
        color: white;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 9999;
    }

    .mobile-close-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Calendar mobile adjustments */
@media (max-width: 768px) {
    .weekdays-header {
        grid-template-columns: repeat(5, 1fr); /* 5 colonne per i giorni lavorativi */
        font-size: 0.9em; /* Leggermente più piccolo su mobile */
        width:95%;
        margin-left: 10px;
    }

    .calendar-days {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px; /* Ridotto il gap per far stare tutto */
        width:95%;
        margin-left: 10px;
    }

    .calendar-day {
        padding: 8px 2px; /* Padding ridotto per mobile */
    }

    .time-slot {
        font-size: 0.85em;
        padding: 4px 2px;
    }

    /* Container del calendario scrollabile se necessario */
    .calendar-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 5px;
    }
    .current-month {
	    margin-right:40px
	}
}


/* Chat container styles */
#gl-chatbot-body-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Scroll fluido su iOS */
    background-color: #ffffff;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative; /* Importante per iOS */
}

/* Message containers */
.gl-client-message-container,
.gl-bot-message-container {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.gl-client-message-container {
    align-self: flex-end;
}

.gl-bot-message-container {
    align-self: flex-start;
}

/* Avatar styles */
.gl-avatar-bot,
.gl-avatar-client {
    padding: 0 8px;
    margin-bottom: 4px;
}

.gl-avatar-bot img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Message styles */
.gl-message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.gl-message.gl-bot {
    background-color: #f0f0f0;
    color: #333;
    align-self: flex-start;
}

.gl-message.gl-client {
    background-color: #003876;
    color: white;
    align-self: flex-end;
}

/* Input area styles */
#gl-chatbot-footer {
    padding: 10px;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

.gl-user-textarea {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    font-family: inherit;
    line-height: 1.4;
    margin-bottom: 0; /* Rimuove il margine inferiore */
    
            font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            font-size: 16px; /* Dimensione del testo ottimale per iOS */
            line-height: 1.4;
            margin-bottom: 0;
            background-color: #ffffff;
            -webkit-tap-highlight-color: transparent;
}

#btn-send-textarea {
    /*width: 40px;
    height: 40px;*/
    border-radius: 50%;
    border: none;
    background-color: #003876;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    
            flex-shrink: 0;
            border-radius: 50%;
            background-color: #003876;
            color: white;
            display: flex;
            padding: 0;
            margin: 0;
            -webkit-tap-highlight-color: transparent;
}


/* Feedback buttons */
.feedback-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.feedback-button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    background-color: transparent;
}

.thumbs-up::before {
    content: '👍';
}

.thumbs-down::before {
    content: '👎';
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 12px;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #003876;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gl-client-message-container,
    .gl-bot-message-container {
        max-width: 90%;
    }
}

@supports (-webkit-touch-callout: none) {
    .main-content {
        height: -webkit-fill-available;
    }

    @media (max-width: 768px) {
        #gl-chatbot-body-content {
            height: calc(100vh - 180px - env(safe-area-inset-bottom));
        }
    }
    
    .chat-section {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .chat-input-container {
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
    }
    
    /* Mantiene il bottone sempre visibile */
    #btn-send-textarea {
        position: sticky;
        bottom: 15px;
        height: 40px;
        align-self: flex-end;
        margin-bottom: env(safe-area-inset-bottom);
    }
    
    /* Previene lo scrolling della textarea sotto il bottone */
    .gl-user-textarea {
        padding-right: 60px; /* Spazio per il bottone */
    }
}

/* Media query per dispositivi mobili */
@media (max-width: 768px) {
    .chat-input {
        margin-bottom: 0;
    }
    
    .chat-input-container {
        padding: 10px;
    }
}

.appointment-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.appointment-button {
    background-color: #003876;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.appointment-button:hover {
    background-color: #002d5f;
}

.phone-button-container {
    text-align: center;
    margin: 15px 0;
}

.phone-message {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.phone-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.phone-button:hover {
    background-color: #218838;
    text-decoration: none;
    color: white;
}

.phone-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 15.5c-1.2 0-2.4-.2-3.6-.6-.3-.1-.7 0-1 .2l-2.2 2.2c-2.8-1.4-5.1-3.8-6.6-6.6l2.2-2.2c.3-.3.4-.7.2-1-.3-1.1-.5-2.3-.5-3.5 0-.6-.4-1-1-1H4c-.6 0-1 .4-1 1 0 9.4 7.6 17 17 17 .6 0 1-.4 1-1v-3.5c0-.6-.4-1-1-1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

@media (max-width: 768px) {
    .appointment-buttons {
        padding: 0 10px;
    }

    .appointment-button {
        font-size: 13px;
        padding: 10px 16px;
    }
}

.gl-message.gl-error {
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

.gl-message.gl-error p {
    margin: 0;
}






.quiz-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
}

.quiz-loader p {
    color: #666;
    margin-top: 15px;
    font-size: 0.9rem;
}

.quiz-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #003876;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* Stile generale del popup */
#saveChatPopup {
    display: none; /* Nascondi inizialmente */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    width: 90%; /* Responsive, prende il 90% dello schermo */
    max-width: 400px; /* Limite massimo su desktop */
    border-radius: 10px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: center;
}

/* Stile dell'overlay */
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Intestazione del popup */
#saveChatPopup h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
}

/* Icona del pollice */
#thumbs-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Stile della textarea per il commento */
#comment-box {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-size: 1rem;
    color: #333;
}

/* Contenitore per i pulsanti */
.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

/* Stile dei pulsanti */
.button-container button {
    flex: 1;
    padding: 10px;
    margin: 0 5px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* Stile del pulsante "Torna alla chat" */
.button-container button:first-child {
    background-color: #f0f0f0;
    color: #333;
}

.button-container button:first-child:hover {
    background-color: #e0e0e0;
}

/* Stile del pulsante "Nuova chat" */
.button-container button:last-child {
    background-color: #ff5e5e;
    color: #fff;
}

.button-container button:last-child:hover {
    background-color: #ff4c4c;
}

/* Ottimizzazioni per dispositivi mobili */
@media (max-width: 600px) {
    #saveChatPopup {
        padding: 15px;
        width: 95%;
    }

    #saveChatPopup h3 {
        font-size: 1.25rem;
    }

    #comment-box {
        font-size: 0.9rem;
    }

    .button-container button {
        font-size: 0.9rem;
        padding: 8px;
    }
}


.gl-bot-message-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.gl-bot-message-container .gl-avatar-bot {
    margin-right: 10px;
}

.button-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.order-type-dropdown {
    display: none; /* Nascondi la dropdown su desktop */
}

/* Visualizza la dropdown su dispositivi mobili */
@media (max-width: 768px) {
    .button-grid {
        display: none;
    }
    .order-type-dropdown {
        display: block;
        width: 100%;
        margin-top: 10px;
    }
}







/* Stile per i pulsanti (desktop e tablet) */
.button-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.button-grid button {
    background-color: #003876; /* Rosso acceso */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    text-align: center;
}

.button-grid button:hover {
    background-color: #002d5f; /* Colore più scuro al passaggio */
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px); /* Leggera elevazione al passaggio */
}

.button-grid button:active {
    background-color: #002451; /* Colore più scuro al clic */
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
    transform: translateY(0); /* Riduce l'elevazione al clic */
}

/* Stile per la select (solo su mobile) */
.order-type-dropdown {
    display: none; /* Nasconde la select su desktop */
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #003876;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333;
    margin-top: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none;
    cursor: pointer;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

.order-type-dropdown:focus {
    border-color: #002451;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 56, 118, 0.3);
}

/* Mostra la select e nasconde i pulsanti su dispositivi mobili */
@media (max-width: 768px) {
    .button-grid {
        display: none; /* Nasconde i pulsanti su mobile */
    }
    .order-type-dropdown {
        display: block; /* Mostra la select su mobile */
    }
}

/* Stile base del modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 40px auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    position: relative;
    box-sizing: border-box;
}

/* Layout a due colonne per desktop */
/* Form layout */
#appointmentForm {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.appointment-time {
    font-size: 1.1em;
    color: #003876;
    margin-bottom: 20px;
    text-align: center;
}

/* Campi form */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #003876;
    box-shadow: 0 0 5px rgba(0, 56, 118, 0.2);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #003876;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #002d5f;
}

/* Stili per i bottoni degli appuntamenti */
.appointment-button {
    transition: all 0.3s ease;
}

.appointment-button:hover {
    background-color: #002d5f !important;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 15px;
    }
    
    .form-group input {
        font-size: 14px;
    }
}

.btn-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #003876;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-action.recording {
    background-color: #dc3545;
    animation: pulse 1.5s infinite;
}

.btn-action svg {
    width: 20px;
    height: 20px;
}

.hidden {
    display: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #003876;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action.recording {
    background-color: #dc3545;
    animation: pulse 1.5s infinite;
}

.btn-action svg {
    width: 20px;
    height: 20px;
}

.hidden {
    display: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Contenitore principale delle spie */
.spie {
    padding: 20px;
}

/* Stili per i bottoni di filtro */
.spie-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
    padding: 10px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: #003876;
    color: white;
}

/* Grid delle spie */
.spie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* Card della spia */
.spia-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
}

.spia-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.spia-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 16px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 50%;
}

.spia-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    text-transform: capitalize;
}

.spia-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Colori specifici per tipo di spia */
.spia-card[data-colore="rosso"] .spia-image {
    background-color: #fff5f5;
}

.spia-card[data-colore="giallo"] .spia-image {
    background-color: #fffbeb;
}

.spia-card[data-colore="verde"] .spia-image {
    background-color: #f0fdf4;
}

/* Responsive */
@media (max-width: 768px) {
    .spie {
        padding: 15px;
    }

    .spie-filters {
        padding: 8px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .filter-btn {
        padding: 6px 16px;
        font-size: 0.9rem;
    }

    .spie-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .spia-card {
        padding: 20px;
    }

    .spia-image {
        width: 60px;
        height: 60px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Stili per i filtri */
.spie-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #003876;
    border-radius: 20px;
    background: white;
    color: #003876;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: #003876;
    color: white;
}

.filter-btn.active {
    background: #003876;
    color: white;
}

/* Aggiorna gli stili delle spie */
.spia-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
}

.spia-name {
    font-size: 1em;
    font-weight: 600;
    margin: 8px 0;
    color: #1f2937;
    text-transform: capitalize;
}

.spia-description {
    font-size: 0.875em;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

.spia-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .spie-filters {
        padding: 10px 5px;
        justify-content: center;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.9em;
    }

    .spie-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 5px;
    }

    .spia-card {
        padding: 12px;
    }

    .feature-box {
        display: none;
    }

    .feature-box.active {
        display: block;
    }

    .features-section.active .feature-box {
        margin: 0;
        border-radius: 0;
    }

    .features-section.active {
        padding: 0;
    }
}

/* Stile per il titolo della sezione */
.feature-box > h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #003876;
    margin: 0 0 24px 0;
    padding: 0 0 16px 0;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
    text-transform: capitalize;
}

/* Linea decorativa sotto il titolo */
.feature-box > h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: #003876;
}

/* Responsive per il titolo */
@media (max-width: 768px) {
    .feature-box > h2 {
        font-size: 1.5rem;
        padding: 0 0 12px 0;
        margin: 0 0 20px 0;
        text-align: center;
    }

    .feature-box > h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Stile per il form di ricerca stato lavori */
.stato-lavori-form {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-width: 500px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.phone-input-container {
    display: flex;
    gap: 10px;
}

.prefix-select {
    width: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    font-size: 0.9rem;
}

.phone-input, .targa-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.phone-input:focus, .targa-input:focus {
    outline: none;
    border-color: #003876;
    box-shadow: 0 0 0 2px rgba(0,56,118,0.1);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: #003876;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-btn:hover {
    background: #002d5f;
}

/* Stile per il risultato */
.stato-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    background: #f8f9fa;
    border-left: 4px solid #003876;
}

.stato-result h3 {
    margin: 0 0 10px 0;
    color: #003876;
}

.stato-result p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .stato-lavori-form {
        margin: 10px;
        padding: 20px;
    }
}

.modal-content {
    max-width: 500px;
    padding: 30px;
}

/* Sezioni del form */
.form-section {
    flex: 1;
    min-width: 300px;
}


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

.vehicle-selector {
    display: flex;
    gap: 10px;
}

.vehicle-selector select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.vin-group {
    position: relative;
}

.help-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #003876;
    color: white;
    cursor: pointer;
}

.help-text {
    display: none;
    position: absolute;
    right: -10px;
    top: calc(100% + 5px);
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 300px;
    z-index: 1000;
}

.help-text ul {
    padding-left: 20px;
    margin-top: 5px;
}

/* Gruppo chilometraggio */
.mileage-group {
    position: relative;
}

.range-indicator {
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 0.9em;
}

.range-indicator span {
    display: block;
    margin-bottom: 10px;
    color: #666;
}

.mileage-bar {
    height: 4px;
    background: #ddd;
    position: relative;
    border-radius: 2px;
    margin: 20px 0 10px;
}

.mileage-marker {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.8em;
    color: #666;
    top: -20px;
}

.mileage-marker.current {
    color: #003876;
    font-weight: bold;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input:focus, select:focus {
    outline: none;
    border-color: #003876;
}

/* Bottone submit */
.submit-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: #003876;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}


.submit-btn:hover {
    background: #002d5f;
}

/* Layout a due colonne per desktop */
#appointmentForm {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.form-section {
    flex: 1;
    min-width: 300px; /* Assicura una larghezza minima per le colonne */
}

/* Header del modal */
.modal h2 {
    color: #003876;
    margin-bottom: 20px;
}

#selectedDateTime {
    font-weight: bold;
    color: #a92e27;
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 5px;
}

/* Stile dei campi form */
.form-group {
    margin-bottom: 20px;
}

.form-section h3 {
    color: #003876;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* Vehicle selector */
.vehicle-selector {
    display: flex;
    gap: 10px;
}

.vehicle-selector select {
    flex: 1;
}

/* VIN help */
.vin-group {
    position: relative;
}

.help-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.help-text {
    position: absolute;
    right: -10px;
    top: calc(100% + 5px);
    z-index: 1001; /* Sopra il modal */
    width: 300px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Bottone submit */
.submit-btn {
    width: 100%;
    margin-top: 20px;
}

/* Close button */
.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* Mobile styles */
@media (max-width: 768px) {
    .modal {
        padding: 0;
    }
    
    .modal-content {
        margin: 0;
        padding: 20px;
        width: 100%;
        min-height: 100%;
        border-radius: 0;
        overflow-y: auto;
    }
    
    #appointmentForm {
        flex-direction: column;
        gap: 20px;
    }
    
    .form-section {
        width: 100%;
    }
    
    .vehicle-selector {
        flex-direction: column;
    }
    
    .range-indicator {
        padding: 8px;
        margin-top: 10px;
    }
    
    /* Fix per l'ultimo chilometraggio su mobile */
    .mileage-group {
        margin-bottom: 40px;
    }
    
    .range-indicator {
        font-size: 0.85em;
        line-height: 1.4;
    }
    
    .mileage-bar {
        margin: 25px 0 15px;
    }
    
    /* Assicura che ci sia spazio sufficiente in fondo */
    .submit-btn {
        margin-bottom: 20px;
    }
}


/* Contenitore del range input */
.mileage-input {
    position: relative;
    margin: 20px 0;
}

/* Stile base per l'input range */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
    padding: 0;
    margin: 0;
}

/* Thumb (il pallino che si muove) */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #003876;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #003876;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

/* Hover state del thumb */
input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 10px rgba(0,56,118,0.1);
}

input[type="range"]::-moz-range-thumb:hover {
    box-shadow: 0 0 0 10px rgba(0,56,118,0.1);
}

/* Display del valore */
.mileage-value {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -30px;
    background: #003876;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    white-space: nowrap;
}

.mileage-value::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #003876;
}

/* Indicatore del valore precedente */
.range-indicator {
    margin-top: 20px;
    color: #666;
    font-size: 0.9em;
}

.range-indicator strong {
    color: #003876;
}

@media (max-width: 768px) {
    .mileage-input {
        margin: 30px 0;
    }
    
    input[type="range"] {
        height: 6px;
    }
    
    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
}

.intervention-type {
    margin-bottom: 30px;
}

.type-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.type-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #003876;
    border-radius: 8px;
    background: white;
    color: #003876;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.type-btn svg {
    width: 24px;
    height: 24px;
}

.type-btn.selected {
    background: #003876;
    color: white;
}

.type-btn:hover {
    background: #003876;
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .type-buttons {
        flex-direction: column;
    }
    .type-btn {
        width: 100%;
    }
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    background-color: #f8f8f8;  /* Sfondo leggermente grigio per i campi readonly */
}

.form-group input[readonly],
.form-group textarea[readonly] {
    background-color: #f8f8f8;
    cursor: default;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #666;
}

.urgency-level {
    margin: 15px 0;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.urgency-low {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.urgency-medium {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffe0b2;
}

.urgency-high {
    background-color: #fdecea;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

/* Stile per l'icona */
.urgency-level svg {
    width: 20px;
    height: 20px;
}

/* Contenitore per centrare il tag */
.urgency-container {
    text-align: center;
    margin: 15px 0;
}



/*

@media only screen and (max-device-width: 375px) {
    #gl-chatbot-body-content {
        all: initial !important;
        display: block !important;
        padding: 10px !important;
        margin-bottom: 100px !important; 
        padding-bottom: 40px !important;
    }

    .container {
        all: initial !important;
        display: block !important;
        min-height: 100vh !important;
    }

    .main-content {
        all: initial !important;
        display: block !important;
        height: auto !important;
    }

    .chat-section {
        all: initial !important;
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .gl-message {
        display: block !important;
        margin: 10px 0 !important;
        padding: 10px !important;
        width: auto !important;
        clear: both !important;
    }

    .gl-bot {
        float: left !important;
        background: #f0f0f0 !important;
        margin-right: 20% !important;
    }

    .gl-client {
        float: right !important;
        background: #003876 !important;
        color: white !important;
        margin-left: 20% !important;
    }

    .chat-input-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: white !important;
        padding: 10px !important;
        border-top: 1px solid #ddd !important;
    }
}
*/
