* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f3f4f6;
  color: #1f2937;
  line-height: 1.5;
  padding: 40px 20px;
}
.cv-container {
  max-width: 820px;
  margin: 0 auto;
  background: #ffffff;
  padding: 40px 48px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.header-left h1 {
  font-size: 30px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
}
.header-left h2 {
  font-size: 17px;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 6px;
}
.header-left .github-link {
  font-size: 13px;
  color: #4b5563;
}
.header-left .github-link a {
  color: #2563eb;
  text-decoration: underline;
}

.header-right {
  text-align: right;
  font-size: 13px;
  color: #4b5563;
}
.contact-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 3px;
}
.contact-item a {
  color: #2563eb;
  text-decoration: underline;
}
.contact-item i {
  color: #2563eb;
  font-size: 12px;
  width: 14px;
  text-align: center;
}

/* Summary */
.summary {
  font-size: 13.5px;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 18px;
  text-align: justify;
}

/* Sections */
.section-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #111827;
  text-transform: uppercase;
  border-bottom: 1.5px solid #d1d5db;
  padding-bottom: 3px;
  margin-bottom: 12px;
}
.section-divider {
  display: none;
}
hr {
  border: none;
  border-bottom: 1.5px solid #d1d5db;
  margin: 14px 0;
  clear: both;
}

/* Experience & Education Entry */
.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}
.entry-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #111827;
}
.entry-location {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.entry-subheader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-style: italic;
  font-size: 13.5px;
  color: #4b5563;
  margin-bottom: 6px;
}

/* Bullet lists */
ul.bullets {
  list-style-type: disc;
  padding-left: 18px;
  margin-bottom: 14px;
}
ul.bullets li {
  font-size: 13.5px;
  color: #374151;
  margin-bottom: 3px;
  line-height: 1.5;
}
ul.bullets li:last-child {
  margin-bottom: 0;
}

/* Technical Skills */
.skills-list {
  font-size: 13.5px;
  color: #374151;
  margin-bottom: 16px;
  line-height: 1.6;
}
.skills-list div {
  margin-bottom: 3px;
}
.skills-list strong {
  color: #111827;
}

/* Projects */
.project-entry {
  margin-bottom: 10px;
}
.project-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 3px;
}
.project-header strong {
  color: #111827;
}
.project-header a {
  color: #2563eb;
  text-decoration: underline;
}

/* Download Bar */
.download-bar {
  max-width: 820px;
  margin: 0 auto 16px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.tailor-btn {
  text-decoration: none;
  font-size: 13.5px;
  color: #2563eb;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}
.tailor-btn:hover {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.download-btn {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  font-family: inherit;
}
.download-btn:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.download-btn:active {
  transform: translateY(0);
}

/* Live Edit Mode */
.editing-mode [contenteditable="true"],
.cv-container.editing-mode {
  outline: 2px dashed #3b82f6 !important;
  outline-offset: 4px;
  border-radius: 4px;
}
.cv-container.editing-mode:focus,
.editing-mode *:focus {
  outline: 2px solid #2563eb !important;
  background-color: rgba(37, 99, 235, 0.03);
}

@page {
  size: A4 portrait;
  margin: 0mm;
}

@media print {
  html, body {
    background: #ffffff;
    padding: 0;
    margin: 0;
  }
  .cv-container {
    box-shadow: none;
    padding: 12mm 15mm;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    outline: none !important;
  }
  .download-bar {
    display: none !important;
  }
  #tailoredBanner,
  #editNoticeBanner,
  #editorToolbar,
  .cv-drag-handle {
    display: none !important;
  }
}

/* Hide editing drag handles in Preview mode */
.cv-drag-handle {
  display: none !important;
}

/* Show editing handles ONLY in Edit mode */
body.editing-active .cv-drag-handle {
  display: flex !important;
}

/* When in Edit mode, hide left navigation group and position right buttons to top-right corner */
body.editing-active .download-bar {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
}

body.editing-active .download-bar > div:first-child {
  display: none !important;
}

body.editing-active .download-bar > div:last-child {
  position: fixed !important;
  top: 20px !important;
  right: 24px !important;
  z-index: 9999 !important;
  display: flex !important;
  gap: 10px !important;
}

/* Icon-only buttons during Edit Mode */
body.editing-active #editToggleBtn,
body.editing-active #downloadPdfBtn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 17px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

body.editing-active #downloadPdfBtn span {
  display: none !important;
}

/* Figma-Style Left Editor Sidebar */
#editorToolbar.figma-sidebar {
  position: fixed;
  left: 20px;
  top: 85px;
  width: 275px;
  max-height: calc(100vh - 105px);
  overflow-y: auto;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 14px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#editorToolbar.figma-sidebar::-webkit-scrollbar {
  width: 5px;
}
#editorToolbar.figma-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.group-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

@media (min-width: 1200px) {
  body.editing-active .cv-container {
    margin-left: calc(50% - 240px);
    transition: margin-left 0.3s ease;
  }
}

/* Collapsed Editor Sidebar State */
#editorToolbar.figma-sidebar.collapsed {
  width: 48px !important;
  padding: 8px !important;
  overflow: hidden !important;
  gap: 0 !important;
}
#editorToolbar.figma-sidebar.collapsed .tool-group {
  display: none !important;
}
#editorToolbar.figma-sidebar.collapsed .sidebar-header {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  justify-content: center !important;
  gap: 4px;
}
#editorToolbar.figma-sidebar.collapsed .sidebar-header > span {
  display: none !important;
}
