:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Fondo Dinámico Moderno */
.background-mesh {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    animation: moveMesh 20s infinite alternate ease-in-out;
    z-index: -1;
}

@keyframes moveMesh {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(5deg) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Form inputs & Buttons */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

input[type="file"] {
    display: none;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.primary-btn {
    background: var(--primary-color);
    border: none;
    width: 100%;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

#fileName {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Chat Box */
.chat-card {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease-out;
}

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

.message.system {
    background: rgba(99, 102, 241, 0.2);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message.user {
    background: var(--primary-color);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
}

input[type="text"] {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]::placeholder {
    color: var(--text-secondary);
}

input[type="text"]:focus {
    border-color: var(--primary-color);
}
