/* Variables de Color Modernas para TSC */
:root {
    --primary-color: #0f172a; /* Slate 900 */
    --secondary-color: #3b82f6; /* Blue 500 */
    --accent-color: #2563eb; /* Blue 600 */
    --bg-color: #f8fafc; /* Slate 50 */
    --surface-color: #ffffff;
    --text-primary: #1e293b; /* Slate 800 */
    --text-secondary: #475569; /* Slate 600 */
    --bot-msg-bg: #f1f5f9; /* Slate 100 */
    --user-msg-bg: var(--secondary-color);
    --user-msg-text: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* --- Simulación de la Pagina Web --- */
.main-header {
    background-color: var(--surface-color);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.main-header nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-header nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
}

.main-header nav a:hover {
    color: var(--secondary-color);
}

.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e293b 100%);
    color: white;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: 1.25rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
}

/* --- UI DEL CHATBOT --- */

/* Botón flotante */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    z-index: 1000;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.05) translateY(-5px);
    background-color: var(--accent-color);
    box-shadow: var(--shadow-xl);
}

.chatbot-toggle-btn:active {
    transform: scale(0.95);
}

/* Ventana del Chatbot */
.chatbot-window {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 8rem);
    background-color: var(--surface-color);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transition: var(--transition-smooth);
    opacity: 1;
    transform: translateY(0);
}

.chatbot-window.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Header del Chatbot */
.chatbot-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    border-top-left-radius: var(--border-radius-xl);
    border-top-right-radius: var(--border-radius-xl);
    position: relative;
    overflow: hidden;
}

.chatbot-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    animation: pulseGlow 4s infinite alternate;
    pointer-events: none;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0,0); }
    100% { transform: scale(1.1) translate(2%, 2%); }
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.chatbot-avatar img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.chatbot-title {
    display: flex;
    flex-direction: column;
}

.chatbot-title h4 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-title h4::after {
    content: '✨';
    font-size: 0.9rem;
    animation: sparkle 2s infinite ease-in-out;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.chatbot-title span {
    font-size: 0.8rem;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}

.chatbot-title span::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 8px #4ade80;
}

.chatbot-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.chatbot-close-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: rotate(90deg);
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--surface-color);
}

/* Scrollbar personalizada */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.message {
    display: flex;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.bot-message .message-content {
    background-color: var(--bot-msg-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 0.2rem;
}

.user-message .message-content {
    background-color: var(--user-msg-bg);
    color: var(--user-msg-text);
    border-bottom-right-radius: 0.2rem;
}

.message-content strong {
    font-weight: 600;
}

.message-content a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
}

/* Menú interactivo */
.interactive-menu {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.4s ease-out;
}

.menu-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.menu-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.8rem 1.2rem;
    border-radius: 0.8rem;
    color: #1e40af;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-btn::after {
    content: '→';
    font-size: 1.1rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: linear-gradient(to right, #eff6ff, #ffffff);
    border-color: #93c5fd;
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.menu-btn:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.menu-btn:active {
    transform: translateY(0);
}

/* Animación de escribiendo */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 1.5rem;
    background-color: var(--surface-color);
}

.chatbot-typing.hidden {
    display: none;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input de mensaje */
.chatbot-input {
    display: flex;
    padding: 1rem;
    background-color: var(--surface-color);
    border-top: 1px solid #f1f5f9;
    align-items: center;
    gap: 0.8rem;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 0.8rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition-fast);
    outline: none;
}

.chatbot-input input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-send-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chat-send-btn:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* Responsividad para móviles */
@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chatbot-toggle-btn {
        bottom: 1rem;
        right: 1rem;
    }
}
