:root {
    --bg-body: #f8fafc;
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --success: #10b981;
}

body {
    background-color: var(--bg-body);
}

.tool-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
}

/* ZONA DE CARGA (Hero) */
.upload-hero {
    border: 2px dashed var(--border);
    border-radius: 20px;
    background: white;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-hero:hover {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.08);
}

.upload-hero.minimized {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    border-style: solid;
    margin-bottom: 20px;
}

/* LOADER (Efecto Escáner) */
.scan-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px 0;
}

.scan-bar {
    width: 200px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
}

.scan-progress {
    width: 0%;
    height: 100%;
    background: var(--primary);
    transition: width 1.5s ease-in-out;
}

/* ÁREA DE RESULTADOS (Editor) */
.result-viewer {
    display: none;
    /* Oculto inicial */
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Toolbar del Editor */
.editor-toolbar {
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.tool-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.tool-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tool-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tool-btn.primary:hover {
    background: var(--primary-hover);
}

/* Área de Texto */
.text-content {
    width: 100%;
    min-height: 400px;
    padding: 25px;
    font-family: 'Courier New', monospace;
    /* Look de documento raw */
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    border: none;
    resize: vertical;
    outline: none;
    background: white;
    display: block;
}

/* Barra de Estadísticas (Footer del editor) */
.editor-footer {
    padding: 10px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-item i {
    color: var(--primary);
}

/* Notificación Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

body.theme-dark {
    --bg-body: #020617;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
}

body.theme-dark .tool-header h1,
body.theme-dark .tool-header p {
    color: var(--text-main);
}

body.theme-dark .upload-hero,
body.theme-dark .result-viewer,
body.theme-dark .tool-btn,
body.theme-dark .text-content {
    background: #0f172a;
    color: var(--text-main);
    border-color: var(--border);
}

body.theme-dark .upload-hero:hover {
    background: rgba(14, 165, 233, 0.14);
}

body.theme-dark .editor-toolbar,
body.theme-dark .editor-footer {
    background: #0b1220;
    border-color: var(--border);
}

body.theme-dark .tool-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #111827;
}

body.theme-dark .tool-btn.primary {
    background: var(--primary);
    color: #fff;
}

body.theme-dark .text-content::placeholder {
    color: #64748b;
}
