/* Google Fonts Import Link */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Estilo para el título del formulario */
.form-title {
    text-align: left; /* Alinea el título a la izquierda */
    font-size: 20px; /* Ajusta el tamaño de la fuente del título */
    margin-bottom: 2px; /* Espacio debajo del título */
    color: #265da3; /* Color del texto del título */
    margin-left: 20px; /* Ajusta el espacio desde el borde izquierdo del contenedor */
    
}


body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0; /* Color de fondo opcional */
    overflow-y: scroll;
}



.sidebar.close ~  .form-container {

    width: calc(100% - 90px); /* Ajusta el ancho para el espacio restante */
}



.sidebar.close ~ .main-form  {
    left: 90px;
    width: calc(100% - 120px); /* Ajusta el ancho para el espacio restante */
}




/* Formulario grande que agrupa los formularios */
.main-form {
    position: relative;
    top: 2px; /* Esto sube el formulario */
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin: 0 auto; /* Elimina el espacio superior original */
    width: calc(100% - 290px); /* Ajusta el ancho del formulario */
    transition: all 0.5s ease;
    left: 260px;
    margin-left: 10px;
    

}





/* Contenedor para los formularios superiores */
.form-container-top {
    display: flex;
    flex-direction: row;
    gap: 10px;
    max-width: 100%;
    margin: 20px auto;
    justify-content: center;
    flex-wrap: wrap;
    
}





/* Estilo general para los formularios */
.form-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    max-width: 50%;
    margin: 120px auto; /* Aumenta el margen superior para bajar los formularios */
    flex-wrap: wrap;
    margin-left: 300x; /* Mueve los formularios a la derecha */
}

.form {
    background-color: #ffffff;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: calc(25% - 10px);
    min-width: 100px;
    cursor: pointer;
    transition: box-shadow 0.3s;
}

.form-container .form:hover {
    box-shadow: 0 8px 24px rgba(38,93,163,0.15);
}

.form .icon {
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.form-container .form:hover .icon {
    transform: translateY(-8px) scale(1.05);
}


.form .icon {
    font-size: 30px;
    color: #004ea1;
}

.form .text {
    font-size: 14px;
    color: #265da3;
    text-align: center;
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Version Badge */
.version-badge {
    position: absolute;
    bottom: 75px;
    right: 5px;
    background: linear-gradient(135deg, #265da3 0%, #1a4278 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(38, 93, 163, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    letter-spacing: 0.5px;
    animation: fadeInOut 10s ease-in-out forwards;
}

.version-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(38, 93, 163, 0.4);
    background: linear-gradient(135deg, #1a4278 0%, #265da3 100%);
}

.version-badge i {
    font-size: 14px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    5% {
        opacity: 1;
        transform: translateY(0);
    }
    85% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
        visibility: hidden;
    }
}

/* Chatbot Icon */
.chatbot-icon {
    background: linear-gradient(135deg, #096dc5 0%, #1b66c9 100%);
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(9, 109, 197, 0.4);
    transition: all 0.3s ease;
}

.chatbot-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 28px rgba(9, 109, 197, 0.5);
}

.chatbot-icon i {
    font-size: 26px;
}

/* Chatbot Popup */
.chatbot-popup {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbox: aseguramos que sea flex vertical y ocupe todo el popup */
#chatbox {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Chat Header */
#chatbox-header {
    background: linear-gradient(135deg, #096dc5 0%, #1b66c9 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#chatbox-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

#chatbox-header .close-chat {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

#chatbox-header .close-chat:hover {
    background: rgba(255,255,255,0.35);
    transform: rotate(90deg);
}

/* Contenedor de mensajes */
#chatbox-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

/* Mensajes */
.user-message, .bot-message {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: messageSlide 0.3s ease-out;
    position: relative;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #096dc5 0%, #1b66c9 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.user-message::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid #1b66c9;
    border-bottom: 8px solid transparent;
}

.bot-message {
    align-self: flex-start;
    background-color: #f1f3f5;
    color: #2d3748;
    border-bottom-left-radius: 4px;
}

.bot-message::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid #f1f3f5;
    border-bottom: 8px solid transparent;
}

.bot-message strong {
    color: #1574c7;
    font-weight: 600;
}

.bot-message code {
    background: #e8eaed;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.sofia-message {
    background-color: #fff3cd;
    color: #856404;
    font-weight: 600;
}

/* Input area */
#chatbox-input-area {
    display: flex;
    flex-shrink: 0;
    padding: 10px;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    gap: 8px;
    align-items: center;
}

/* Botón de micrófono */
.mic-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
}

.mic-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.mic-btn.listening {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(245, 87, 108, 0);
    }
}

/* Input de texto */
#chatbox-input {
    flex: 1;
    padding: 12px 15px;
    border-radius: 20px;
    border: 1px solid #ccc;
    outline: none;
    font-size: 14px;
    height: 40px;
    transition: border-color 0.3s;
}

#chatbox-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Botón de enviar */
#send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 16px;
}

#send-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#send-button:active {
    transform: scale(0.95);
}

/* Sugerencias rápidas */
#quick-suggestions {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

#quick-suggestions button {
    background: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

#quick-suggestions button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* Scrollbar */
#chatbox-content::-webkit-scrollbar {
    width: 6px;
}
#chatbox-content::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

