/* css/style.css - VERSIÓN FINAL CON PDF A COLOR */

:root {
    /* --- MODO PANTALLA (Dark Theme) --- */
    --bg-body: #0f172a;      /* Fondo muy oscuro */
    --bg-paper: #1e293b;     /* Tarjeta principal */
    --sidebar-bg: #1e293b;   /* Sidebar (igual en pantalla) */
    --text-main: #f8fafc;    /* Texto principal claro */
    --text-muted: #94a3b8;   /* Texto secundario gris */
    /* EL COLOR DE ACENTO (Azul vibrante) */
    --accent: #38bdf8;

    /* NUEVO: Azul "Cornflower" (Para Skills - Un pelín más suave/violeta) */
    --accent-skills: #818cf8;

    --border: #334155;       /* Bordes sutiles oscuros */
}

/* Estilos Base (Pantalla) */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif; /* Asegúrate de que la fuente carga en el HTML */
    margin: 0; padding: 20px; line-height: 1.5;
}

.cv-paper {
    max-width: 900px; margin: 0 auto;
    background-color: var(--bg-paper); padding: 40px;
    border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border: 1px solid var(--border);
}

/* Botones flotantes */
.controls {
    position: fixed; top: 20px; right: 20px;
    display: flex; gap: 10px; z-index: 999;
    background: var(--bg-paper); padding: 5px; border-radius: 8px; border: 1px solid var(--border);
}
select, button {
    background: var(--bg-body); color: var(--text-main);
    border: 1px solid var(--border); padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: 600;
}
button { color: var(--accent); }

/* Header en pantalla */
.cv-header h1 { margin: 0; font-size: 2.8rem; letter-spacing: -1.5px; line-height: 1; color: var(--text-main); }
.cv-header .role { color: var(--accent); font-size: 1.3rem; margin-top: 10px; font-weight: 600; }
.cv-header .summary { margin-top: 20px; color: var(--text-muted); font-size: 1rem; max-width: 100%; }

/* Layout Grid (Pantalla > 768px) */
@media (min-width: 768px) {
    .cv-grid { display: grid; grid-template-columns: 280px 1fr; gap: 50px; margin-top: 50px; }
}

/* Sidebar en pantalla */
.sidebar-section { margin-bottom: 35px; }
.sidebar-title {
    text-transform: uppercase; letter-spacing: 1.5px; font-size: 0.85rem; font-weight: 700;
    color: var(--accent); /* Títulos laterales en azul */
    margin-bottom: 15px;
}
.contact-item { display: flex; align-items: center; margin-bottom: 12px; font-size: 0.95rem; color: var(--text-muted); }
.skill-tag {
    display: inline-block;
    background: rgba(56, 189, 248, 0.1); /* Azul muy transparente */
    color: var(--accent-skills);
    padding: 6px 10px; border-radius: 6px; font-size: 0.85rem; font-weight: 600;
    margin: 0 5px 5px 0; border: 1px solid rgba(56, 189, 248, 0.2);
}

/* Main Content en pantalla */
.main-title {
    font-size: 1.2rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700;
    color: var(--accent); /* Títulos principales en azul */
    border-bottom: 2px solid var(--border); padding-bottom: 10px; margin-bottom: 30px;
}
.job-item { margin-bottom: 35px; }
.job-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.job-role { font-weight: 700; font-size: 1.15rem; color: var(--text-main); }
.job-company { color: var(--accent-skills); font-weight: 600; } /* Empresa en azul */
.job-date { font-family: 'Inter', sans-serif; font-size: 0.9rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 4px 8px; border-radius: 4px;}
.job-desc { font-size: 1rem; color: var(--text-muted); line-height: 1.7; }
/* Negritas dentro de la descripción */
.job-desc strong { color: var(--text-main); font-weight: 600; }

#inject-footer { margin-top: 50px; border-top: 1px solid var(--border); padding-top: 20px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }

/* =========================================
   DISEÑO PARA PDF / IMPRESIÓN (SOLUCIÓN TABLE-LAYOUT)
   ========================================= */
@media print {
    @page { margin: 0; size: A4; }

    :root {
        --bg-body: #ffffff;
        --sidebar-bg: #f1f5f9; /* Gris muy suave */
        --text-main: #1e293b;
        --text-muted: #475569;
        --accent: #2563eb;
        --border: #e2e8f0;
    }

    body { margin: 0; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Ocultar interfaz */
    .controls, #inject-footer { display: none !important; }

    /* Contenedor principal */
    .cv-paper {
        width: 100%; max-width: 100%; margin: 0; padding: 0; border: none; box-shadow: none;
    }

    /* Header: Ancho completo arriba */
    .cv-header {
        padding: 30px 40px 20px 40px;
        border-bottom: 2px solid var(--border);
        width: 100%; box-sizing: border-box;
    }
    .cv-header h1 { color: var(--accent); margin: 0; font-size: 2.2rem; }
    .cv-header .role { color: var(--text-main); font-size: 1.2rem; }
    .cv-header .summary {
        color: #F8FAFC !important;
        font-weight: 500;          /* Un poco más gordita la letra */
        opacity: 1;
    }

    /* --- EL TRUCO DE LA TABLA CSS --- */
    /* Usamos display: table para que las columnas respeten el salto de página */
    .cv-grid {
        display: table;
        width: 100%;
        table-layout: fixed; /* Mantiene anchos estables */
        border-collapse: collapse;
    }

    /* Columna Izquierda (Sidebar) */
    .cv-sidebar {
        display: table-cell;
        width: 28%; /* Ancho fijo */
        vertical-align: top;
        background-color: var(--sidebar-bg) !important; /* El color se pintará hasta abajo */
        padding: 20px;
        border-right: 1px solid var(--border);
    }

    /* Columna Derecha (Main) */
    .cv-main {
        display: table-cell;
        width: 72%;
        vertical-align: top;
        padding: 25px 35px;
        background-color: #ffffff;
    }

    /* Estilos de Texto para Impresión */
    .sidebar-title, .main-title {
        color: var(--text-main);
        border-bottom: 2px solid var(--accent);
        margin-top: 0; padding-bottom: 5px;
        page-break-after: avoid;
    }

    .job-company { color: var(--accent); font-weight: bold; }
    .job-desc strong { color: var(--accent); }
    .skill-tag { background: #fff; border: 1px solid #ccc; color: #333; }

    /* Evitar cortes feos dentro de un mismo trabajo */
    .job-item {
        break-inside: avoid; /* Intenta no cortar un trabajo a la mitad */
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    a { text-decoration: none; color: inherit; }
}