:root {
  --blue-900: #0a1628;
  --blue-600: #1a3d66;
  --blue-200: #7ab0d8;
  --orange-400: #fbbf24;
  --white: #ffffff;
  --gray-50: #f8fafc;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
  font-family: 'Inter', 'Segoe UI', Calibri, Arial, sans-serif;
  font-size: 10.5pt;
  color: #1a1a1a;
  background: var(--gray-50);
  line-height: 1.55;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-600) 100%);
  color: var(--white);
  padding: .9rem 1.5rem;
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.header-logo i {
  font-size: 1.6rem;
  color: var(--orange-400);
}
.header-logo h1 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}
.header-logo span {
  font-size: .68rem;
  color: var(--blue-200);
  display: block;
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.back-btn, .header-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--blue-200);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  font-family: inherit;
  padding: .45rem .85rem;
  border-radius: 8px;
  border: 1px solid rgba(122,176,216,.25);
  transition: all .2s;
  cursor: pointer;
  background: transparent;
  white-space: nowrap;
  line-height: 1.2;
}
.back-btn:hover, .header-btn:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.header-btn.btn-print {
  color: #6ee7b7;
  border-color: rgba(110,231,183,.35);
}
.header-btn.btn-print:hover {
  background: rgba(5,150,105,.18);
  border-color: #6ee7b7;
  color: #fff;
}
.header-btn.btn-reset {
  color: #fdba74;
  border-color: rgba(253,186,116,.35);
}
.header-btn.btn-reset:hover {
  background: rgba(234,88,12,.18);
  border-color: #fdba74;
  color: #fff;
}

.page-wrapper {
  padding-top: 64px;
  overflow-x: hidden;
  min-height: 100vh;
}

.page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  background: #fff;
  box-shadow: 0 2px 24px rgba(0,0,0,0.10);
  padding: 24mm 18mm 22mm 20mm;
  border-radius: 2px;
}

[contenteditable="true"] {
  outline: none;
  border-radius: 3px;
  transition: background 0.15s, box-shadow 0.15s;
}
[contenteditable="true"]:hover  { background: #f0f4ff; }
[contenteditable="true"]:focus  { background: #e8edff; box-shadow: 0 0 0 2px rgba(99,102,241,0.18); }

.section-title {
  font-weight: 700;
  font-size: 11pt;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 22px;
  margin-bottom: 8px;
  color: #1e293b;
  border-bottom: 2px solid #334155;
  padding-bottom: 4px;
}

.header-name {
  font-size: 24pt;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: #0f172a;
  letter-spacing: 0.4px;
}

.header-contact {
  text-align: center;
  font-size: 10pt;
  margin-bottom: 3px;
  color: #475569;
  letter-spacing: 0.2px;
}
.header-contact a { color: #2563eb; text-decoration: none; font-weight: 500; }
.header-contact a:hover { text-decoration: underline; }

.bullet-list { padding-left: 18px; }
.bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 10.5pt;
  color: #1e293b;
  line-height: 1.5;
  position: relative;
  padding-right: 18px;
}
.bullet-item::before {
  content: "\25B8";
  flex-shrink: 0;
  font-size: 8pt;
  color: #475569;
  margin-top: 2px;
}

.exp-block { margin-bottom: 14px; position: relative; }
.exp-block:last-child { margin-bottom: 0; }
.exp-header { font-weight: 700; font-size: 11pt; color: #0f172a; letter-spacing: 0.2px; }
.exp-subheader { font-size: 10.5pt; color: #475569; line-height: 1.5; }
.exp-desc { font-size: 10.5pt; }

.inline-edit {
  display: inline;
  min-width: 10px;
}

.clear-btn {
  width: 16px;
  height: 16px;
  background: #e5e7eb;
  color: #6b7280;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.10s;
  padding: 0;
  vertical-align: middle;
  margin-left: 2px;
  flex-shrink: 0;
}
.clear-btn:hover { background: #ef4444; color: #fff; transform: scale(1.15); }
.clear-btn-bullet {
  position: absolute;
  right: 3px;
  top: 0px;
  margin-left: 0;
}

.remove-block-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 19px;
  height: 19px;
  background: #e5e7eb;
  color: #6b7280;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  z-index: 5;
  padding: 0;
}
.exp-block:hover .remove-block-btn { opacity: 1; }
.remove-block-btn:hover { background: #ef4444; color: #fff; }

.add-block-btn, .add-course-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 10px 0 4px;
  padding: 5px 14px;
  background: none;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 10pt;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.add-block-btn:hover, .add-course-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.add-course-btn { margin-top: 4px; font-size: 9.5pt; }

@media (max-width: 768px) {
  .header {
    padding: .65rem .75rem;
  }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }
  .header-logo i {
    font-size: 1.2rem;
  }
  .header-logo h1 {
    font-size: .9rem;
  }
  .header-logo span {
    font-size: .6rem;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .back-btn, .header-btn {
    font-size: .72rem;
    padding: .35rem .6rem;
  }

  .page-wrapper {
    padding-top: 100px;
    overflow-x: hidden;
  }

  .clear-btn {
    width: 20px;
    height: 20px;
    font-size: 14px;
  }
  .remove-block-btn {
    width: 22px;
    height: 22px;
    font-size: 14px;
    opacity: 1;
    top: -4px;
    right: -4px;
  }
  .add-block-btn, .add-course-btn {
    font-size: 12px;
    padding: 8px 16px;
  }

  .page {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding: 10mm 8mm 12mm 8mm;
    font-size: 9pt;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 12px;
  }
  .header-name { font-size: 16pt; }
  .section-title { font-size: 9pt; margin-top: 14px; }
  .bullet-item { font-size: 8.5pt; }
}

@media print {
  @page {
    size: A4;
    margin: 20mm 18mm 22mm 20mm;
  }
  body {
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page-wrapper {
    padding-top: 0;
    overflow-x: visible;
  }
  .header { display: none !important; }
  .page {
    box-shadow: none;
    margin: 0;
    width: auto;
    min-height: auto;
    padding: 0;
    page-break-after: auto;
    border-radius: 0;
    max-width: none;
  }

  .header-name {
    page-break-after: avoid;
  }
  .header-contact {
    page-break-after: avoid;
  }

  .section-title {
    page-break-after: avoid;
  }
  .section-title + p,
  .section-title + .bullet-list {
    page-break-before: avoid;
  }

  .exp-block {
    page-break-inside: avoid;
  }

  .bullet-item {
    page-break-inside: avoid;
  }

  [contenteditable="true"]:hover, [contenteditable="true"]:focus { background: transparent !important; box-shadow: none !important; }
  .clear-btn { display: none !important; }
  .remove-block-btn, .add-block-btn, .add-course-btn { display: none !important; }
  .hide-on-print { display: none !important; }
}
