/* ================= VARIABLES & MARCA ================= */
:root {
    /* --- THEME: DARK (Premium/Quiet Luxury) --- */
    --bg-dark: #0f0f0f;         /* Fondo General Profundo */
    --panel-dark: #1a1a1a;      /* Sidebar y Modales */
    --border-dark: #333333;     /* Bordes sutiles */
    --text-main: #ffffff;       /* Texto Principal */
    --text-muted: #888888;      /* Texto Secundario */
    --accent: #61a5fa;          /* Azul Marca CCFL */
    --accent-glow: #a855f7;      /* Violeta para acentos de IA */
    --canvas-bg: #111111;       /* Fondo detrás del mockup */
    --danger: #ff4d4d;          
    
    /* Gradiente Identitario */
    --brand-gradient: linear-gradient(45deg, #61a5fa, #a855f7);
    
    /* Patrón de Ajedrez (Canvas) */
    --grid-color-1: #1a1a1a;    
    --grid-color-2: transparent;
}

body.light-theme {
    /* --- THEME: LIGHT (Opcional) --- */
    --bg-dark: #f5f5f7;
    --panel-dark: #ffffff;
    --border-dark: #e0e0e0;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --accent: #0071e3;
    --canvas-bg: #e5e5e5;
    --grid-color-1: #d2d2d7;
}

/* ================= RESET & GENERAL ================= */
* { box-sizing: border-box; }

body { 
    margin: 0; 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    background: var(--bg-dark); 
    color: var(--text-main); 
    height: 100vh; 
    width: 100vw;
    overflow: hidden; 
}

/* ================= ESTRUCTURA PRINCIPAL ================= */
.app-wrapper {
    display: flex;
    height: 100%;
    width: 100%;
}

/* SIDEBAR */
.sidebar {
    width: 320px;
    background: var(--panel-dark);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-scroll-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-dark);
}

.sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin: 0 0 15px 0;
}

/* MAIN AREA */
.main-content-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--canvas-bg);
    overflow-y: auto;
}

/* ================= HERRAMIENTAS SUPERIORES ================= */
.top-right-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    padding: 12px 25px;
    background: var(--panel-dark);
    border-bottom: 1px solid var(--border-dark);
}

/* ZOOM CONTROLS (Corregidos) */
.zoom-controls {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 2px 10px;
}

.zoom-controls button {
    background: none;
    border: none;
    color: var(--text-main);
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    width: auto !important;
    margin: 0 !important;
}

.zoom-controls button:hover { color: var(--accent); }

#zoom-level-display {
    min-width: 50px;
    text-align: center;
    font-size: 0.85rem;
    font-family: monospace;
    color: var(--accent);
}

/* ================= MESA DE TRABAJO (CANVAS) ================= */
.canvas-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px; /* Reducido para permitir un board más grande */
    position: relative;
    background-image: 
        linear-gradient(45deg, var(--grid-color-1) 25%, var(--grid-color-2) 25%), 
        linear-gradient(-45deg, var(--grid-color-1) 25%, var(--grid-color-2) 25%), 
        linear-gradient(45deg, var(--grid-color-2) 75%, var(--grid-color-1) 75%), 
        linear-gradient(-45deg, var(--grid-color-2) 75%, var(--grid-color-1) 75%);
    background-size: 20px 20px;
}

.canvas-wrapper {
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    background: white;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

/* ================= COMPONENTES UI MEJORADOS ================= */

/* Botón Mágico (AI) */
.btn-magic {
    background: var(--brand-gradient) !important;
    color: white !important;
    border: none !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-magic:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Inputs y Selectores */
select, input[type="text"], textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    color: var(--text-main);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* Dashboard de Estado (Admin) */
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: monospace;
    background: rgba(0,0,0,0.3);
}

/* ================= CONTENIDO SEO ================= */
.scrollable-content {
    background: var(--panel-dark);
    border-top: 1px solid var(--border-dark);
}

.seo-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px;
}

.seo-content-wrapper h2 {
    color: var(--accent);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

/* Pantalla de Carga */
#loading-overlay {
    backdrop-filter: blur(10px);
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }