/* AI ATS Resume Builder Pro — core UI styles
   Vanilla CSS, no framework. Design tokens via CSS custom properties so
   dark/light mode is a single attribute toggle. */

:root {
	--ats-bg: #f5f7fb;
	--ats-surface: rgba(255, 255, 255, 0.65);
	--ats-surface-border: rgba(255, 255, 255, 0.4);
	--ats-text: #1a1a2e;
	--ats-muted: #6b7280;
	--ats-accent: #2f6fed;
	--ats-accent-2: #7c3aed;
	--ats-success: #16a34a;
	--ats-danger: #dc2626;
	--ats-radius: 14px;
	--ats-shadow: 0 8px 30px rgba(20, 20, 40, 0.08);
}

[data-ats-theme='dark'] {
	--ats-bg: #0f1120;
	--ats-surface: rgba(30, 32, 55, 0.55);
	--ats-surface-border: rgba(255, 255, 255, 0.08);
	--ats-text: #f1f2f8;
	--ats-muted: #9498ad;
	--ats-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

#ats-rb-app {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--ats-text);
	background: var(--ats-bg);
	min-height: 100vh;
	padding: 24px;
	box-sizing: border-box;
}

.ats-glass {
	background: var(--ats-surface);
	border: 1px solid var(--ats-surface-border);
	border-radius: var(--ats-radius);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	box-shadow: var(--ats-shadow);
}

/* ---------- Buttons ---------- */
.ats-btn {
	border: none;
	border-radius: 10px;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ats-btn:hover { transform: translateY(-1px); }
.ats-btn-primary { background: var(--ats-accent); color: #fff; }
.ats-btn-accent { background: linear-gradient(135deg, var(--ats-accent), var(--ats-accent-2)); color: #fff; }
.ats-btn-secondary { background: rgba(47, 111, 237, 0.1); color: var(--ats-accent); }
.ats-btn-danger { background: rgba(220, 38, 38, 0.1); color: var(--ats-danger); }
.ats-btn-ai { background: rgba(124, 58, 237, 0.12); color: var(--ats-accent-2); }

/* ---------- Dashboard ---------- */
.ats-stats-row { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.ats-stat-card { flex: 1 1 160px; padding: 20px; text-align: center; }
.ats-stat-value { font-size: 28px; font-weight: 700; color: var(--ats-accent); }
.ats-stat-label { font-size: 13px; color: var(--ats-muted); margin-top: 4px; }

.ats-section-block { margin-bottom: 32px; }
.ats-section-heading { font-size: 18px; font-weight: 700; margin-bottom: 12px; }

.ats-resume-grid, .ats-template-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
}
.ats-resume-card, .ats-template-card { padding: 16px; }
.ats-resume-title, .ats-template-name { font-weight: 600; margin-bottom: 6px; }
.ats-resume-meta, .ats-template-desc { font-size: 12.5px; color: var(--ats-muted); margin-bottom: 10px; }
.ats-template-placeholder {
	width: 100%; height: 120px; border-radius: 10px; margin-bottom: 8px;
	display: flex; align-items: center; justify-content: center;
	font-size: 32px; font-weight: 700; color: var(--ats-accent);
	background: rgba(47, 111, 237, 0.08);
}

.ats-jd-list { display: flex; flex-direction: column; gap: 8px; }
.ats-jd-row { display: flex; gap: 16px; padding: 10px 14px; font-size: 13px; align-items: center; }
.ats-tag-success { color: var(--ats-success); font-weight: 600; }
.ats-tag-muted { color: var(--ats-muted); }

.ats-empty, .ats-loading, .ats-auth-prompt { padding: 24px; text-align: center; color: var(--ats-muted); }

/* ---------- Builder ---------- */
.ats-builder-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	align-items: start;
}
@media (max-width: 900px) {
	.ats-builder-grid { grid-template-columns: 1fr; }
}

.ats-form-pane { padding: 20px; max-height: 90vh; overflow-y: auto; }
.ats-form-section { margin-bottom: 22px; }
.ats-form-section h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ats-muted); margin-bottom: 10px; }

.ats-field { display: block; margin-bottom: 10px; }
.ats-field-label { display: block; font-size: 12.5px; color: var(--ats-muted); margin-bottom: 4px; }
.ats-input {
	width: 100%; box-sizing: border-box; padding: 9px 12px; border-radius: 8px;
	border: 1px solid rgba(120, 120, 140, 0.25); background: rgba(255,255,255,0.6);
	font-size: 13.5px; color: var(--ats-text); font-family: inherit;
}
[data-ats-theme='dark'] .ats-input { background: rgba(255,255,255,0.06); }
textarea.ats-input { min-height: 70px; resize: vertical; }

.ats-item-card { border: 1px dashed rgba(120,120,140,0.3); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.ats-draggable-section { cursor: grab; }

.ats-jd-textarea { min-height: 120px; margin-bottom: 10px; }
.ats-jd-result { margin-top: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.ats-cover-letter-output { white-space: pre-wrap; font-size: 13px; margin-top: 12px; line-height: 1.6; }

.ats-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.ats-score-badge {
	padding: 8px 14px; border-radius: 999px; background: rgba(22,163,74,0.12);
	color: var(--ats-success); font-weight: 700; font-size: 13px;
}
.ats-template-select { padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(120,120,140,0.25); }

.ats-preview-pane { position: sticky; top: 12px; }
.ats-preview-inner {
	background: #fff; border-radius: 10px; overflow: auto; max-height: 85vh;
	box-shadow: var(--ats-shadow); display: flex; justify-content: center; padding: 12px;
}

/* ---------------- New Resume modal ---------------- */
.ats-modal-overlay {
	position: fixed; inset: 0; background: rgba(17, 24, 39, 0.5);
	display: flex; align-items: center; justify-content: center;
	z-index: 100; padding: 20px;
}
.ats-modal {
	border-radius: 16px; padding: 28px; max-width: 560px; width: 100%;
	position: relative; max-height: 88vh; overflow-y: auto; background: #fff;
}
.ats-modal-close {
	position: absolute; top: 16px; right: 18px; background: none; border: none;
	font-size: 16px; color: var(--ats-muted); cursor: pointer;
}
.ats-modal-title { font-size: 19px; font-weight: 800; margin-bottom: 18px; padding-right: 24px; }
.ats-modal-subtitle { font-size: 13.5px; color: var(--ats-muted); margin-bottom: 14px; }
.ats-modal-status { font-size: 13px; color: var(--ats-muted); margin-top: 10px; min-height: 18px; }
.ats-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .ats-choice-grid { grid-template-columns: 1fr; } }
.ats-choice-card {
	border: 1.5px solid rgba(120,120,140,0.25); border-radius: 12px; padding: 18px; cursor: pointer;
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ats-choice-card:hover { border-color: var(--ats-accent); box-shadow: 0 4px 14px rgba(47,111,237,0.14); }
.ats-choice-icon { font-size: 26px; margin-bottom: 8px; }
.ats-choice-title { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.ats-choice-desc { font-size: 12.5px; color: var(--ats-muted); line-height: 1.5; }
.ats-modal-body-slot:not(:empty) { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(120,120,140,0.2); }

/* Print / zoom helpers applied by builder.js via inline transform when needed */
.ats-preview-inner.zoom-desktop .ats-resume-page { transform: scale(1); }
.ats-preview-inner.zoom-tablet .ats-resume-page { transform: scale(0.85); }
.ats-preview-inner.zoom-mobile .ats-resume-page { transform: scale(0.6); }
