/* Estilos para el nuevo modal de solicitud de presupuesto en formato chat */
/* FyVBand - Implementación por Jules */

/* Overlay del modal */
.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* Se mostrará con JS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Contenedor principal del modal */
.chat-modal-container {
    background-color: #fff;
    color: #333; /* Set a default text color to prevent inheritance */
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Cabecera del chat */
.chat-header {
    background-color: #e45458;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

/* Cuerpo del chat (donde van los mensajes) */
.chat-body {
    flex-grow: 1;
    padding: 55px 20px 20px; /* Aumentado para evitar solapamiento con la cabecera */
    overflow-y: auto;
}

/* Pie del chat (donde el usuario introduce datos) */
.chat-footer {
    padding: 15px;
    border-top: 1px solid #eee;
}

/* Burbujas de mensajes */
.chat-bubble {
    padding: 10px 15px;
    border-radius: 20px;
    margin-bottom: 10px;
    max-width: 80%;
}

.planner-bubble {
    background-color: #f1f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.user-bubble {
    background-color: #e45458;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

/* Indicador de "escribiendo..." */
.typing-indicator {
    display: inline-block;
}
.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.3s infinite;
}
.typing-indicator span:nth-of-type(2) {
    animation-delay: 0.15s;
}
.typing-indicator span:nth-of-type(3) {
    animation-delay: 0.3s;
}

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

/* Estilos para los inputs del usuario en el footer */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.chip-option {
    background-color: #fdeeee;
    border: 1px solid #e45458;
    color: #e45458;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease-in-out;
}

.chip-option:hover {
    background-color: #e45458;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Align buttons */
    gap: 10px;
}

.chat-form {
    display: flex;
    flex-grow: 1;
    gap: 10px;
    align-items: center;
}

.chat-form input, .chat-form select {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 1em;
}

/* Style for modern text inputs */
.modern-input {
    font-size: 25px;
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #ddd;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
    box-sizing: border-box;
}

/* --- Media Queries para Móviles --- */
@media (max-width: 600px) {
    .step-screen {
        padding-top: 40px; /* Add space at the top for smaller screens */
    }
    .step-question {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
    .chat-modal-container {
        width: 100%; /* Ancho completo en móvil para el calendario */
        height: 90vh; /* Taller on mobile */
    }

    /* Ajustes para el calendario en móviles */
    .flatpickr-calendar {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    .dayContainer {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
    }

    span.flatpickr-weekday, .flatpickr-day {
        width: 14.2%;
        max-width: 14.2%;
        padding: 4px 0;
        margin: 0;
        font-size: 11px;
        line-height: 1.2;
        text-align: center;
        box-sizing: border-box;
    }
}

.modern-input:focus {
    border-color: #e45458;
    box-shadow: 0 0 10px rgba(228, 84, 88, 0.2);
    outline: none;
}

textarea.modern-input {
    font-size: 14px;
    text-align: left;
    resize: vertical;
}

.chat-nav-btn, .chat-submit-btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease-in-out;
}

/* Back button - neutral style */
.chat-nav-btn {
    background-color: #f0f0f0;
    color: #555;
    border-color: #ccc;
}
.chat-nav-btn:hover {
    background-color: #e0e0e0;
}

/* Next button - primary style */
.chat-submit-btn {
    background-color: #e45458;
    color: white;
}
.chat-submit-btn:hover {
    background-color: #c94a4e;
    transform: scale(1.05);
}

.chat-form.contact-form {
    flex-direction: column;
    gap: 15px;
}
.contact-form input {
    width: 100%;
    box-sizing: border-box;
}

.time-slots-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.time-slots-container .chip-option.active {
    background-color: #e45458;
    color: white;
}

/* Custom styles for Flatpickr to match the theme */
.flatpickr-calendar {
    width: auto !important; /* Let it size naturally */
    max-width: 350px; /* Prevent it from being too wide */
    margin: 0 auto; /* Center it */
    box-shadow: none !important;
    border: 1px solid #ddd;
}
.flatpickr-day.selected {
    background: #e45458;
    border-color: #e45458;
}
.flatpickr-day.today {
    border-color: #c94a4e;
}
.flatpickr-day.today:hover {
    background: #c94a4e;
    border-color: #c94a4e;
}
.final-submit {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
}

.planner-bubble.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* --- Estilos para la Pantalla de Bienvenida --- */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 20px;
}

.advisor-photo-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid #e45458;
}

.welcome-screen h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #333;
}

.welcome-screen p {
    font-size: 1.1em;
    color: #666;
    max-width: 450px;
}

.chat-submit-btn.large {
    padding: 15px 40px;
    font-size: 1.2em;
    width: auto;
    flex-grow: 0;
}

/* --- Estilos para el Layout de Pantallas --- */
.step-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.step-question {
    font-size: 1.6em;
    color: #333;
    margin-bottom: 30px;
}

.step-input-container {
    width: 100%;
    max-width: 500px;
}

/* --- Estilos para Inputs Específicos --- */
.chips-icons-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.chips-icons-container .chip-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100px;
    font-size: 1em;
    padding: 10px 5px;
}

.chips-icons-container .chip-option img {
    height: 40px;
    margin-bottom: 8px;
}

.chat-form textarea {
    resize: vertical;
    border-radius: 15px;
    padding: 10px;
    font-family: inherit;
    font-size: 1em;
    border: 1px solid #ccc;
    width: 100%;
    box-sizing: border-box;
}
