:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --terminal-bg: #020617;
}

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

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

/* Fondo Dinámico */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #4338ca;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: #0f766e;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

header h1 span {
    color: var(--accent);
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease;
    display: none;
}

.glass-card.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Upload Section */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.drop-zone .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.drop-zone h3 {
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.file-info {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

.file-info span {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.hidden {
    display: none !important;
}

/* Buttons */
button, .btn-secondary {
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--glass-border);
    display: inline-block;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.btn-text:hover {
    color: white;
    text-decoration: underline;
}

/* Terminal Section */
.terminal-header {
    background: #1e293b;
    padding: 0.75rem 1rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.terminal-header .dots {
    display: flex;
    gap: 6px;
}

.terminal-header .dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
}
.terminal-header .dots span:nth-child(2) { background: #eab308; }
.terminal-header .dots span:nth-child(3) { background: #22c55e; }

.terminal-header .title {
    margin-left: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

.terminal-body {
    background: var(--terminal-bg);
    padding: 1.5rem;
    border-radius: 0 0 12px 12px;
    height: 400px;
    overflow-y: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #a3e635; /* Color verde hacker suave */
}

.terminal-body p {
    margin-bottom: 4px;
    word-break: break-all;
}
.terminal-body p.error { color: #f87171; }
.terminal-body p.info { color: #60a5fa; }
.terminal-body p.portainer { color: #c084fc; }

/* Scrollbar for terminal */
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-track { background: var(--terminal-bg); }
.terminal-body::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* Results Section */
#results-section {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

#results-section h2 { margin-bottom: 0.5rem; }
#results-section p { color: var(--text-muted); margin-bottom: 2rem; }

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Nuevos Estilos para el Director Interactivo (Fase 2) */

.config-grid {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.input-group select {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 8px;
    border-radius: 6px;
    font-family: inherit;
    outline: none;
}

.director-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 600px;
}

.chat-panel, .storyboard-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
}

.chat-header, .storyboard-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 10px;
}

.chat-messages::-webkit-scrollbar, .scenes-list::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb, .scenes-list::-webkit-scrollbar-thumb {
    background: #334155; 
    border-radius: 4px;
}

.message {
    padding: 10px 15px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.system {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    align-self: center;
    font-size: 0.8rem;
}

.message.ai {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    align-self: flex-start;
}

.message.user {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    align-self: flex-end;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-family: inherit;
    outline: none;
}

.scenes-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 10px;
}

.scene-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 15px;
}

.scene-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.scene-number {
    font-weight: 600;
    color: var(--accent);
}

.scene-prompt {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #e2e8f0;
}

.placeholder-text {
    text-align: center;
    color: var(--text-muted);
    margin-top: 50%;
    transform: translateY(-50%);
}
.image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; } .image-grid img { width: 100%; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); } .director-controls { margin-top: 15px; text-align: right; }
