/* Estilos base y animaciones */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes typing-dot {
    0% { transform: translateY(0px); }
    25% { transform: translateY(-5px); }
    50% { transform: translateY(0px); }
    75% { transform: translateY(5px); }
    100% { transform: translateY(0px); }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(-45deg, #268382, #1a6ea8, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Header fijo con diseño moderno */
.fixed-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, rgba(179, 223, 248, 0.95), rgba(179, 223, 248, 0.8));
    padding: 15px 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    text-align: center;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.fixed-header h1 {
    color: #545335;
    margin: 0;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    
}

.fixed-header p {
    color: #444;
    margin: 5px 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.chat-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px;
    text-align: center;
    border-radius: 15px 15px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

/* Área de mensajes con efecto glassmorphism */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.message {
    padding: 12px 16px;
    border-radius: 20px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.3;
    white-space: pre-line;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

.message p {
    margin: 4px 0;
}

.message ul {
    margin: 4px 0;
    padding-left: 20px;
}

.message li {
    margin: 2px 0;
}

.message:hover {
    transform: translateY(-2px);
}

.message strong {
    font-weight: 600;
    color: #268382;
}

/* Estilos para tablas */
.message table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95em;
}

.message th, .message td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(38, 131, 130, 0.2);
}

.message th {
    background: rgba(38, 131, 130, 0.9);
    color: white;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.message td:first-child {
    font-weight: 600;
    color: #268382;
    width: 40%;
}

.message td:last-child {
    color: #333;
}

.message tr:last-child td {
    border-bottom: none;
}

.message tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.5);
}

.user-message {
    background: rgba(255, 255, 255, 0.95);
    margin-left: auto;
    border-radius: 20px 20px 0 20px;
}

.bot-message {
    background: rgba(179, 223, 248, 0.95);
    margin-right: auto;
    border-radius: 20px 20px 20px 0;
}

/* Footer fijo con efecto glassmorphism */
.fixed-footer {
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    padding: 15px 20px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-input {
    display: flex;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

input[type="text"] {
    flex-grow: 1;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

input[type="text"]:focus {
    border-color: #268382;
    box-shadow: 0 0 20px rgba(38, 131, 130, 0.2);
    transform: translateY(-1px);
}

button {
    background: linear-gradient(135deg, #268382, #1f6e6d);
    color: white;
    border: none;
    padding: 12px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(38, 131, 130, 0.3);
}

button i {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

button:hover {
    background: linear-gradient(135deg, #1f6e6d, #268382);
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 6px 20px rgba(38, 131, 130, 0.4);
}

button:hover i {
    transform: translate(2px, -2px);
}

button:active {
    transform: translateY(1px);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(179, 223, 248, 0.95);
    border-radius: 20px 20px 20px 0;
    width: fit-content;
    margin: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #268382;
    border-radius: 50%;
    display: inline-block;
    animation: typing-dot 1.4s infinite;
}

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

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

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(38, 131, 130, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(38, 131, 130, 0.7);
}

/* Media Queries */
@media (max-width: 768px) {
    .fixed-header {
        padding: 10px;
    }

    .fixed-header h1 {
        font-size: 1.8em;
    }

    .fixed-header p {
        font-size: 1em;
    }

    .message {
        max-width: 85%;
        font-size: 0.95em;
        padding: 12px 16px;
    }

    .fixed-footer {
        padding: 10px;
    }

    input[type="text"] {
        padding: 10px 16px;
        font-size: 15px;
    }

    button {
        padding: 10px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .fixed-header {
        padding: 8px;
    }

    .fixed-header h1 {
        font-size: 1.6em;
    }

    .message {
        max-width: 90%;
        font-size: 0.9em;
    }

    .fixed-footer {
        padding: 8px;
    }
}
