/* ────────────────────────────────────────────────────
   CV Rewriter — styles.css
   Dark navy + gold premium theme
──────────────────────────────────────────────────── */

:root {
  --bg:        #0d1117;
  --surface:   #161b27;
  --surface2:  #1e2535;
  --border:    rgba(212, 168, 67, 0.18);
  --gold:      #d4a843;
  --gold-dim:  rgba(212, 168, 67, 0.12);
  --text:      #e8eaf0;
  --muted:     #8892a4;
  --white:     #ffffff;
  --error:     #ef4444;
  --success:   #22c55e;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── HEADER ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 36px; width: auto; }
.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.3px;
}
.header-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 64px 24px 40px;
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--white) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 32px;
}

/* ── TABS ── */
.tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 4px;
  gap: 4px;
}
.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab.active {
  background: var(--gold);
  color: #0d1117;
}
.tab:hover:not(.active) {
  color: var(--text);
  background: var(--surface2);
}
.tab-icon { font-size: 13px; }

/* ── TAB CONTENT ── */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── CARD ── */
.card {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--gold);
  background: var(--gold-dim);
}
.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}
.upload-zone h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.upload-zone p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}
.btn-upload {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-upload:hover {
  background: var(--gold);
  color: #0d1117;
}

/* ── FILE INFO ── */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 14px;
}
.btn-ghost-sm {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s;
}
.btn-ghost-sm:hover { color: var(--error); }

/* ── FORM ── */
.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.optional { font-size: 12px; font-weight: 400; color: var(--muted); }
.req { color: var(--gold); }
.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 580px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
input[type="text"],
input[type="email"],
textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.2s;
  resize: vertical;
}
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
}
input::placeholder,
textarea::placeholder { color: #4a5568; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--gold);
  color: #0d1117;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.btn-primary:hover { background: #e8bb50; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212, 168, 67, 0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.full-width { width: 100%; margin-top: 8px; }

.btn-buy {
  background: linear-gradient(135deg, var(--gold), #e8bb50);
  color: #0d1117;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(212, 168, 67, 0.35);
  letter-spacing: 0.3px;
}
.btn-buy:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212, 168, 67, 0.45); }
.btn-buy:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 11px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }

/* ── PREVIEW SECTION ── */
#previewSection {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.preview-header h2 { font-size: 24px; font-weight: 800; }
.preview-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.preview-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ── LAYOUT SWITCHER ── */
.layout-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.layout-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.layout-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.layout-btn.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}
.layout-btn:hover:not(.active) { border-color: var(--muted); color: var(--text); }

/* ── WATERMARK NOTICE ── */
.watermark-notice {
  text-align: center;
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 20px;
}

/* ── CV PREVIEW WRAPPER ── */
#cvPreviewContainer {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }
.modal h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.modal-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.modal-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}
.modal-layout-section { margin-bottom: 20px; }
.modal-layouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.modal-layout-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.modal-layout-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
}
.modal-layout-btn:hover:not(.active) { border-color: var(--muted); }
.ml-icon { font-size: 22px; }
.modal-layout-btn strong { font-size: 13px; color: var(--text); }
.modal-layout-btn small { font-size: 11px; color: var(--muted); }
.modal-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

/* ── LOADING OVERLAY ── */
#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.loading-card {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 340px;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loadingMsg {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
#loadingHint { font-size: 13px; color: var(--muted); }

/* ── UTILITY ── */
.hidden { display: none !important; }
.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 12px;
}
.success-msg {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 12px;
}

/* ── PRINT STYLES (for saving clean CV as PDF) ── */
@media print {
  header, .hero, .tabs, .tab-content,
  .preview-header, .layout-switcher,
  .watermark-notice, .preview-actions,
  #buyModal, #loadingOverlay,
  .watermark-overlay-div { display: none !important; }

  body { background: white !important; color: black !important; }
  #previewSection { padding: 0 !important; max-width: 100% !important; }
  #cvPreviewContainer { box-shadow: none !important; }
}
