/* CSS Variables for Premium Dark Theme */
:root {
    --bg-app: #080c14;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-input: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #080c14;
    
    --color-primary: #3b82f6; /* Modern Blue */
    --color-accent: #0dffd2;  /* Glowing Cyan */
    --color-accent-hover: #0adbb4;
    --color-error: #ef4444;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    
    --font-ui: 'Outfit', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    --shadow-glow: 0 0 15px rgba(13, 255, 210, 0.2);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 600px;
}

/* App Header styling */
.app-header {
    background-color: rgba(8, 12, 20, 0.85);
    border-bottom: 1px solid var(--bg-card-border);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 100;
}

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

.logo-icon {
    font-size: 2.25rem;
}

.logo-text h1 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-text h1 .highlight {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Main Application Area (Split Screen) */
.app-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    overflow: hidden;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
}

/* Panel Common Styles */
.panel-left, .panel-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.panel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Tabs System */
.tab-headers {
    display: flex;
    background-color: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--bg-card-border);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    outline: none;
}

.tab-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--color-accent);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.tab-contents {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Button Custom Styles */
.btn {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    outline: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bg-card-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.btn-accent {
    background-color: var(--color-accent);
    color: var(--text-inverse);
}

.btn-accent:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--bg-card-border);
    color: var(--text-muted);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-danger {
    background-color: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-full {
    width: 100%;
}

/* Importer Tab Styles */
.importer-instructions {
    margin-bottom: 1rem;
}

.importer-instructions h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--color-accent);
}

.importer-instructions p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#import-raw-text, #job-description-text {
    background-color: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    resize: none;
    outline: none;
    transition: var(--transition-fast);
}

#job-description-text {
    height: 180px;
    font-size: 0.85rem;
}

#import-raw-text {
    flex: 1;
    font-family: var(--font-code);
    font-size: 0.8rem;
}

#import-raw-text:focus, #job-description-text:focus {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

/* Form Styles */
.form-navigation {
    display: flex;
    overflow-x: auto;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 0.4rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    gap: 0.25rem;
}

.form-nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.form-nav-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.form-nav-btn.active {
    background-color: var(--color-primary);
    color: white;
}

.form-section {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.2s ease-in-out;
}

.form-section.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .col {
    flex: 1;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
textarea {
    background-color: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    padding: 0.65rem 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.file-input {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    color: var(--text-muted);
    background: var(--bg-input);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-card-border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.section-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -0.75rem;
}

/* Visibility switches in skills */
.skill-checkbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-checkbox {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    color: var(--color-accent);
}

.toggle-checkbox input {
    accent-color: var(--color-accent);
}

/* Dynamic Item Blocks (Experience, Education, Projects) */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dynamic-item {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition-fast);
}

.dynamic-item.item-hidden {
    opacity: 0.4;
    border-style: dashed;
}

.dynamic-item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
}

.item-visibility-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-accent);
}

.item-visibility-label input {
    accent-color: var(--color-accent);
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--color-error);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-remove-item:hover {
    text-decoration: underline;
}

/* Match Score / Analysis Dashboard Card */
.analysis-results-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bg-card-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.3s ease;
}

.score-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.score-radial {
    width: 70px;
    height: 70px;
}

.circular-chart {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.circle-bg {
    fill: none;
    stroke: #1e293b;
    stroke-width: 3.2;
}

.circle {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 3.2;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}

.circle.low {
    stroke: var(--color-error);
}

.circle.medium {
    stroke: var(--color-warning);
}

.circle.high {
    stroke: var(--color-success);
}

.percentage {
    fill: var(--text-main);
    font-family: var(--font-ui);
    font-size: 8px;
    font-weight: 700;
    text-anchor: middle;
}

.score-label h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}

.score-label p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.keyword-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.keyword-section h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.keyword-section .help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.tag-matched {
    background-color: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.tag-missing {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.automation-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
}

.automation-section h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.actions-list {
    list-style-type: none;
}

.actions-list li {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    padding-left: 1rem;
    position: relative;
}

.actions-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--color-success);
    font-weight: bold;
}

