@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: #ffffff;
    overflow-x: hidden;
    position: relative;
}

.neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: -1;
}

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 175, 156, 0.4);
    border-radius: 50%;
    animation: float 6s infinite linear;
}

.particle:nth-child(2n) {
    background: rgba(57, 136, 44, 0.3);
    animation-duration: 8s;
}

.particle:nth-child(3n) {
    background: rgba(98, 98, 101, 0.2);
    animation-duration: 10s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(-10px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10px) translateX(10px);
        opacity: 0;
    }
}

.glass-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 175, 156, 0.1);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 175, 156, 0.1);
}

.glass-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 175, 156, 0.05), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-glow {
    background: linear-gradient(135deg, rgba(0, 175, 156, 0.05), rgba(57, 136, 44, 0.05));
    border-bottom: 1px solid rgba(0, 175, 156, 0.1);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #00af9c;
    border-radius: 50%;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px #00af9c;
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 16px #00af9c;
    }
}

.chat-container {
    height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(0, 175, 156, 0.05);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(0, 175, 156, 0.3);
    border-radius: 3px;
}

.message {
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out;
}

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

.message.user {
    display: flex;
    justify-content: flex-end;
}

.message.ai {
    display: flex;
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
}

.message-bubble.user {
    background: linear-gradient(135deg, rgba(0, 175, 156, 0.1), rgba(57, 136, 44, 0.1));
    border: 1px solid rgba(0, 175, 156, 0.2);
    color: #1a202c;
    box-shadow: 0 8px 32px rgba(0, 175, 156, 0.1);
}

.message-bubble.ai {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    border: 1px solid rgba(0, 175, 156, 0.1);
    color: #1a202c;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.input-container {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 175, 156, 0.1);
    border-radius: 16px;
    padding: 4px;
    margin: 20px;
    box-shadow: 0 8px 32px rgba(0, 175, 156, 0.1);
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #1a202c;
    font-size: 16px;
    padding: 12px 0;
    font-family: inherit;
}

.chat-input::placeholder {
    color: rgba(26, 32, 44, 0.5);
}

.send-btn {
    background: linear-gradient(135deg, #00af9c, #39882c);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 175, 156, 0.4);
}

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

.send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.send-btn:hover::before {
    left: 100%;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    color: rgba(26, 32, 44, 0.7);
    font-size: 14px;
    margin-left: 20px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #00af9c;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: rgba(26, 32, 44, 0.8);
}

.ai-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00af9c, #39882c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
    animation: breathe 4s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ai-avatar::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #00af9c, #39882c, #626265);
    border-radius: 50%;
    z-index: -1;
    animation: rotate 8s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.holographic-text {
    background: linear-gradient(45deg, #00af9c, #39882c, #00af9c);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holographic 3s ease-in-out infinite;
}

@keyframes holographic {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.attach-btn {
    background: none;
    border: none;
    color: rgba(26, 32, 44, 0.5);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attach-btn:hover {
    background: rgba(0, 175, 156, 0.1);
    color: #00af9c;
}

.clear-btn {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ef4444;
}

.clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.05);
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.message-time {
    font-size: 0.75rem;
    color: rgba(26, 32, 44, 0.5);
    margin-top: 8px;
    text-align: right;
}

.message.user .message-time {
    text-align: left;
}

.message-image {
    max-width: 100%;
    border-radius: 12px;
    margin: 8px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #00af9c;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(0, 175, 156, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.file-link:hover {
    background: rgba(0, 175, 156, 0.2);
    transform: translateY(-2px);
}

/* Formato de texto en mensajes */
.message-bubble h1, .message-bubble h2, .message-bubble h3 {
    margin: 0.5rem 0;
    color: #00af9c;
    font-weight: 700;
}

.message-bubble h1 {
    font-size: 1.4rem;
    border-bottom: 2px solid #00af9c;
    padding-bottom: 0.5rem;
}

.message-bubble h2 {
    font-size: 1.2rem;
    color: #00af9c;
}

.message-bubble h3 {
    font-size: 1.1rem;
    color: #39882c;
}

.message-bubble ul, .message-bubble ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-bubble li {
    margin: 0.25rem 0;
    line-height: 1.4;
}

.message-bubble strong {
    font-weight: 600;
    color: #00af9c;
}

.message-bubble em {
    font-style: italic;
    color: #39882c;
}

.message-bubble code {
    background: rgba(0, 175, 156, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #00af9c;
}

.message-bubble pre {
    background: rgba(0, 175, 156, 0.05);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.5rem 0;
    border: 1px solid rgba(0, 175, 156, 0.1);
}

.message-bubble blockquote {
    border-left: 4px solid #00af9c;
    padding-left: 1rem;
    margin: 0.5rem 0;
    font-style: italic;
    color: #39882c;
    background: rgba(0, 175, 156, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 0 8px 8px 0;
}

@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
    }
    
    .chat-container {
        height: calc(100vh - 180px);
        padding: 16px;
    }
    
    .input-container {
        margin: 16px;
    }
}