/* ==========================================================================
   Developer CV Template - Main Stylesheet
   Designed for Software Engineers, Full Stack Developers, & Tech Professionals
   Optimized for A4 Standard Print & Dynamic Editing
   Credits: Codebodh.com
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Reset & Variables
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette - Modern Tech Theme */
  --bg-canvas: #0b0f19;
  --bg-page: #ffffff;
  --bg-sidebar: #f8fafc;
  --header-bg: #0f172a;
  --header-text: #f8fafc;
  --header-muted: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-dark: #1e40af;
  
  --accent-cyan: #0ea5e9;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --text-white: #ffffff;

  --border-light: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-dark: #334155;

  /* Typography: System-first sans-serif for 100% reliable PDF rasterization */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Monaco, "Liberation Mono", Menlo, monospace;

  /* Dimensions - Standard A4 210mm x 297mm */
  --a4-width: 210mm;
  --a4-height: 297mm;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 13.5px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-canvas);
  color: #0f172a;
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

/* Reset all anchor tags so PDF & Print engines never turn them into blue/purple underlined links */
a, a:link, a:visited, a:hover, a:active {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   2. Sticky Top Toolbar
   -------------------------------------------------------------------------- */
.top-toolbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #1e293b;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.doc-link, .nav-action-link {
  font-size: 0.82rem;
  color: #94a3b8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  margin-left: 6px;
}

.doc-link:hover, .nav-action-link:hover {
  color: #38bdf8;
}

/* Toolbar Controls */
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* LocalStorage Status Badge */
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #94a3b8;
  padding: 3px 9px;
  background: rgba(30, 41, 59, 0.6);
  border-radius: var(--radius-full);
  border: 1px solid #334155;
  transition: var(--transition);
}

.save-status.saved {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #94a3b8;
  transition: var(--transition);
}

.save-status.saved .status-dot {
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Security Lock Status Indicator */
.lock-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.lock-status-badge.locked {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.lock-status-badge.unlocked {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Base Toolbar Button */
.btn-toolbar {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
  outline: none;
  white-space: nowrap;
}

.btn-secondary {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}

.btn-secondary:hover {
  background: #334155;
  color: #ffffff;
  border-color: #475569;
}

.btn-toggle {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

.btn-toggle.active {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.btn-danger-outline {
  background: transparent;
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: #ef4444;
}

.btn-lock {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
}

.btn-lock:hover {
  background: #334155;
  border-color: #64748b;
}

/* Prominent Download PDF button */
.btn-primary-highlight {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.45);
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 16px;
  border: 1px solid #3b82f6;
}

.btn-primary-highlight:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.6);
  transform: translateY(-1px);
}

.btn-primary-highlight:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   3. Page Overflow Warning Banner
   -------------------------------------------------------------------------- */
.page-overflow-warning {
  max-width: 820px;
  margin: 12px auto 0;
  padding: 8px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  color: #92400e;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  animation: slideDown 0.3s ease-out;
}

.page-overflow-warning.hidden {
  display: none !important;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Local Only Editor Protection Warning Banner */
.local-only-banner {
  background: linear-gradient(135deg, #7c2d12, #991b1b);
  border-bottom: 2px solid #ef4444;
  color: #fef2f2;
  padding: 10px 20px;
  font-size: 0.84rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  animation: slideDown 0.3s ease-out;
}

.local-banner-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.local-banner-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.local-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.local-banner-text strong {
  color: #fee2e2;
  letter-spacing: 0.02em;
  font-size: 0.86rem;
}

.local-banner-text span {
  color: #fca5a5;
  font-size: 0.77rem;
  line-height: 1.4;
}

.local-banner-text code {
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   4. Canvas / Workspace & A4 Container
   -------------------------------------------------------------------------- */
.cv-workspace {
  flex: 1;
  padding: 16px 12px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
}

/* A4 Page Layout */
.cv-page {
  width: var(--a4-width);
  min-height: var(--a4-height);
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Visual 1-page guide marker (dashed line) visible in Edit Mode */
.page-limit-marker {
  display: none;
  position: absolute;
  top: var(--a4-height);
  left: 0;
  right: 0;
  border-top: 2px dashed #f59e0b;
  z-index: 100;
  pointer-events: none;
}

.page-limit-marker::after {
  content: "--- End of A4 Page 1 ---";
  position: absolute;
  right: 12px;
  top: -16px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid #fde68a;
}

.edit-mode-on .page-limit-marker {
  display: block;
}

/* --------------------------------------------------------------------------
   5. CV Header: Dark Technology Banner
   -------------------------------------------------------------------------- */
.cv-header {
  background: #0f172a !important;
  color: #f8fafc !important;
  padding: 14px 22px 12px;
  position: relative;
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 3px solid #2563eb !important;
  page-break-inside: avoid;
  break-inside: avoid;
}

.cv-header-decor {
  position: absolute;
  top: 8px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #475569;
  letter-spacing: 0.04em;
  user-select: none;
}

.header-photo-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-photo {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #38bdf8 !important;
  background: #1e293b;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.photo-controls {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 3px;
  white-space: nowrap;
}

.edit-mode-on .photo-controls {
  display: flex;
}

.btn-photo-action {
  font-size: 0.65rem;
  padding: 2px 5px;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-photo-action:hover {
  background: #2563eb;
  border-color: #60a5fa;
}

.header-details {
  flex: 1;
  min-width: 0;
}

.name-role-group {
  margin-bottom: 4px;
}

.cv-name {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff !important;
  display: inline-block;
}

.cv-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.cv-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #38bdf8 !important;
  display: inline-block;
}

.cv-tech-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(30, 41, 59, 0.85) !important;
  color: #94a3b8 !important;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid #334155 !important;
  display: inline-block;
}

/* Contact Grid */
.cv-contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 10px;
  margin-top: 5px;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: #94a3b8 !important;
}

.contact-icon {
  width: 12px;
  height: 12px;
  color: #38bdf8 !important;
  flex-shrink: 0;
}

/* Contact link text: Never allow purple/blue underlined link styles */
.contact-text,
a.contact-text,
a.contact-text:link,
a.contact-text:visited {
  color: #cbd5e1 !important;
  text-decoration: none !important;
  border-bottom: 1px dashed transparent;
  transition: var(--transition);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-text:hover,
a.contact-text:hover {
  color: #ffffff !important;
  border-bottom-color: #38bdf8;
}

/* --------------------------------------------------------------------------
   6. CV Body: Two Column Layout
   -------------------------------------------------------------------------- */
.cv-body {
  display: grid;
  grid-template-columns: 35% 65%;
  flex: 1;
}

/* Sidebar Column */
.cv-sidebar {
  background: #f8fafc !important;
  border-right: 1px solid #e2e8f0 !important;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Main Content Column */
.cv-main {
  background: #ffffff !important;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Section Styling */
.cv-section {
  position: relative;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  border-bottom: 1.5px solid #e2e8f0 !important;
  padding-bottom: 3px;
  page-break-after: avoid;
  break-after: avoid;
}

.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f172a !important;
  display: flex;
  align-items: center;
  gap: 5px;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 3.5px;
  height: 12px;
  background: #2563eb !important;
  border-radius: 2px;
}

/* Profile / Summary */
.profile-summary {
  font-size: 0.77rem;
  color: #475569 !important;
  line-height: 1.42;
  text-align: justify;
}

/* --------------------------------------------------------------------------
   7. Technical Skills Block
   - Styled with clean system sans-serif & subtle soft-gray border
   - NEVER renders as Courier typewriter black boxes
   -------------------------------------------------------------------------- */
.skills-container {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.skill-category {
  position: relative;
  page-break-inside: avoid;
  break-inside: avoid;
}

.skill-cat-title {
  font-size: 0.73rem;
  font-weight: 700;
  color: #0f172a !important;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

/* Skill pills: soft modern aesthetic with gentle border */
.skill-pill {
  font-family: var(--font-sans) !important;
  font-size: 0.68rem;
  font-weight: 500;
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  padding: 1.5px 6.5px;
  border-radius: 4px !important;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: var(--transition);
  line-height: 1.35;
}

.skill-pill:hover {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  color: #1e40af !important;
}

/* --------------------------------------------------------------------------
   8. Experience Entries
   -------------------------------------------------------------------------- */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.entry-card {
  position: relative;
  padding-left: 10px;
  border-left: 2px solid #e2e8f0 !important;
  transition: border-color 0.2s ease;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  break-inside: avoid-page !important;
}

.entry-card:hover {
  border-left-color: #2563eb !important;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 1px;
}

.entry-role {
  font-size: 0.83rem;
  font-weight: 700;
  color: #0f172a !important;
}

.entry-date {
  font-family: var(--font-sans) !important;
  font-size: 0.68rem;
  font-weight: 600;
  color: #2563eb !important;
  background: #eff6ff !important;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.entry-subhead {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b !important;
  margin-bottom: 3px;
}

.entry-company {
  color: #0f172a !important;
}

.entry-location {
  color: #64748b !important;
  font-size: 0.7rem;
}

.entry-desc {
  font-size: 0.75rem;
  color: #475569 !important;
  margin-bottom: 3px;
  line-height: 1.38;
}

.entry-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry-bullets li {
  font-size: 0.74rem;
  color: #475569 !important;
  line-height: 1.35;
  position: relative;
  padding-left: 11px;
}

.entry-bullets li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: #2563eb !important;
  font-size: 0.74rem;
}

/* --------------------------------------------------------------------------
   9. Projects Entries
   - Soft subtle border #e2e8f0 (NEVER pitch-black boxes)
   -------------------------------------------------------------------------- */
.project-card {
  position: relative;
  padding: 7px 10px;
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  border-radius: 6px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  transition: var(--transition);
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  break-inside: avoid-page !important;
}

.project-card:hover {
  border-color: #2563eb !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}

.project-title {
  font-size: 0.81rem;
  font-weight: 700;
  color: #0f172a !important;
}

.project-links {
  display: inline-flex;
  gap: 6px;
  font-size: 0.68rem;
  font-family: var(--font-sans);
}

.project-link-item,
a.project-link-item,
a.project-link-item:link,
a.project-link-item:visited {
  color: #2563eb !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px dotted transparent !important;
}

.project-link-item:hover {
  border-bottom-color: #2563eb !important;
}

.project-desc {
  font-size: 0.74rem;
  color: #475569 !important;
  line-height: 1.35;
  margin-bottom: 4px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tech-tag {
  font-family: var(--font-sans) !important;
  font-size: 0.65rem;
  background: #f1f5f9 !important;
  color: #334155 !important;
  padding: 1px 5px;
  border-radius: 4px !important;
  border: 1px solid #e2e8f0 !important;
}

/* --------------------------------------------------------------------------
   10. Education, Certifications, Achievements & Languages
   -------------------------------------------------------------------------- */
.edu-card, .cert-card, .achieve-card, .lang-item {
  position: relative;
  page-break-inside: avoid !important;
  break-inside: avoid !important;
  break-inside: avoid-page !important;
}

.edu-card {
  margin-bottom: 6px;
}

.edu-degree {
  font-size: 0.77rem;
  font-weight: 700;
  color: #0f172a !important;
  line-height: 1.25;
}

.edu-institution {
  font-size: 0.72rem;
  color: #475569 !important;
}

.edu-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #64748b !important;
  margin-top: 1px;
}

.edu-score {
  font-family: var(--font-sans);
  font-weight: 600;
  color: #2563eb !important;
}

/* Certifications */
.cert-card {
  margin-bottom: 5px;
}

.cert-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a !important;
}

.cert-meta {
  font-size: 0.68rem;
  color: #64748b !important;
  display: flex;
  justify-content: space-between;
}

/* Achievements */
.achieve-card {
  padding-left: 12px;
  margin-bottom: 6px;
}

.achieve-card::before {
  content: "★";
  position: absolute;
  left: 0;
  top: 1px;
  color: #f59e0b !important;
  font-size: 0.78rem;
}

.achieve-title {
  font-size: 0.77rem;
  font-weight: 700;
  color: #0f172a !important;
}

.achieve-desc {
  font-size: 0.73rem;
  color: #475569 !important;
  line-height: 1.34;
}

/* Languages */
.lang-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
}

.lang-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  padding: 1px 0;
}

.lang-name {
  font-weight: 600;
  color: #0f172a !important;
}

.lang-level {
  font-size: 0.68rem;
  color: #64748b !important;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   11. Edit Mode Controls & Dynamic Buttons
   -------------------------------------------------------------------------- */
[contenteditable="true"] {
  outline: none;
  transition: background-color 0.15s ease, outline 0.15s ease;
  border-radius: 2px;
}

.edit-mode-off .btn-add,
.edit-mode-off .btn-delete,
.edit-mode-off .photo-controls,
.edit-mode-off .skill-delete {
  display: none !important;
}

.edit-mode-on [contenteditable="true"]:hover {
  background-color: rgba(37, 99, 235, 0.06);
  outline: 1px dashed rgba(37, 99, 235, 0.4);
}

.edit-mode-on [contenteditable="true"]:focus {
  background-color: rgba(37, 99, 235, 0.08);
  outline: 2px solid #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-add {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1px dashed #2563eb;
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  transition: var(--transition);
}

.btn-add:hover {
  background: #2563eb;
  color: #ffffff;
  border-style: solid;
}

.btn-delete {
  position: absolute;
  top: 2px;
  right: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fee2e2;
  color: #ef4444;
  border: 1px solid #fca5a5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.75;
  transition: var(--transition);
  z-index: 10;
}

.btn-delete:hover {
  opacity: 1;
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   12. Footer (Non-Printable Credits & Links)
   -------------------------------------------------------------------------- */
.template-footer {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  color: #94a3b8;
  padding: 14px 20px;
  text-align: center;
  font-size: 0.8rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.footer-link:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.footer-divider {
  color: #334155;
}

/* --------------------------------------------------------------------------
   13. Security PIN Modal Dialog
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  color: #f8fafc;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-icon {
  width: 34px;
  height: 34px;
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body p {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 14px;
  line-height: 1.45;
}

.pin-input-group {
  margin-bottom: 16px;
}

.pin-input-field {
  width: 100%;
  padding: 10px 14px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-align: center;
  outline: none;
  transition: var(--transition);
}

.pin-input-field:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   14. Toast Notification
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid #334155;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4000;
  transform: translateY(60px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.warning {
  border-left: 4px solid #f59e0b;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

/* --------------------------------------------------------------------------
   15. Print & PDF Optimization (@media print)
   - Preserves 100% of website UI theme, fonts, borders & colors!
   - Enforces exact colors: -webkit-print-color-adjust: exact
   -------------------------------------------------------------------------- */
@page {
  size: A4 portrait;
  margin: 6mm 6mm 6mm 6mm;
}

@media print {
  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Completely hide all UI non-CV elements */
  .top-toolbar,
  .local-only-banner,
  .page-overflow-warning,
  .page-limit-marker,
  .template-footer,
  .toast,
  .modal-overlay,
  .btn-add,
  .btn-delete,
  .photo-controls,
  .skill-delete,
  .cv-header-decor {
    display: none !important;
  }

  .cv-workspace {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  .cv-page {
    width: 100% !important;
    max-width: 198mm !important;
    min-height: auto !important;
    max-height: none !important;
    height: auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  /* Exact header preservation in print */
  .cv-header {
    background: #0f172a !important;
    color: #f8fafc !important;
    border-bottom: 3px solid #2563eb !important;
  }

  .cv-name {
    color: #ffffff !important;
  }

  .cv-title {
    color: #38bdf8 !important;
  }

  .cv-tech-badge {
    background: #1e293b !important;
    color: #94a3b8 !important;
    border: 1px solid #334155 !important;
  }

  .contact-item {
    color: #94a3b8 !important;
  }

  .contact-icon {
    color: #38bdf8 !important;
  }

  /* Ensure links are never blue/purple with underlines in print */
  a, a:link, a:visited {
    color: inherit !important;
    text-decoration: none !important;
  }

  .contact-text, a.contact-text, a.contact-text:visited {
    color: #cbd5e1 !important;
    text-decoration: none !important;
    border: none !important;
  }

  /* Exact skills pills preservation in print: soft light-gray border */
  .skill-pill {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #1e293b !important;
    border-radius: 4px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  }

  /* Exact project cards preservation in print */
  .project-card {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: 6px !important;
  }

  .project-title {
    color: #0f172a !important;
  }

  .project-link-item, a.project-link-item, a.project-link-item:visited {
    color: #2563eb !important;
    text-decoration: none !important;
  }

  .tech-tag {
    border: 1px solid #e2e8f0 !important;
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-radius: 4px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  }

  .entry-card {
    border-left: 2px solid #e2e8f0 !important;
  }

  .entry-date {
    background: #eff6ff !important;
    color: #2563eb !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  }

  .cv-sidebar {
    background: #f8fafc !important;
    border-right: 1px solid #e2e8f0 !important;
  }

  /* Anti-clipping page break rules */
  .cv-header,
  .entry-card,
  .project-card,
  .edu-card,
  .cert-card,
  .achieve-card,
  .lang-item,
  .skill-category {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    break-inside: avoid-page !important;
  }

  .section-header {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}

/* --------------------------------------------------------------------------
   16. Responsive Layouts
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .cv-workspace {
    padding: 12px 6px 28px;
  }

  .top-toolbar {
    padding: 8px 12px;
  }

  .btn-toolbar {
    font-size: 0.78rem;
    padding: 5px 10px;
  }
}

@media (max-width: 680px) {
  .top-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-brand {
    justify-content: space-between;
  }

  .toolbar-actions {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .save-status {
    order: 10;
    width: 100%;
    justify-content: center;
  }
}
