/* styles.css - Generator CV & Surat Lamaran Kerja */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --cream: #F7F4EF;
  --ink: #1A1A18;
  --muted: #7A7870;
  --accent: #C4A882;
  --accent-light: #F4EFEA;
  --accent-dark: #A3865F;
  --line: #E2DDD6;
  --white: #FFFFFF;
  
  --editor-bg: #FFFFFF;
  --editor-card-bg: #FBF9F6;
  --editor-border: #E8E3DC;
  --editor-text: #2C2C2A;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Theme Presets */
[data-theme="gold"] {
  --accent: #C4A882;
  --accent-light: #F6F2EB;
  --accent-dark: #A3865F;
}

[data-theme="navy"] {
  --accent: #2A5298;
  --accent-light: #EDF2FA;
  --accent-dark: #1E3C72;
}

[data-theme="emerald"] {
  --accent: #2A9D8F;
  --accent-light: #EBF7F5;
  --accent-dark: #1F7268;
}

[data-theme="rose"] {
  --accent: #C85A70;
  --accent-light: #FDF0F2;
  --accent-dark: #A03D51;
}

[data-theme="charcoal"] {
  --accent: #4A4E69;
  --accent-light: #F0F1F5;
  --accent-dark: #22223B;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #EFECE6;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header & Top Navigation */
.app-header {
  height: 60px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  gap: 12px;
}

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

.brand-logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.3s;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 10.5px;
  color: var(--muted);
}

/* Multi-CV Resume Manager Bar */
.resume-manager-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.cv-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cv-dropdown {
  padding: 5px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  max-width: 180px;
}

.cv-dropdown:focus {
  border-color: var(--accent);
}

.header-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.tab-btn {
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tab-btn.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.tab-btn:hover:not(.active) {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cloud Status Indicator */
.cloud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all 0.2s;
}

.cloud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #B0BEC5;
}

.cloud-status-badge.connected .cloud-dot {
  background: #2E7D32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.cloud-status-badge.connected {
  color: #1B5E20;
  background: #E8F5E9;
  border-color: #C8E6C9;
}

.cloud-status-badge.saving .cloud-dot {
  background: #F57C00;
  animation: pulse 0.8s infinite alternate;
}

.cloud-status-badge.saving {
  color: #E65100;
  background: #FFF3E0;
  border-color: #FFE0B2;
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Theme Picker */
.theme-selector {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--cream);
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.theme-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--white);
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.theme-dot:hover {
  transform: scale(1.2);
}

.theme-dot.active {
  transform: scale(1.25);
  box-shadow: 0 0 0 2px var(--ink);
}