.actions-list li.action-disable::before {
    content: "✗";
    color: var(--color-error);
}

/* Right Panel: Preview Actions Group */
.preview-actions-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-right: 1rem;
}

.template-selector {
    display: flex;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--bg-card-border);
    border-radius: 6px;
    overflow: hidden;
    padding: 2px;
}

.tpl-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tpl-btn:hover {
    color: var(--text-main);
}

.tpl-btn.active {
    background-color: var(--color-primary);
    color: white;
}

/* Preview Area */
.preview-container {
    background-color: #111827;
    overflow: hidden !important; /* Prevents nested scrollbar cutting off preview */
}

/* Paper view simulating PDF A4 sheet */
.preview-paper-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Prevents paper stretching and enables min-height correctly */
    overflow-y: auto;
    height: 100%;
    padding: 1.5rem;
    background-color: #1e293b;
    border-radius: 8px;
}

/* Panel Maximization Toggles */
.btn-toggle-panel {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    outline: none;
}

.btn-toggle-panel:hover {
    color: var(--color-accent);
}

.app-main.maximize-left {
    grid-template-columns: 1fr !important;
}
.app-main.maximize-left .panel-right {
    display: none !important;
}

.app-main.maximize-right {
    grid-template-columns: 1fr !important;
}
.app-main.maximize-right .panel-left {
    display: none !important;
}

.paper {
    background-color: #ffffff;
    color: #111827;
    width: 210mm; /* A4 Width */
    min-height: 297mm; /* A4 Height */
    padding: 18mm 16mm;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9.5pt;
    line-height: 1.35;
    text-align: left;
}

/* HTML Code tab styles */
#preview-html {
    padding: 0;
}

#preview-html pre {
    background-color: #0f172a;
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
    overflow: auto;
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: #e2e8f0;
}

/* ATS Text Simulator Tab styles */
.ats-warning {
    background-color: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    color: #93c5fd;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

#ats-plain-text {
    flex: 1;
    background-color: #0f172a;
    border: 1px solid var(--bg-card-border);
    border-radius: 8px;
    color: #a7f3d0;
    font-family: var(--font-code);
    font-size: 0.8rem;
    padding: 1rem;
    resize: none;
    outline: none;
}

/* --- RENDERED RESUME DOCUMENT STYLE (inside .paper) --- */
.paper h1 {
    font-size: 19pt;
    font-weight: 700;
    margin-bottom: 2px;
    text-align: center;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.paper .cv-role {
    font-size: 11pt;
    font-weight: 600;
    text-align: center;
    color: #374151;
    margin-bottom: 6px;
}

.paper .cv-contact-info {
    font-size: 8.5pt;
    text-align: center;
    margin-bottom: 10px;
    color: #4b5563;
}

.paper section {
    margin-bottom: 8px;
}

.paper h2 {
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid #000000;
    padding-bottom: 2px;
    margin-top: 6px;
    margin-bottom: 6px;
    color: #000000;
}

.paper .cv-job, .paper .cv-edu, .paper .cv-proj {
    margin-bottom: 6px;
}

.paper .cv-job-header, .paper .cv-edu-header, .paper .cv-proj-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 9.5pt;
    color: #111827;
    margin-bottom: 1px;
}

.paper .cv-job-sub, .paper .cv-edu-sub, .paper .cv-proj-sub {
    display: flex;
    justify-content: space-between;
    font-style: italic;
    font-size: 8.5pt;
    color: #4b5563;
    margin-bottom: 3px;
}

.paper ul {
    margin-left: 16px;
    margin-bottom: 4px;
}

.paper li {
    font-size: 8.5pt;
    margin-bottom: 1.5px;
    color: #1f2937;
}

.paper p {
    font-size: 8.5pt;
    color: #1f2937;
    margin-bottom: 3px;
}

.paper .skills-category {
    margin-bottom: 3px;
    font-size: 8.5pt;
    color: #1f2937;
}

