/* ==========================================================================
   RESUME BUILDER — LIGHT THEME (CodSoft-style)
   ========================================================================== */

:root {
  --bg-page: #eef2f7;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-input: #d1d5db;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #ff0000;
  --accent-light: #eef2ff;
  --accent-hover: #4338ca;
  --green: #22c55e;
  --orange: #f97316;
  --red: #ef4444;
  --blue: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  height: 72px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  z-index: 100;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.logo-text h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.draft-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Progress bars */
.header-center {
  display: flex;
  align-items: center;
  gap: 32px;
}

.progress-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.progress-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.progress-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 36px;
}

.ats-score-value {
  color: var(--orange);
}

.progress-bar {
  width: 120px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.completion-fill {
  background: linear-gradient(90deg, var(--accent), #818cf8);
}

.ats-fill {
  background: linear-gradient(90deg, var(--blue), #60a5fa);
}

/* Header buttons */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.header-btn i, .header-btn svg {
  width: 16px;
  height: 16px;
}

.reset-btn {
  background: none;
  border: none;
  color: var(--orange);
  font-weight: 500;
}
.reset-btn:hover {
  background: #fff7ed;
}

.outlined-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.outlined-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.primary-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  border-radius: 20px;
  padding: 8px 20px;
}
.primary-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* ==========================================================================
   MAIN LAYOUT
   ========================================================================== */
.app-main {
  display: flex;
  height: calc(100vh - 72px);
  width: 100%;
  overflow: hidden;
}

/* ==========================================================================
   LEFT EDITOR PANEL
   ========================================================================== */
.editor-panel {
  width: 50%;
  max-width: 680px;
  min-width: 400px;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.section-title-row h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 16px 0;
}

/* Form fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.single {
  grid-template-columns: 1fr;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field.full {
  grid-column: span 2;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-field input,
.form-field textarea,
.skill-input {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.form-field input::placeholder,
.form-field textarea::placeholder,
.skill-input::placeholder {
  color: var(--text-muted);
}

.form-field input:focus,
.form-field textarea:focus,
.skill-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-field textarea {
  resize: vertical;
  min-height: 90px;
}

/* Add buttons */
.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.add-btn i, .add-btn svg {
  width: 14px;
  height: 14px;
}

.add-btn:hover {
  background: var(--accent);
  color: #ffffff;
}

.section-add-btn {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 16px;
  border-style: dashed;
}

.section-add-btn:hover {
  border-style: solid;
}

/* Date input with calendar */
input[type="date"],
input[type="month"] {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  cursor: pointer;
}

input[type="date"]:focus,
input[type="month"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Proficiency select */
.proficiency-select {
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.proficiency-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Entries list (experience, education, projects, certs) */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.entry-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.entry-card-header:hover {
  background: #f1f5f9;
}

.entry-card-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.entry-card-header .subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-left: 8px;
}

.entry-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.entry-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.entry-action-btn i, .entry-action-btn svg {
  width: 16px;
  height: 16px;
}

.entry-action-btn:hover {
  color: var(--red);
  background: #fef2f2;
}

.entry-card-body {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.entry-card-body .form-row {
  margin-bottom: 12px;
}

.entry-card-body .form-row:last-child {
  margin-bottom: 0;
}

/* Bullet points */
.bullets-section {
  margin-top: 12px;
}

.bullets-section label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: block;
}

.bullet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.bullet-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.bullet-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.bullet-del-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.bullet-del-btn:hover {
  color: var(--red);
}

.add-bullet-btn {
  background: none;
  border: 1px dashed var(--border-input);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  margin-top: 4px;
}

.add-bullet-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Skills tags */
.skills-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 24px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 500;
}

.skill-tag .remove-skill {
  cursor: pointer;
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.skill-tag .remove-skill:hover {
  opacity: 1;
}

.skill-tag .remove-skill svg {
  width: 12px;
  height: 12px;
}

.skill-input {
  margin-top: 0;
}

/* ==========================================================================
   RIGHT PREVIEW PANEL
   ========================================================================== */
.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
  padding-left: 0;
}

.preview-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 14px 20px;
}

.preview-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.preview-label i, .preview-label svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.view-toggle {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 3px;
}

.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: none;
  border-radius: 18px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  font-family: inherit;
}

.toggle-btn i, .toggle-btn svg {
  width: 14px;
  height: 14px;
}

.toggle-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.preview-viewport {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Resume Page */
.resume-page {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  font-family: 'Inter', sans-serif;
  font-size: 10pt;
  line-height: 1.5;
  color: #1e293b;
  transition: width 0.3s ease;
}

.resume-page.mobile-view {
  width: 375px;
}

/* Resume Content Styles */
.resume-name {
  font-size: 26pt;
  font-weight: 800;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 4px;
}

.resume-divider {
  width: 100%;
  height: 2px;
  background: var(--accent);
  margin: 8px 0 16px 0;
}

.resume-contact {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 9pt;
  color: #475569;
  margin-bottom: 16px;
}

.resume-contact span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.resume-section-block {
  margin-bottom: 16px;
}

.resume-section-title {
  font-size: 11pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.resume-summary-text {
  font-size: 9.5pt;
  color: #334155;
  text-align: justify;
}

.resume-entry {
  margin-bottom: 10px;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.resume-entry-title {
  font-weight: 700;
  font-size: 10pt;
  color: #0f172a;
}

.resume-entry-company {
  font-weight: 500;
  color: #334155;
}

.resume-entry-date {
  font-size: 8.5pt;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.resume-entry-location {
  font-size: 8.5pt;
  color: #64748b;
  font-style: italic;
}

.resume-link {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.resume-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.resume-entry-bullets {
  margin-top: 4px;
  padding-left: 16px;
}

.resume-entry-bullets li {
  font-size: 9pt;
  color: #334155;
  margin-bottom: 2px;
}

.resume-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resume-skill-pill {
  background: #f1f5f9;
  color: #334155;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 8.5pt;
}

/* Languages in preview */
.resume-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 9pt;
}

.resume-lang-name {
  font-weight: 600;
  color: #1e293b;
}

.resume-lang-level {
  color: #64748b;
  font-size: 8.5pt;
  font-style: italic;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-top h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-content {
  padding: 20px;
}

.share-link-box {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.share-link-box input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-primary);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast i, .toast svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

  body {
    background: #ffffff !important;
    overflow: visible !important;
  }

  .app-header,
  .editor-panel,
  .preview-header,
  .modal-overlay,
  .toast {
    display: none !important;
  }

  .app-main,
  .preview-panel,
  .preview-viewport {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: none !important;
    height: auto !important;
    width: auto !important;
    display: block !important;
    border: none !important;
  }

  .resume-page {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    min-height: auto !important;
    padding: 15mm !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .header-center {
    display: none;
  }
  .editor-panel {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .preview-panel {
    display: none;
  }
}
