/* styles.css - PEGA ESTO COMPLETO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

#connection-status {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 12px;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 500;
}

#chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    padding: 15px;
    border-radius: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    background: #667eea;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
}

.ai-message {
    background: #f1f5f9;
    color: #334155;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}

.input-area {
    display: flex;
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 10px;
}

#user-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #cbd5e1;
    border-radius: 15px;
    font-size: 16px;
    outline: none;
    transition: border 0.3s;
    background: white;
}

#user-input:focus {
    border-color: #667eea;
}

#send-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 15px;
    width: 50px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn:hover {
    background: #764ba2;
}

.add-knowledge-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 100;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    #app {
        height: 95vh;
    }
    
    .message {
        max-width: 85%;
    }
    
    header h1 {
        font-size: 20px;
    }
}

/* Scrollbar personalizada */
#chat-container::-webkit-scrollbar {
    width: 6px;
}

#chat-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#chat-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Indicador de escritura */
.thinking {
    background: #f1f5f9 !important;
    padding: 10px 15px !important;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Botón deshabilitado temporalmente */
#user-input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

/* Notificaciones para online-offline.js */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Status de carga */
.loading-status {
    font-size: 12px;
    color: #64748b;
    text-align: center;
    padding: 5px;
    font-style: italic;
}