.paper .skills-category strong {
    font-weight: 700;
    color: #111827;
}

/* ==========================================
   TEMPLATE HUMANO (2 COLUMNAS) ESTILOS
   Recrea el diseño original de Gabriel
   ========================================== */
.paper.template-human {
    padding: 16mm 14mm;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Header Humano Split Layout */
.paper.template-human .human-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.paper.template-human .human-header-left {
    flex: 1;
}

.paper.template-human h1 {
    text-align: left;
    font-size: 21pt;
    margin-bottom: 2px;
}

.paper.template-human .cv-role {
    text-align: left;
    font-size: 11.5pt;
    color: #0066cc; /* Gabriel's Royal Blue Accent */
    margin-bottom: 6px;
    font-weight: 700;
}

.paper.template-human .cv-contact-info {
    text-align: left;
    font-size: 8.2pt;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #4b5563;
}

.paper.template-human .cv-contact-info span {
    display: inline-flex;
    align-items: center;
}

/* Profile Photo Right Side */
.paper.template-human .human-photo-container {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid #0066cc;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    margin-left: 1rem;
}

.paper.template-human .human-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.paper.template-human .human-photo-placeholder {
    font-size: 2rem;
}

/* Two Column Body Grid */
.paper.template-human .human-body-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.25rem;
}

.paper.template-human .human-col-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.paper.template-human .human-col-right {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Blue styling under headers */
.paper.template-human h2 {
    font-size: 10.5pt;
    border-bottom: 2px solid #000;
    margin-top: 2px;
    margin-bottom: 6px;
}

/* Job titles and client accent blue color */
.paper.template-human .cv-job-header span:first-child {
    color: #111827;
}

.paper.template-human .cv-job-sub span:first-child {
    color: #0066cc; /* Highlight Client e.g. "Cliente: Banco CMF" */
    font-weight: 600;
}

/* Key Achievements styling with trophy/target circle icon */
.paper.template-human .achievement-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 5px;
    align-items: flex-start;
}

.paper.template-human .achievement-icon {
    color: #0066cc;
    font-size: 10pt;
    line-height: 1.2;
}

.paper.template-human .achievement-content {
    font-size: 8.2pt;
}

.paper.template-human .achievement-title {
    font-weight: 700;
    color: #111827;
    margin-bottom: 1px;
}

.paper.template-human .achievement-desc {
    color: #4b5563;
    font-style: italic;
}

/* Skill Tags for Human Design */
.paper.template-human .human-skills-category {
    margin-bottom: 6px;
}

.paper.template-human .human-skills-title {
    font-size: 8.2pt;
    font-weight: 700;
    color: #0066cc;
    margin-bottom: 3px;
}

.paper.template-human .human-skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.paper.template-human .human-skill-tag {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1.5px 5px;
    font-size: 7.8pt;
    color: #334155;
    font-weight: 500;
}

/* Language Dots indicator styles */
.paper.template-human .human-language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8.2pt;
    margin-bottom: 4px;
}

.paper.template-human .lang-dots {
    display: flex;
    gap: 3px;
}

.paper.template-human .lang-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #e2e8f0;
}

.paper.template-human .lang-dot.active {
    background-color: #0066cc;
}

/* ==========================================
   TEMPLATE ATS (1 COLUMNA) ESTILOS
   Lineal, plano, optimizado para robots
   ========================================== */
