/* VARIABLES Y RESET */
:root {
    --bg-main: #0d1117;
    --bg-side: #161b22;
    --accent: #38bdf8;
    --border: #30363d;
    --text-muted: #8b949e;
    --danger: #f85149;
    --success: #3fb950;
}

* { box-sizing: border-box; }

body, html {
    margin: 0;
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: #f0f6fc;
    overflow: hidden; /* Evita el scroll global */
}

.app-container {
    display: flex;
    height: 100vh;
}

/* --- SIDEBAR COMPACTA --- */
.sidebar {
    width: 280px;
    background-color: var(--bg-side);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
}

.sidebar-header h1 {
    font-size: 20px;
    margin: 0 0 20px 0;
    font-weight: 700;
}

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

.control-group {
    margin-bottom: 20px;
}

.group-title {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 600;
}

select, .btn-clear, .btn-secondary {
    width: 100%;
    background: var(--bg-main);
    color: white;
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 6px;
    outline: none;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

select:hover, .btn-clear:hover {
    border-color: var(--accent);
}

.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    cursor: pointer;
}

/* --- CARDS ESPECIALES EN SIDEBAR --- */
.stats-card {
    background: var(--bg-main);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-align: center;
    margin-bottom: 15px;
}

.score-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#score-circle {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}

#status-label {
    font-size: 11px;
    font-weight: 700;
}

#leak-count {
    font-size: 12px;
    margin: 5px 0 10px 0;
    color: var(--text-muted);
}

#copy-btn {
    width: 100%;
    background: var(--accent);
    color: #0d1117;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

/* AI DETECTOR BOX */
.ai-detector-box {
    background: rgba(56, 189, 248, 0.05);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.progress-bar-bg {
    background: #0d1117;
    height: 6px;
    border-radius: 3px;
    margin: 10px 0;
    overflow: hidden;
}

#ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #818cf8);
    transition: width 0.5s ease;
}

/* BUSINESS CARD */
.business-card {
    background: linear-gradient(145deg, #1f2937, #111827);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #3b82f644;
    margin-top: auto;
}

.business-card h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--accent);
}

.business-card p {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.business-card input {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: white;
    font-size: 12px;
}

.business-card button {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

/* --- WORKSPACE (DISEÑO HORIZONTAL) --- */
.workspace {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.editor-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-side);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

textarea, .output-area {
    flex: 1;
    width: 100%;
    padding: 20px;
    background: transparent;
    border: none;
    color: #e6edf3;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow-y: auto;
}

.horizontal-divider {
    height: 1px;
    background: var(--border);
}

.output-area:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

.hidden { display: none; }