.theme-dot.gold { background: #C4A882; }
.theme-dot.navy { background: #2A5298; }
.theme-dot.emerald { background: #2A9D8F; }
.theme-dot.rose { background: #C85A70; }
.theme-dot.charcoal { background: #4A4E69; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #333330;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-outline {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--cream);
  border-color: #D3CDC4;
}

.btn-danger {
  background: #FFF0F0;
  color: #D32F2F;
  border-color: #FFCDD2;
}

.btn-danger:hover {
  background: #FFEBEE;
}

.btn-sm {
  padding: 4px 9px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

/* Main Split Layout */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Mobile View Switcher */
.mobile-view-toggle {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  justify-content: center;
  gap: 8px;
}

/* Sidebar Editor */
.editor-sidebar {
  width: 480px;
  background: var(--editor-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}

.editor-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: #FAF8F5;
  overflow-x: auto;
  scrollbar-width: thin;
}

.editor-nav-item {
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.editor-nav-item:hover {
  color: var(--ink);
}

.editor-nav-item.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  background: var(--white);
}

.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.editor-section {
  display: none;
  animation: fadeIn 0.25s ease;
}

.editor-section.active {
  display: block;
}

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

.section-header {
  margin-bottom: 18px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.section-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--editor-card-bg);
  border: 1px solid var(--editor-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(196, 168, 130, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* Photo Upload Box */
.photo-upload-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--editor-card-bg);
  border: 1px dashed var(--editor-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.photo-preview-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  background: var(--line);
}

.photo-upload-controls {
  flex: 1;
}

/* Dynamic Item Cards */
.dynamic-card {
  background: var(--editor-card-bg);
  border: 1px solid var(--editor-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  position: relative;
  transition: border-color 0.2s;
}

.dynamic-card:hover {
  border-color: #D0C9C0;
}

.card-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.card-index {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* Tag Inputs */
.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--editor-card-bg);
  border: 1px solid var(--editor-border);
  border-radius: var(--radius-sm);
  min-height: 42px;
  align-items: center;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
}

.tag-item .remove-tag {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  font-weight: bold;
}

.tag-item .remove-tag:hover {
  color: #D32F2F;
}

/* Live Preview Section */
.preview-container {
  flex: 1;
  background: #EFECE6;
  overflow-y: auto;
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-wrapper {
  transform-origin: top center;
  transition: transform 0.2s ease;
}

/* Print Sheets (A4 Dimensions) */
.cv-sheet, .cl-sheet {
  width: 210mm;
  min-height: 297mm;
  background: var(--white);
  padding: 36px 44px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.35s ease forwards;
  position: relative;
  transition: all 0.3s ease;
}

.cl-sheet {
  padding: 48px 56px;
}

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

/* CV Layout & Styling */
.cv-head {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 24px;
}

.cv-photo-wrapper {
  flex-shrink: 0;
}

.cv-photo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--line);
  border: 3px solid var(--white);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.cv-head-text {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cv-name {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.cv-name em {
  font-style: normal;
  color: var(--accent);
  transition: color 0.3s;
}

.cv-nickname {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 6px;
  font-weight: 500;
}

.cv-contact {
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.85;
}

.cv-body {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0 28px;
}

.sec-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 3px;
  line-height: 1.5;
  transition: color 0.3s;
}

.cv-row {
  margin-bottom: 20px;
}

.about-text {
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.65;
  color: #4A4845;
  white-space: pre-line;
}

.exp-item {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.exp-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.exp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.exp-role {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.exp-date {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.exp-co {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin: 2px 0 5px;
  letter-spacing: 0.04em;
  transition: color 0.3s;
}

.exp-badge {
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 7px;
  vertical-align: middle;
  opacity: 0.85;
  transition: background 0.3s;
}

.exp-desc {
  font-size: 11.5px;
  color: #4A4845;
  line-height: 1.6;
  white-space: pre-line;
}

.exp-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 20px;
}

.edu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.edu-deg {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.edu-school {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin: 2px 0 1px;
  transition: color 0.3s;
}

.edu-year {
  font-size: 10.5px;
  color: var(--muted);
}

.skill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}

.skill-name-text {
  font-size: 12px;
  color: var(--ink);
  position: relative;
  padding-left: 14px;
}

.skill-name-text::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 4.5px;
  height: 4.5px;
  background: var(--accent);
  border-radius: 50%;
  transition: background 0.3s;
}

/* Cover Letter Styling */
.cl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.cl-name {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cl-name em {
  font-style: normal;
  color: var(--accent);
  transition: color 0.3s;
}

.cl-info {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 7px;
}

.cl-date {
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.9;
  padding-top: 4px;
}

.cl-rule {
  width: 38px;
  height: 2.5px;
  background: var(--accent);
  margin: 24px 0;
  border-radius: 2px;
  transition: background 0.3s;
}

.cl-to {
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.85;
  margin-bottom: 24px;
  white-space: pre-line;
}

.cl-to strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.cl-subj {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.cl-subj span {
  color: var(--accent);
  font-style: normal;
  transition: color 0.3s;
}

.cl-body p {
  font-size: 12.8px;
  color: #3A3835;
  line-height: 1.85;
  margin-bottom: 16px;
  white-space: pre-line;
}

.cl-body p:first-child::first-letter {
  font-size: 40px;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  margin-right: 8px;
  margin-top: 4px;
  color: var(--accent);
  transition: color 0.3s;
}

.cl-foot {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.cl-signoff {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.cl-sig {
  font-size: 28px;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  letter-spacing: -0.03em;
}

/* Empty State / Hidden */
.hidden {
  display: none !important;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }

  .mobile-view-toggle {
    display: flex;
  }

  .editor-sidebar {
    width: 100%;
    height: calc(100vh - 110px);
  }

  .preview-container {
    width: 100%;
    height: calc(100vh - 110px);
  }

  .cv-sheet, .cl-sheet {
    width: 100%;
    min-height: auto;
    padding: 24px;
  }
}

/* PRINT CSS OPTIMIZATION */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    background: #FFFFFF !important;
    height: auto !important;
    overflow: visible !important;
  }

  .app-header,
  .editor-sidebar,
  .mobile-view-toggle,
  .theme-selector,
  .resume-manager-bar {
    display: none !important;
  }

  .app-container {
    display: block !important;
    overflow: visible !important;
  }

  .preview-container {
    padding: 0 !important;
    background: #FFFFFF !important;
    overflow: visible !important;
    display: block !important;
  }

  .cv-sheet, .cl-sheet {
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    padding: 28px 40px !important;
    page-break-after: always;
  }

  .cl-sheet {
    padding: 40px 48px !important;
  }
}
