* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: sans-serif;
}

html, body {
    height: 100%;
}

body {
    background-color: #000000;
    color: white;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* --- HEADER --- */
header {
    position: sticky;
    top: 0;
    z-index: 1000; 
    width: 100%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

nav ul li a:hover {
    color: #00f2ff;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
}

/* --- ÁREA DE CHAT --- */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    flex: 1; 
    position: relative;
}

.messages-area {
    flex: 1;
    padding: 20px 20px 180px 20px; 
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    scrollbar-width: none;
}

.messages-area::-webkit-scrollbar { display: none; }

/* BURBUJAS */
.message-bubble {
    padding: 18px 24px;
    border-radius: 22px;
    backdrop-filter: blur(20px);
    max-width: 85%;
    line-height: 1.6;
    animation: fadeInUp 0.4s ease;
}

.user-bubble {
    background: rgba(80, 60, 150, 0.25);
    align-self: flex-end;
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.ai-bubble {
    background: rgba(30, 40, 80, 0.35);
    align-self: flex-start;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.bubble-sender {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: block;
    color: #a8c0ff;
}

.bubble-text {
    font-size: 1.1rem;
}

/* MENSAJE DE BIENVENIDA GRADIENTE */
.welcome-message {
    margin-top: 60px;
    text-align: center;
    align-self: center;
}

.welcome-message .bubble-text {
    font-size: 2rem;
    font-weight: 300;
    background: linear-gradient(135deg, #ffffff 0%, #a8c0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.input-area-bottom {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 0 20px;
    z-index: 100;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(15px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 8px 8px 25px;
    display: flex;
    align-items: flex-end;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.message-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    padding: 15px 0;
    outline: none;
    resize: none;
    max-height: 150px;
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    transition: 0.3s;
    margin-left: 10px;
}

.send-btn:hover { transform: scale(1.1); }

/* --- FOOTER --- */
.footer-simple {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: rgba(0,0,0,0.9);
    padding: 15px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-text { font-size: 0.8rem; color: #666; }

/* --- NEBULOSA --- */
.nebulosa-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000;
    overflow: hidden;
}

.vapor {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    filter: blur(80px);
    animation: movimientoEpico 15s infinite alternate ease-in-out;
}

/* Definición de Colores y Posiciones */
.v-magenta {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(255, 0, 255, 0.4) 0%, transparent 70%);
    top: -10%; left: -10%;
}

.v-aqua {
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3) 0%, transparent 70%);
    bottom: -10%; right: -10%;
    animation-duration: 20s;
}

.v-azul-marino {
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(0, 20, 150, 0.4) 0%, transparent 70%);
    top: 20%; left: 30%;
    animation-duration: 25s;
    animation-delay: -5s;
}

.v-blanco {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    top: 40%; left: 50%;
    filter: blur(50px);
    animation-duration: 12s;
}

.v-rojo-claro {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255, 80, 80, 0.3) 0%, transparent 70%);
    bottom: 10%; left: 5%;
    animation-duration: 18s;
}

.v-aqua-deep {
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(0, 150, 255, 0.3) 0%, transparent 70%);
    top: 5%; right: 15%;
    animation-delay: -3s;
}

.v-magenta-dark {
    width: 550px; height: 550px;
    background: radial-gradient(circle, rgba(150, 0, 150, 0.3) 0%, transparent 70%);
    bottom: 20%; right: 30%;
    animation-duration: 22s;
}

.v-brillo {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 80%);
    top: 10%; left: 40%;
    filter: blur(40px);
    animation-duration: 10s;
}

@keyframes movimientoEpico {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(150px, 100px) scale(1.2) rotate(15deg);
    }
    100% {
        transform: translate(-100px, 200px) scale(0.9) rotate(-15deg);
    }
}

@media (max-width: 768px) {
    header { padding: 15px; }
    
    .welcome-message .bubble-text { font-size: 1.5rem; }
    
    .input-area-bottom { bottom: 70px; }

    nav ul li { margin-left: 15px; }
}

@media (max-width: 480px) {
    header { flex-direction: column; gap: 10px; }
    
    nav ul { gap: 10px; }
    nav ul li { margin-left: 10px; font-size: 0.85rem; }

    .messages-area { padding-bottom: 140px; }

    .message-bubble { max-width: 95%; padding: 15px 20px; }

    .input-area-bottom { bottom: 60px; padding: 0 10px; }
    
    .input-container { padding-left: 15px; }

    .welcome-message .bubble-text { font-size: 1.2rem; }
}
