/* style.css */
:root {
  --bg-color: #030303;
  --bg-card: rgba(20, 20, 20, 0.6);
  --bg-hover: rgba(30, 30, 30, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-active: rgba(255, 255, 255, 0.3);
  --text-main: #fcfcfc;
  --text-mut: #999999;
  --glow: rgba(255, 255, 255, 0.15);
  
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
  --trans-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center top;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Background Glow */
body::before {
  content: '';
  position: absolute;
  top: -20vh;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 80vh;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.03) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* Global Typography */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

.font-serif {
  font-family: var(--font-serif);
}

.mut-text {
  color: var(--text-mut);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
  border-bottom: 1px solid var(--border-color);
}

/* Navigation */
.navbar {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(3, 3, 3, 0.8);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.25rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid var(--text-main);
  box-shadow: 0 0 8px var(--glow);
}

/* Modifiers */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: var(--trans-smooth);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--text-main);
  color: #000;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: transparent;
  color: var(--text-main);
  border-color: var(--text-main);
  box-shadow: 0 0 20px var(--glow), inset 0 0 10px var(--glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.03);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

.icon-sm {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ========================================================
   DASHBOARD STYLES
   ======================================================== */

.dashboard-body {
  background-image: none; 
}

.dash-topbar {
  height: 70px;
  background: rgba(3, 3, 3, 0.95);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.dash-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================================
   DASHBOARD STYLES
   ======================================================== */
.dash-glow {
  position: fixed;
  top: 0; left: 50%;
  width: 80vw; height: 80vh;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
  transform: translate(-50%, -20%);
  pointer-events: none;
  z-index: -1;
}

.dash-main {
  padding: 60px 24px 100px;
  max-width: 1200px;
  margin: 0 auto;
}

.dash-header {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.dash-title {
  font-size: 2.5rem;
  color: var(--text-main);
  margin: 0;
}

.resume-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.resume-item {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.resume-item:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.res-link {
  text-decoration: none;
  color: inherit;
  display: block;
  flex: 1;
}

.res-thumb {
  height: 200px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Wireframe Thumbnail Styles */
.res-thumb::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}
.a4-line {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-bottom: 6px;
  width: 100%;
}
.a4-line.title {
  background: rgba(255,255,255,0.25);
  width: 40%;
}
.a4-body {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex: 1;
}
.a4-main { flex: 2; }
.a4-sidebar { flex: 1; }

.res-info {
  padding: 20px;
}

.res-info h3 {
  font-size: 1.2rem;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.res-actions {
  padding: 0 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.res-actions .btn {
  flex: 1;
  margin-right: 12px;
}

.mobile-sticky-cta {
  display: none;
}

@media (max-width: 768px) {
  .dash-main {
    padding-top: 30px;
  }
  .dash-title {
    font-size: 2rem;
  }
  .resume-list {
    grid-template-columns: 1fr;
  }
  .mobile-sticky-cta {
    display: block;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 90;
  }
}

/* ========================================================
   EDITOR STYLES
   ======================================================== */
.editor-body {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-image: none;
  background-color: var(--bg-color);
}

.editor-topbar {
  height: 70px;
  background: rgba(3, 3, 3, 0.98);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.app-title-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  transition: var(--trans-smooth);
  padding: 6px 12px;
  border-radius: 4px;
  width: 300px;
}

.app-title-input:hover, .app-title-input:focus {
  background: rgba(255,255,255,0.03);
  border-color: var(--border-color);
}

.topbar-status {
  font-size: 0.75rem;
  color: var(--text-mut);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
  transition: color 0.3s;
}

.topbar-status::before { 
  content: ''; 
  width: 6px; height: 6px; 
  background: #22c55e; 
  border-radius: 50%; 
  box-shadow: 0 0 8px rgba(34,197,94,0.4); 
  transition: background 0.3s;
}

.topbar-status.saving {
  color: #fbbf24;
}

.topbar-status.saving::before {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251,191,36,0.4); 
}

.editor-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Left Panel: Form */
.editor-sidebar {
  width: 40%;
  border-right: 1px solid var(--border-color);
  background: rgba(10, 10, 10, 0.6);
  overflow-y: auto;
  padding: 40px;
}

/* Hide scrollbar for standard look */
.editor-sidebar::-webkit-scrollbar, .editor-preview::-webkit-scrollbar { width: 6px; }
.editor-sidebar::-webkit-scrollbar-thumb, .editor-preview::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.form-section {
  margin-bottom: 50px;
}

.form-section-title {
  font-size: 1.4rem;
  margin-bottom: 24px;
  font-family: var(--font-serif);
  color: #fff;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  color: #a3a3a3;
  margin-bottom: 8px;
  margin-left: 4px;
}

.form-input, .form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  padding: 16px;
  font-family: var(--font-sans);
  font-size: 16px;
  transition: var(--trans-smooth);
  box-sizing: border-box;
}

.form-textarea { resize: vertical; min-height: 120px; }
.form-input:focus, .form-textarea:focus { 
  outline: none; 
  border-color: rgba(255,255,255,0.4); 
  background: rgba(255,255,255,0.06); 
  box-shadow: 0 0 0 4px rgba(255,255,255,0.05);
}

.item-group {
  border: 1px solid var(--border-color);
  padding: 24px 20px;
  margin-bottom: 16px;
  position: relative;
  background: rgba(0,0,0,0.2);
}

/* For simple reorder visual cue */
.btn-reorder {
  position: absolute;
  top: 10px; right: 40px;
  background: none; border: none; color: var(--text-mut);
  cursor: grab;
}

.btn-remove {
  position: absolute;
  top: 10px; right: 10px;
  background: none; border: none; color: var(--text-mut);
  cursor: pointer;
}
.btn-remove:hover { color: #f43f5e; }

.btn-add {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-mut);
  width: 100%;
  padding: 16px;
  margin-top: 10px;
  cursor: pointer;
  transition: var(--trans-smooth);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-add:hover { border-color: var(--border-active); color: var(--text-main); background: rgba(255,255,255,0.02); }

/* Right Panel: Preview A4 */
.editor-preview {
  width: 60%;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  overflow-y: auto;
}

.pages-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  align-items: center;
}

.a4-wrapper {
  /* Using exact A4 ratio mm dimensions and scaling via transform */
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
  padding: 20mm;
  transform-origin: top center;
  font-family: 'Inter', sans-serif;
  user-select: none;
  position: relative;
}

/* Page Indicator */
.page-label {
  position: absolute;
  top: 10px;
  left: 20px;
  font-size: 0.75rem;
  color: #999; /* Change to match white paper background context */
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Resume internal minimalist styles */
.cv-header { text-align: center; margin-bottom: 24px; border-bottom: 1px solid #ddd; padding-bottom: 16px; }
.cv-name { font-family: 'Playfair Display', serif; font-size: 2.5rem; color: #111; margin-bottom: 4px; line-height: 1.1; }
.cv-title { font-size: 0.9rem; color: #555; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.cv-contact { font-size: 0.8rem; color: #666; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.cv-section { margin-bottom: 24px; }
.cv-section-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; border-bottom: 1px solid #e0e0e0; margin-bottom: 16px; padding-bottom: 4px; color: #222; }
.cv-summary { font-size: 0.9rem; line-height: 1.6; color: #333; }
.cv-item { margin-bottom: 16px; }
.cv-item-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.cv-company { font-weight: 600; font-size: 1rem; color: #111; }
.cv-date { font-size: 0.85rem; color: #666; }
.cv-role { font-style: italic; font-size: 0.9rem; color: #444; margin-bottom: 6px; }
.cv-desc { font-size: 0.85rem; line-height: 1.5; color: #333; white-space: pre-wrap; }

.empty-content { color: #ccc; font-style: italic; }

/* ========================================================
   TEMPLATE: MODERN
   ======================================================== */
.a4-wrapper[data-template="modern"] { font-family: 'Inter', sans-serif; color: #1a1a24; }
.a4-wrapper[data-template="modern"] .cv-header { text-align: left; border-bottom: 2px solid #3b82f6; padding-bottom: 24px; margin-bottom: 24px; }
.a4-wrapper[data-template="modern"] .cv-name { font-weight: 700; font-size: 3rem; color: #1e3a8a; letter-spacing: -1px; }
.a4-wrapper[data-template="modern"] .cv-title { color: #3b82f6; font-weight: 600; letter-spacing: 1px; }
.a4-wrapper[data-template="modern"] .cv-contact { justify-content: flex-start; color: #64748b; }
.a4-wrapper[data-template="modern"] .cv-section-title { font-weight: 700; color: #1e3a8a; text-transform: uppercase; border-bottom: none; border-left: 4px solid #3b82f6; padding-left: 12px; margin-bottom: 20px; }
.a4-wrapper[data-template="modern"] .cv-company { color: #1e3a8a; }
.a4-wrapper[data-template="modern"] .cv-role { font-weight: 500; color: #475569; }

/* ========================================================
   TEMPLATE: BRUTALIST
   ======================================================== */
.a4-wrapper[data-template="brutalist"] { font-family: 'Courier New', Courier, monospace; color: #000; background: #fff; }
.a4-wrapper[data-template="brutalist"] .cv-header { text-align: left; border-bottom: 8px solid #000; padding-bottom: 10px; margin-bottom: 30px; }
.a4-wrapper[data-template="brutalist"] .cv-name { font-weight: 900; font-size: 3.5rem; text-transform: uppercase; margin-bottom: 0; }
.a4-wrapper[data-template="brutalist"] .cv-title { background: #000; color: #fff; display: inline-block; padding: 4px 12px; font-weight: bold; margin-bottom: 16px; letter-spacing: 0; }
.a4-wrapper[data-template="brutalist"] .cv-contact { justify-content: flex-start; font-weight: bold; color: #000; }
.a4-wrapper[data-template="brutalist"] .cv-section-title { font-weight: 900; text-transform: uppercase; border-bottom: 4px solid #000; margin-bottom: 24px; font-size: 1.5rem; }
.a4-wrapper[data-template="brutalist"] .cv-company { font-weight: 900; font-size: 1.1rem; text-transform: uppercase; }
.a4-wrapper[data-template="brutalist"] .cv-role { font-weight: bold; border: 1px solid #000; display: inline-block; padding: 2px 8px; margin-bottom: 8px; margin-top: 4px; }

/* ========================================================
   TEMPLATE: MINIMALIST
   ======================================================== */
.a4-wrapper[data-template="minimalist"] { font-family: 'Inter', sans-serif; font-weight: 300; color: #444; }
.a4-wrapper[data-template="minimalist"] .cv-header { text-align: right; border-bottom: none; padding-bottom: 40px; margin-bottom: 40px; }
.a4-wrapper[data-template="minimalist"] .cv-name { font-weight: 300; font-size: 2.5rem; letter-spacing: 4px; text-transform: lowercase; color: #222; }
.a4-wrapper[data-template="minimalist"] .cv-title { font-weight: 300; color: #888; text-transform: lowercase; letter-spacing: 2px; }
.a4-wrapper[data-template="minimalist"] .cv-contact { justify-content: flex-end; color: #aaa; font-size: 0.8rem; }
.a4-wrapper[data-template="minimalist"] .cv-section-title { font-weight: 400; text-transform: lowercase; letter-spacing: 2px; color: #aaa; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 24px; }
.a4-wrapper[data-template="minimalist"] .cv-company { font-weight: 500; color: #333; }
.a4-wrapper[data-template="minimalist"] .cv-role { color: #888; }
.a4-wrapper[data-template="minimalist"] .cv-date { color: #bbb; }

/* ========================================================
   TEMPLATE: EXECUTIVE
   ======================================================== */
.a4-wrapper[data-template="executive"] { font-family: 'Playfair Display', serif; color: #2c3e50; padding: 0; }
.a4-wrapper[data-template="executive"] > .cv-header { background: #1a252f; color: #fff; padding: 40px; text-align: center; border-bottom: 4px solid #c0392b; margin-bottom: 30px; }
.a4-wrapper[data-template="executive"] .cv-name { color: #fff; font-size: 3rem; text-transform: uppercase; letter-spacing: 2px; }
.a4-wrapper[data-template="executive"] .cv-title { color: #bdc3c7; }
.a4-wrapper[data-template="executive"] .cv-contact { color: #ecf0f1; }
.a4-wrapper[data-template="executive"] .cv-section { padding: 0 40px; margin-bottom: 30px; }
.a4-wrapper[data-template="executive"] .cv-section-title { color: #c0392b; border-bottom: 1px solid #bdc3c7; font-weight: 700; text-transform: uppercase; }
.a4-wrapper[data-template="executive"] .cv-company { font-weight: 700; color: #2c3e50; }

/* ========================================================
   TEMPLATE: TWO-COLUMN
   ======================================================== */
.a4-wrapper[data-template="twocolumn"] { display: grid; grid-template-columns: 30% 65%; gap: 0 5%; font-family: 'Inter', sans-serif; align-content: start; }
.a4-wrapper[data-template="twocolumn"] .cv-header { grid-column: 1 / -1; text-align: left; border-bottom: 2px solid #222; margin-bottom: 30px; }
.a4-wrapper[data-template="twocolumn"] .cv-contact { justify-content: flex-start; flex-direction: column; gap: 4px; margin-top: 10px; }
.a4-wrapper[data-template="twocolumn"] #sec_summary { grid-column: 2; }
.a4-wrapper[data-template="twocolumn"] #sec_experience { grid-column: 2; }
.a4-wrapper[data-template="twocolumn"] #sec_education { grid-column: 2; }
.a4-wrapper[data-template="twocolumn"] #sec_skills { grid-column: 1; grid-row: 2 / span 3; border-right: 1px solid #eee; padding-right: 20px; }
.a4-wrapper[data-template="twocolumn"] .cv-section-title { font-size: 1rem; color: #444; border-bottom: 1px solid #444; text-transform: uppercase; letter-spacing: 1px; }
.a4-wrapper[data-template="twocolumn"] .cv-name { font-size: 3rem; font-weight: 800; }

/* ========================================================
   TEMPLATE: TIMELINE
   ======================================================== */
.a4-wrapper[data-template="timeline"] { font-family: 'Inter', sans-serif; }
.a4-wrapper[data-template="timeline"] .cv-header { text-align: left; }
.a4-wrapper[data-template="timeline"] .cv-name { font-weight: 800; font-size: 3.2rem; }
.a4-wrapper[data-template="timeline"] #sec_experience .cv-item { position: relative; padding-left: 20px; border-left: 2px solid #333; margin-left: 10px; }
.a4-wrapper[data-template="timeline"] #sec_experience .cv-item::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; background: #fff; border: 2px solid #333; border-radius: 50%; }
.a4-wrapper[data-template="timeline"] .cv-section-title { font-weight: 800; }

/* ========================================================
   TEMPLATE: PROFILE-CLASSIC
   ======================================================== */
.a4-wrapper[data-template="profile-classic"] { font-family: 'Playfair Display', serif; }
.a4-wrapper[data-template="profile-classic"] .cv-header { position: relative; text-align: left; min-height: 120px; padding-right: 140px; }
.a4-wrapper[data-template="profile-classic"] .cv-contact { justify-content: flex-start; }
.a4-wrapper[data-template="profile-classic"] .cv-profile-img { position: absolute; right: 0; top: 0; width: 120px; height: 120px; border-radius: 50%; object-fit: cover; display: block !important; border: 4px solid #eee; }

/* ========================================================
   TEMPLATE: PROFILE-MODERN
   ======================================================== */
.a4-wrapper[data-template="profile-modern"] { padding: 0; display: grid; grid-template-columns: 35% 65%; font-family: 'Inter', sans-serif; min-height: 100%; align-content: start; }
.a4-wrapper[data-template="profile-modern"] > .cv-header { display: contents; }
.a4-wrapper[data-template="profile-modern"] .cv-name { grid-column: 2; grid-row: 1; padding: 40px 40px 0 40px; font-size: 2.8rem; font-weight: 800; color: #111; margin-bottom: 0; }
.a4-wrapper[data-template="profile-modern"] .cv-title { grid-column: 2; grid-row: 2; padding: 0 40px; color: #0d9488; font-weight: 600; letter-spacing: 2px; margin-bottom: 20px; }
.a4-wrapper[data-template="profile-modern"] .sidebar-wrap { grid-column: 1; grid-row: 1 / span 6; background: #0f172a; color: #cbd5e1; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; }
.a4-wrapper[data-template="profile-modern"] .cv-contact { flex-direction: column; gap: 12px; margin-top: 30px; font-size: 0.85rem; color: #cbd5e1; text-align: center; }
.a4-wrapper[data-template="profile-modern"] .cv-profile-img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; display: block !important; border: 4px solid #334155; margin-bottom: 20px; }
.a4-wrapper[data-template="profile-modern"] .cv-section { padding: 0 40px; grid-column: 2; }
.a4-wrapper[data-template="profile-modern"] .cv-section-title { color: #0d9488; border-bottom: 2px solid #e2e8f0; font-weight: 700; text-transform: uppercase; }
.a4-wrapper[data-template="profile-modern"] #sec_skills { grid-column: 1; padding: 0; margin-top: 40px; width: 100%; text-align: center; }
.a4-wrapper[data-template="profile-modern"] #sec_skills .cv-section-title { color: #fff; border-bottom-color: #334155; }
.a4-wrapper[data-template="profile-modern"] .cv-company { color: #0f172a; }

/* ========================================================
   TEMPLATE: PROFILE-BOLD
   ======================================================== */
.a4-wrapper[data-template="profile-bold"] { font-family: 'Inter', sans-serif; display: grid; grid-template-columns: 180px 1fr; gap: 30px; align-content: start; }
.a4-wrapper[data-template="profile-bold"] .cv-header { display: contents; }
.a4-wrapper[data-template="profile-bold"] .cv-profile-img { grid-column: 1; grid-row: 1; width: 180px; height: 180px; object-fit: cover; display: block !important; filter: grayscale(100%); border-radius: 8px; }
.a4-wrapper[data-template="profile-bold"] .cv-name { grid-column: 2; grid-row: 1; font-weight: 900; font-size: 4rem; line-height: 1; text-transform: uppercase; letter-spacing: -2px; align-self: end; }
.a4-wrapper[data-template="profile-bold"] .cv-title { grid-column: 2; grid-row: 2; font-weight: 800; font-size: 1.2rem; color: #e11d48; margin-bottom: 10px; }
.a4-wrapper[data-template="profile-bold"] .cv-contact { grid-column: 2; grid-row: 3; justify-content: flex-start; color: #555; margin-bottom: 30px; }
.a4-wrapper[data-template="profile-bold"] .cv-section { grid-column: 1 / -1; }
.a4-wrapper[data-template="profile-bold"] .cv-section-title { font-weight: 900; font-size: 1.5rem; text-transform: uppercase; border-bottom: 4px solid #111; }
.a4-wrapper[data-template="profile-bold"] .cv-company { font-weight: 800; font-size: 1.1rem; }

/* Delete Page Button */
.btn-delete-page {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 0, 0, 0.1);
  color: #ff4444;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  z-index: 10;
}
.btn-delete-page:hover { background: #ff4444; color: #fff; }

/* Floating Menu for Mobile Actions */
.add-page-menu {
  position: fixed;
  bottom: 130px; /* Above the pill */
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 85;
}
.add-page-menu.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.add-page-menu button {
  background: transparent;
  border: none;
  color: #fff;
  padding: 10px 20px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
}
.add-page-menu button:hover {
  background: rgba(255,255,255,0.05);
}

/* Upload area inside attachment page */
.attachment-upload-area {
  width: 100%;
  height: 100%;
  min-height: 200mm; /* A bit smaller than full A4 inside the padding */
  border: 2px dashed #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  cursor: pointer;
  background: rgba(0,0,0,0.02);
  transition: 0.3s;
}

.attachment-upload-area:hover {
  border-color: #aaa;
  background: rgba(0,0,0,0.05);
}

.attachment-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

/* Page Control Buttons */
.page-controls {
  margin-top: 20px;
  margin-bottom: 60px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}


/* Mobile Logic - Bottom Nav and Modes */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 75px;
  background: rgba(10, 10, 10, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;
  backdrop-filter: blur(15px);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-tab {
  flex: 1; 
  display: flex; flex-direction: column; 
  align-items: center; justify-content: center;
  background: transparent; border: none; 
  color: var(--text-mut); cursor: pointer; 
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; 
  letter-spacing: 1px; gap: 4px;
  transition: var(--trans-smooth);
}
.nav-tab.active { color: #fff; }
.nav-tab.active i { background: rgba(255,255,255,0.1); border-radius: 20px; padding: 4px 16px; }
.nav-tab i { width: 18px; height: 18px; transition: var(--trans-smooth); margin-bottom: 2px; }

/* Sticky bottom actions (Form) */
.mobile-form-action {
  display: none;
}

/* Sticky top/bottom actions (Preview) */
.mobile-preview-actions {
  display: none;
}

@media (max-width: 900px) {
  .hidden-mobile { display: none !important; }
  .mobile-only-spacer { display: block !important; }

  .editor-layout { flex-direction: column; }
  .mobile-bottom-nav { display: flex; }
  
  .editor-sidebar { 
    width: 100%; border-right: none; 
    display: none; 
    padding: 24px 20px 0;
  }
  .editor-sidebar.active-tab { display: block; }
  
  .editor-preview { 
    width: 100%;
    padding: 20px;
    display: none; 
  }
  .editor-preview.active-tab { display: flex; }

  .mobile-preview-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: 95px; /* Above the 75px bottom nav */
    left: 50%;
    transform: translateX(-50%);
    z-index: 90;
    pointer-events: auto;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(20px);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    width: max-content;
  }

  .mobile-preview-actions .btn {
    pointer-events: auto;
    box-shadow: none;
    margin: 0;
    border-radius: 50px !important;
    border: none !important;
    font-weight: 600;
    letter-spacing: 0.5px;
  }
  
  .mobile-preview-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }

  .mobile-preview-actions .btn-primary {
    background: #fff !important;
    color: #000 !important;
  }
  
  .editor-topbar { padding: 0 16px; justify-content: space-between; }
  .app-title-input { width: 100%; max-width: 200px; }
  
  .pages-container {
    padding-bottom: 0;
  }

  .a4-wrapper {
    margin: 0 auto; /* Center horizontally */
  }

  /* Desktop specific page controls hide on mobile if replaced by floaters */
  .desktop-page-controls {
    display: none;
  }
}

.mobile-only-spacer { display: none; }

/* ========================================================
   LANDING PAGE STYLES (index.php)
   ======================================================== */

.glow-bg {
  position: fixed;
  top: -20%; left: -10%;
  width: 120vw; height: 120vh;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  background: rgba(3, 3, 3, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.huge-title {
  font-size: 5.5rem;
  line-height: 1.05;
  margin-bottom: 24px;
  color: #fff;
}

.hero-subtext {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-mut);
  margin-bottom: 40px;
  max-width: 480px;
}

.cta-group {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.btn-arrow {
  display: inline-block;
  margin-left: 8px;
  transition: transform 0.3s;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

.note-text {
  font-size: 0.85rem;
  color: #666;
}

.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-visual::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 120%; height: 120%;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  z-index: -1;
}

.a4-preview {
  width: 300px;
  height: 424px;
  background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  transform: rotate(2deg);
  transition: transform 0.5s ease;
}

.a4-preview:hover {
  transform: rotate(0deg) scale(1.02);
}

.section {
  padding: 120px 0;
  border-top: 1px solid var(--border-color);
}

.section-header {
  text-align: center;
  margin-bottom: 80px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: #fff;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-mut);
}

.steps-grid, .features-grid, .templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.step-card {
  background: rgba(20,20,20,0.4);
  border: 1px solid var(--border-color);
  padding: 40px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s;
}

.step-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255,255,255,0.2);
}

.step-no {
  position: absolute;
  top: -20px;
  right: -10px;
  font-size: 8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.02);
  pointer-events: none;
}

.step-icon {
  color: #fff;
  margin-bottom: 24px;
}

.step-card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #fff;
}

.feature-item {
  padding: 20px 0;
}

.feat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #666;
  margin-bottom: 12px;
}

.feat-title {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 12px;
}

.template-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,0.5);
  transition: all 0.3s;
}

.template-card:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-4px);
}

.template-preview {
  height: 280px;
  background: #0a0a0a;
  padding: 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.template-meta {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template-meta h3 {
  font-size: 1.25rem;
  margin: 0;
}

.footer {
  padding: 80px 0 40px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  background: rgba(0,0,0,0.8);
}

/* Responsive Landing Page */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .huge-title {
    font-size: 4rem;
  }
  .hero-subtext {
    margin: 0 auto 32px;
  }
  .cta-group {
    justify-content: center;
  }
  .steps-grid, .features-grid, .templates-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Editor Modern Tabs */
.editor-tabs-container {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    padding: 0 20px;
    background: transparent;
    gap: 20px;
}

.editor-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-mut);
    padding: 15px 0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--trans-smooth);
    white-space: nowrap;
    position: relative;
    top: 1px;
}

.editor-tab-btn.active {
    color: var(--text-main);
    border-bottom-color: var(--text-main);
}

.editor-tab-btn:hover:not(.active) {
    color: #fff;
}