.paper.template-ats {
    padding: 18mm 16mm;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.paper.template-ats .human-header-container,
.paper.template-ats .human-body-grid {
    display: block;
}

.paper.template-ats .human-photo-container {
    display: none !important;
}

.paper.template-ats h1 {
    text-align: center;
    font-size: 19pt;
}

.paper.template-ats .cv-role {
    text-align: center;
    font-size: 11pt;
    color: #374151;
}

.paper.template-ats .cv-contact-info {
    text-align: center;
    font-size: 8.5pt;
    margin-bottom: 12px;
}

.paper.template-ats h2 {
    font-size: 11pt;
    border-bottom: 1px solid #111827;
    margin-top: 10px;
    margin-bottom: 6px;
}

.paper.template-ats .cv-job-sub span:first-child {
    color: #4b5563;
    font-weight: normal;
}

.paper.template-ats .human-skill-tag {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-size: 8.5pt !important;
}

.paper.template-ats .human-skill-tag::after {
    content: ", ";
}

.paper.template-ats .human-skill-tag:last-child::after {
    content: "";
}

.paper.template-ats .lang-dots {
    display: none !important;
}

/* Print Overrides preserving selected layout style */
@media print {
    /* margin 0 en @page elimina el encabezado/pie del navegador
       (título, URL, fecha). El margen visual lo aporta .paper. */
    @page {
        size: A4;
        margin: 0;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .app-container {
        display: block !important;
        height: auto !important;
    }
    
    .app-header,
    .panel-left,
    .preview-header,
    .preview-actions,
    .ats-warning,
    .preview-actions-group {
        display: none !important;
    }
    
    .app-main {
        display: block !important;
        padding: 0 !important;
    }
    
    .panel-right {
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    
    .preview-card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .preview-container {
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .preview-paper-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        overflow: visible !important;
        height: auto !important;
    }
    
    .paper {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 12mm !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
    }
    
    /* Grid system printing fallback */
    .paper.template-human .human-body-grid {
        display: grid !important;
        grid-template-columns: 1.6fr 1fr !important;
        gap: 1.25rem !important;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    section {
        page-break-inside: avoid;
        margin-bottom: 12px;
    }
    
    .cv-job, .cv-edu, .cv-proj, .achievement-item {
        page-break-inside: avoid;
    }
}

/* Experience Breakdown list & card badges styling (Human & ATS matching) */
.breakdown-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breakdown-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.breakdown-score {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.breakdown-feedback {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.3;
}

.card-score-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
}

/* LinkedIn URL Import Card & Status */
.linkedin-import-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--bg-card-border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.linkedin-import-card h4 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.linkedin-input-group {
    display: flex;
    gap: 0.75rem;
}

.linkedin-input-group input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.linkedin-input-group input:focus {
    border-color: var(--color-accent);
}

.linkedin-input-group .btn {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-offline .status-dot {
    background-color: var(--color-error);
    box-shadow: 0 0 6px var(--color-error);
    animation: statusPulse 2s infinite alternate;
}

.status-online .status-dot {
    background-color: var(--color-success);
    box-shadow: 0 0 6px var(--color-success);
    animation: statusPulse 2s infinite alternate;
}

.status-indicator code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: #f43f5e;
}

@keyframes statusPulse {
    from {
        opacity: 0.5;
    }
    to {
        opacity: 1;
    }
}

.spinner {
    display: inline-block;
    animation: spin 1.2s linear infinite;
}

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


/* --- Buscador de Puestos --- */
.job-search-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.job-search-controls input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.5);
    color: inherit;
    font-size: 0.85rem;
}
.job-search-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}
.preset-chip {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #93c5fd;
    cursor: pointer;
    user-select: none;
}
.preset-chip:hover { background: rgba(96, 165, 250, 0.12); }
.job-search-loading { font-size: 0.82rem; opacity: 0.7; padding: 0.5rem 0; }
.job-results-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.4rem; }
.job-card {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    background: rgba(15, 23, 42, 0.35);
}
.job-card-header { display: flex; align-items: flex-start; gap: 0.6rem; }
.job-card-title { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.85rem; }
.job-card-meta { font-size: 0.72rem; opacity: 0.75; }
.job-score {
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.3rem 0.45rem;
    border-radius: 8px;
    min-width: 44px;
    text-align: center;
}
.job-score-high { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.job-score-medium { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.job-score-low { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }
.job-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.job-card-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.btn-sm { font-size: 0.75rem; padding: 0.35rem 0.7rem; }

/* --- Switcher de perfiles --- */
.profile-switcher {
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: rgba(15, 23, 42, 0.6);
    color: #93c5fd;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
