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

:root {
    --bg-main: #0c0f16;
    --bg-panel: rgba(18, 22, 31, 0.85);
    
    --glow-purple: rgba(139, 92, 246, 0.6);
    --glow-cyan: rgba(6, 182, 212, 0.6);
    --glow-green: rgba(16, 185, 129, 0.6);
    --glow-blue: rgba(59, 130, 246, 0.8);
    --glow-red: rgba(239, 68, 68, 0.8);
    
    --border-purple: #8b5cf6;
    --border-green: #10b981;
    --border-blue: #3b82f6;
    --border-red: #ef4444;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    margin: 0;
    overflow: hidden; /* Ajuste limpio sin scroll global en pantalla */
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }

.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 1.5rem;
    gap: 1.5rem;
    max-width: 1800px;
    margin: 0 auto;
    overflow: hidden;
}

/* Header */
.app-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    color: var(--border-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px var(--glow-blue));
}

.brand-icon svg { width: 32px; height: 32px; fill: currentColor; }
.brand-text { display: flex; flex-direction: column; }

.brand-title {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: clamp(0.6rem, 2vw, 0.8rem);
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.tech-deco { 
    display: flex; 
    align-items: center; 
}

@media (max-width: 600px) {
    .tech-deco { display: none; }
}

.api-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--border-green);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--border-green);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--border-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--border-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 1; }
    70% { transform: scale(1.1); opacity: 0.5; }
    100% { transform: scale(0.95); opacity: 1; }
}

/* Main Layout - CSS GRID Responsive */
.main-layout {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.2fr);
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 1000px) {
    body {
        height: auto;
        overflow: auto;
    }
    .app-wrapper {
        height: auto;
        max-height: none;
        overflow: visible;
        padding: 1rem;
    }
    .main-layout {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    .panel {
        overflow: visible;
        min-height: auto;
    }
    .panel-content {
        overflow: visible;
    }
}

.panel {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    min-height: 0;
}

.panel-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.panel-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Specific Panels styling */
.panel-left {
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.1), 0 0 15px rgba(139, 92, 246, 0.15);
}
.panel-left .panel-header { color: #d8b4fe; }

.right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 0;
    overflow: hidden;
}

.panel-top-right {
    flex: 1;
    border: 1px solid rgba(16, 185, 129, 0.5);
    box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.1), 0 0 15px rgba(16, 185, 129, 0.15);
    min-height: 220px;
}
.panel-top-right .panel-header { color: #6ee7b7; }

.panel-bottom-right {
    flex: 1;
    border: 1px solid rgba(167, 139, 250, 0.5);
    box-shadow: inset 0 0 20px rgba(167, 139, 250, 0.1), 0 0 15px rgba(167, 139, 250, 0.15);
    min-height: 220px;
}
.panel-bottom-right .panel-header { color: #c4b5fd; }

/* Components */
.dropzone {
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: rgba(0,0,0,0.3);
    transition: var(--transition);
}
.dropzone:hover { border-color: #a78bfa; background: rgba(139, 92, 246, 0.05); }
.dropzone-icon { color: #a78bfa; margin-bottom: 0.5rem; display: flex; justify-content: center; }
.dropzone-text { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.3rem; }
.dropzone-hint { font-size: 0.75rem; color: var(--text-dim); }
.file-input { display: none; }

.selected-file-info {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.chip-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.mt-lg { margin-top: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.text-input, .select-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.text-input:focus, .select-input:focus { border-color: var(--border-blue); }

.select-wrapper { position: relative; }
.select-wrapper select { appearance: none; padding-right: 2.5rem; }
.select-arrow {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--text-muted);
}

.lang-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 1rem; 
}

.multi-lang-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-chip {
    padding: 0.6rem 0.8rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}
.checkbox-chip:hover { background: rgba(255,255,255,0.05); }
.checkbox-chip.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--border-blue);
    color: #fff;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-blue);
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, rgba(37,99,235,0.8), rgba(59,130,246,0.6));
    color: white;
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1rem);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), inset 0 0 10px rgba(255,255,255,0.2);
    transition: var(--transition);
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-submit:hover:not(:disabled) { box-shadow: 0 0 25px rgba(59, 130, 246, 0.5), inset 0 0 10px rgba(255,255,255,0.4); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Right Panel: Terminal Log */
.log-console {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: #a7f3d0;
    flex: 1;
    overflow-y: auto;
}
.log-line { margin-bottom: 0.4rem; }
.log-time { color: rgba(255,255,255,0.3); margin-right: 0.5rem; }
.log-info { color: #cbd5e1; }
.log-success { color: #34d399; }
.log-error { color: #f87171; }

.progress-container { margin-bottom: 1rem; display: none; }
.progress-container.active { display: block; }
.progress-bar-bg {
    width: 100%; height: 6px; background: rgba(255,255,255,0.1);
    border-radius: 999px; overflow: hidden; margin-bottom: 0.5rem;
}
.progress-bar-fill {
    height: 100%; width: 0%;
    background: var(--border-green);
    box-shadow: 0 0 10px var(--border-green);
    transition: width 0.3s;
}
.progress-status-text { font-size: 0.85rem; color: #6ee7b7; }

.results-grid { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.result-card {
    background: rgba(0,0,0,0.4); border: 1px solid rgba(16,185,129,0.3);
    border-radius: var(--radius-sm); padding: 1rem;
}
.result-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; color: #6ee7b7; font-weight: 600;}
.btn-download {
    display: block; text-align: center; background: rgba(16,185,129,0.1);
    border: 1px solid var(--border-green); color: #fff; text-decoration: none;
    padding: 0.5rem; border-radius: var(--radius-sm); font-size: 0.85rem; transition: var(--transition);
}
.btn-download:hover { background: rgba(16,185,129,0.3); }

/* History Grid - Matching the visual card design */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.history-card {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}
.history-card:hover { background: rgba(255,255,255,0.05); border-color: rgba(167,139,250,0.5); }

.history-thumb {
    width: 60px; height: 45px;
    background: linear-gradient(135deg, #4c1d95, #0f766e);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.play-icon {
    width: 24px; height: 24px; background: rgba(0,0,0,0.5);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.play-icon svg { width: 12px; height: 12px; fill: #fff; margin-left: 2px; }

.history-info { flex: 1; min-width: 0; }
.history-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.2rem; }
.history-meta { font-size: 0.75rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.history-flags { display: flex; gap: 0.25rem; font-size: 0.7rem; }
.flag-tag { background: rgba(255,255,255,0.1); padding: 0.1rem 0.3rem; border-radius: 3px; color: #cbd5e1; }
.history-date { font-size: 0.7rem; color: rgba(255,255,255,0.3); margin-top: 0.25rem; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
