/* ============================================================
   styles.css — BioGen Premium UI  |  Maroon & Gold Edition
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Tiro+Bangla:ital@0;1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Brand */
  --maroon-900: #2d060e;
  --maroon-800: #5c0f1e;
  --maroon-700: #7f1d1d;
  --maroon-600: #991b1b;
  --maroon-100: #fee2e2;
  --gold:        #d4af37;
  --gold-light:  #f0d060;
  --gold-dark:   #b8860b;
  --gold-muted:  rgba(212,175,55,0.15);

  /* Neutrals */
  --cream-50:  #fdf8f3;
  --cream-100: #f5f0e6;
  --cream-200: #ede8d8;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --white:     #ffffff;

  /* Semantic */
  --bg-body:      linear-gradient(145deg, #2d060e 0%, #7f1d1d 35%, #f5f0e6 100%);
  --bg-card:      #ffffff;
  --border:       #e5e7eb;
  --border-focus: var(--gold);
  --text-primary: var(--slate-900);
  --text-muted:   var(--slate-500);

  /* Effects */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-gold: 0 0 0 3px rgba(212,175,55,0.20);
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-pill: 999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 250ms var(--ease);
  --t-slow: 400ms var(--ease);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

/* ── Body ── */
body {
  font-family: 'Inter', 'Nunito', 'Tiro Bangla', 'Noto Sans Bengali', 'SolaimanLipi', 'Vrinda', 'Nirmala UI', 'Segoe UI', sans-serif;
  background: linear-gradient(145deg, #2d060e 0%, #7f1d1d 35%, #e8dcc8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

.bn {
  font-family: 'Tiro Bangla', 'Noto Sans Bengali', 'SolaimanLipi', 'Vrinda', sans-serif;
}

/* ── App Container ── */
.container {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ════════════════════════════════════════════
   HEADER / TOPBAR
════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--maroon-900) 0%, var(--maroon-800) 50%, var(--maroon-700) 100%);
  color: #fff;
  border-bottom: 2px solid rgba(212,175,55,0.35);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25), 0 1px 0 rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(12px);
}

.topbar-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 14px 5%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  transition: transform var(--t-base);
}
.brand:hover { transform: scale(1.03); }

.brand-logo-svg {
  width: 34px;
  height: 34px;
  fill: var(--gold);
  filter: drop-shadow(0 2px 6px rgba(212,175,55,0.4));
  transition: filter var(--t-base);
}
.brand:hover .brand-logo-svg {
  filter: drop-shadow(0 3px 10px rgba(212,175,55,0.7));
}

.brand-name {
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-main {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(to right, #ffffff 0%, #ffe8b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.3px;
}
.brand-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.9;
}

/* Nav Links */
.nav-links {
  display: inline-flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  transition: all var(--t-base);
  font-weight: 600;
  font-size: 13.5px;
  border: 1.5px solid transparent;
  position: relative;
  letter-spacing: 0.2px;
}
.nav-link:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border-color: rgba(255,255,255,0.12);
}
.nav-link.active {
  background: rgba(212,175,55,0.18);
  color: #fff;
  border-color: rgba(212,175,55,0.45);
  box-shadow: 0 2px 12px rgba(212,175,55,0.12);
}

/* Nav Right */
.nav-right {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

/* Status Pill */
.status-pill {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
  padding: 4px 13px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid rgba(255,255,255,0.12);
  letter-spacing: 0.3px;
}
.status-pill::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}
.status-pill.ok {
  background: rgba(16,185,129,0.12);
  color: #6ee7b7;
  border-color: rgba(16,185,129,0.25);
}
.status-pill.ok::before {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2), 0 0 8px rgba(16,185,129,0.5);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.2), 0 0 8px rgba(16,185,129,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(16,185,129,0.08), 0 0 14px rgba(16,185,129,0.6); }
}

/* Ghost Buttons in Nav */
.btn-ghost,
.btn-primary-ghost {
  color: #fff;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(212,175,55,0.35);
  background: rgba(212,175,55,0.06);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--t-base);
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.btn-ghost:hover,
.btn-primary-ghost:hover {
  background: rgba(212,175,55,0.22);
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(212,175,55,0.18);
  color: #fff;
}

/* Hamburger Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  line-height: 0;
}
.nav-toggle:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.25);
}

/* ════════════════════════════════════════════
   MAIN CONTENT CARDS
════════════════════════════════════════════ */
.main-content,
.admin-container,
.settings-container,
.view-section {
  max-width: 1420px;
  margin: 28px auto;
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 95%;
  flex-grow: 1;
  border: 1px solid rgba(255,255,255,0.6);
  animation: fadeUp 0.35s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Form Section */
.form-section {
  background: var(--cream-50);
  padding: 28px;
  border-radius: var(--radius-md);
  border-left: 5px solid var(--gold);
  width: 100%;
  max-width: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* Section Title */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--maroon-700);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.2px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(to bottom, var(--gold), var(--gold-dark));
  border-radius: 3px;
  flex-shrink: 0;
}

/* Preview Section */
.preview-section { display: none; }

/* ════════════════════════════════════════════
   FORM SECTION BLOCKS
════════════════════════════════════════════ */
.personal-info-section,
.education-section,
.professional-section,
.experience-section,
.custom-fields-section {
  margin-bottom: 24px;
  padding: 22px 24px;
  background: var(--white);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--maroon-700);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base);
  position: relative;
}
.personal-info-section:hover,
.education-section:hover,
.professional-section:hover,
.experience-section:hover {
  box-shadow: var(--shadow-md);
}

.education-section    { border-left-color: var(--gold-dark); }
.professional-section { border-left-color: #0891b2; }
.experience-section   { border-left-color: #059669; }
.custom-fields-section{ border-left-color: #7c3aed; }

/* Section headings within blocks */
.personal-info-section h3,
.education-section h3,
.professional-section h3,
.experience-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--maroon-700);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.education-section h3    { color: var(--gold-dark); }
.professional-section h3 { color: #0e7490; }
.experience-section h3   { color: #047857; }

.custom-fields-section h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #5b21b6;
  margin-bottom: 14px;
}

/* Compact form tweaks */
.personal-info-section .form-group,
.education-section .form-group,
.professional-section .form-group,
.experience-section .form-group { margin-bottom: 14px; }

/* ════════════════════════════════════════════
   FORM ELEMENTS
════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  color: var(--slate-700);
  font-size: 13px;
  letter-spacing: 0.2px;
  transition: color var(--t-fast);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  color: var(--slate-900);
  background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

/* Restore number input spinners (removed by appearance:none in some browsers) */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: inner-spin-button;
  opacity: 1;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  background: #fffef8;
}

.form-group:focus-within label {
  color: var(--gold-dark);
}

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

/* Form Control (inline tables / rows) */
.form-control {
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--slate-900);
  background: #fff;
  width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

/* ── Education table inputs: compact, square-ish, no heavy radius ── */
.form-edu-table td input,
.form-edu-table td select,
.form-edu-table td textarea {
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  background: #fff;
  -webkit-appearance: auto;
  appearance: auto;
  width: 100%;
  min-width: 0;
}
.form-edu-table td input:focus,
.form-edu-table td select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.18);
  outline: none;
}
/* Restore number spinners inside table */
.form-edu-table td input[type="number"]::-webkit-inner-spin-button,
.form-edu-table td input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: inner-spin-button;
  opacity: 1;
}

/* Select2 */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  height: 42px;
  display: flex;
  align-items: center;
}
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

/* ── Photo Upload ── */
.photo-upload-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base);
}
.photo-upload-card:hover { box-shadow: var(--shadow-md); }

.photo-upload-thumb {
  width: 130px;
  height: 182px;
  border-radius: 10px;
  border: 2px solid var(--slate-300);
  background: var(--slate-100);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-base);
}
.photo-upload-thumb:hover { border-color: var(--gold); }
.photo-upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-upload-body { display: flex; flex-direction: column; gap: 12px; }

.photo-dropzone {
  border: 2px dashed rgba(212,175,55,0.5);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(135deg, var(--cream-50), var(--cream-100));
  cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-fast);
}
.photo-dropzone:hover {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fdf6e8, #f7f2d8);
  transform: translateY(-1px);
}
.photo-dropzone.highlight {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fdf0c8, #f7e898);
  box-shadow: var(--shadow-gold);
}

.photo-upload-help { font-size: 12px; color: var(--slate-500); }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-ghost-blue {
  background: var(--cream-100);
  color: var(--maroon-700);
  border: 1.5px solid rgba(212,175,55,0.4);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-base);
}
.btn-ghost-blue:hover {
  background: var(--cream-200);
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(212,175,55,0.2);
}

/* File Input */
.file-input {
  border: 2px dashed rgba(212,175,55,0.5);
  padding: 24px;
  text-align: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-base);
  background: var(--cream-50);
}
.file-input:hover {
  background: var(--cream-100);
  border-color: var(--gold);
}

/* ════════════════════════════════════════════
   DYNAMIC ROWS (Education / Professional etc.)
════════════════════════════════════════════ */
.education-row,
.professional-row,
.experience-row,
.personal-field-row {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}
.education-row    { grid-template-columns: repeat(6, 1fr) auto; }
.professional-row { grid-template-columns: 1fr 1fr 1fr 1fr auto; }
.experience-row   { grid-template-columns: 1.2fr 1fr 1fr 0.9fr 0.9fr 1fr 1fr auto; }
.personal-field-row { grid-template-columns: 1fr 1fr auto; }

table .education-row { display: table-row; }

/* Education Table */
.form-edu-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.form-edu-table th {
  background: linear-gradient(135deg, var(--maroon-700), var(--maroon-800));
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 11px 10px;
  text-align: left;
  letter-spacing: 0.3px;
  border-bottom: 2px solid rgba(212,175,55,0.3);
}
.form-edu-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  vertical-align: middle;
}
.form-edu-table tr:last-child td { border-bottom: none; }
.form-edu-table tr:hover td { background: #fdfaf5; }

/* ════════════════════════════════════════════
   DRAG AND DROP (Sortable)
════════════════════════════════════════════ */
.drag-handle {
  cursor: grab;
  color: #94a3b8;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  user-select: none;
  vertical-align: middle;
  padding: 8px 0 8px 8px !important;
  width: 30px;
}
.drag-handle:active {
  cursor: grabbing;
  color: var(--maroon-700);
}
.sortable-ghost {
  opacity: 0.6;
  background-color: #f1f5f9 !important;
}
.sortable-ghost td {
  background-color: #f1f5f9 !important;
}

/* ════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════ */
.btn {
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  transition: all var(--t-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--maroon-700) 0%, var(--maroon-800) 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(127,29,29,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--maroon-600) 0%, var(--maroon-700) 100%);
  box-shadow: 0 8px 24px rgba(127,29,29,0.35);
}

.btn-secondary {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(71,85,105,0.25);
}
.btn-secondary:hover {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  box-shadow: 0 8px 24px rgba(71,85,105,0.30);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(5,150,105,0.3);
}
.btn-success:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 8px 24px rgba(5,150,105,0.35);
}

.btn-info {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--maroon-900);
  box-shadow: 0 3px 10px rgba(212,175,55,0.30);
}
.btn-info:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: 0 8px 24px rgba(212,175,55,0.38);
}

.btn-add {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  padding: 7px 15px;
  font-size: 12.5px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(5,150,105,0.2);
}
.btn-add:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 6px 18px rgba(5,150,105,0.30);
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f8fafc;
  color: var(--maroon-700);
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.preset-chip:hover {
  background-color: #f1f5f9;
  border-color: var(--maroon-500);
  color: var(--maroon-900);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.08);
}
.preset-chip:active {
  transform: translateY(0);
}

.btn-remove {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  padding: 6px 13px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: all var(--t-base);
  white-space: nowrap;
}
.btn-remove:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  box-shadow: 0 6px 18px rgba(220,38,38,0.30);
  transform: translateY(-1px);
}

/* Smaller btn inside section */
.btn { padding: 9px 18px; }
.form-actions .btn { padding: 13px 28px; font-size: 15px; }

/* ════════════════════════════════════════════
   FORM ACTIONS BAR
════════════════════════════════════════════ */
.form-actions {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ════════════════════════════════════════════
   VIEW / BIODATA DISPLAY PAGE
════════════════════════════════════════════ */
.action-buttons {
  margin: 0 0 20px;
  background: linear-gradient(135deg, var(--cream-50), var(--white));
  padding: 18px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(212,175,55,0.2);
}
.action-buttons .btn { margin: 3px; }
.action-buttons .btn:hover { transform: translateY(-2px); }

/* Biodata Display */
.biodata-display {
  background: white;
  padding: 28px;
  margin: 20px auto;
  max-width: 800px;
  box-shadow: 0 0 28px rgba(0,0,0,0.10);
  font-family: 'Times New Roman', Times, serif;
  font-size: 12pt;
  line-height: 1.45;
  position: relative;
  color: #000;
  border: 1px solid #888;
  border-radius: 4px;
}
.biodata-header {
  text-align: center;
  font-size: 18pt;
  font-weight: bold;
  margin-bottom: 20px;
  text-decoration: underline;
  letter-spacing: 2px;
}
.biodata-content { position: relative; }
.personal-section { position: relative; margin-bottom: 20px; }
.photo-section {
  position: absolute;
  right: 0;
  top: 50px;
  width: 115px;
  text-align: center;
  border: 1px solid #000;
  padding: 2px;
}
.photo-section img {
  width: 100%;
  height: auto;
  aspect-ratio: 25 / 35;
  object-fit: cover;
  display: block;
}
.respect-text { margin-bottom: 15px; font-size: 12pt; }
.respect-text p { margin: 5px 0; }
.info-table {
  width: calc(100% - 130px);
  margin-bottom: 20px;
  font-size: 12pt;
}
.info-table td { padding: 2px 0; vertical-align: top; }
.info-label { font-weight: bold; width: 170px; text-transform: uppercase; }
.info-table td:nth-child(2) { width: 15px; text-align: center; }
.section-header {
  font-weight: bold;
  font-size: 14pt;
  margin: 20px 0 10px;
  text-decoration: underline;
  text-align: center;
  clear: both;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
  font-size: 11pt;
}
.data-table th, .data-table td {
  border: 1px solid #000;
  padding: 4px;
  text-align: center;
  vertical-align: middle;
}
.data-table th { background-color: #f0f0f0; font-weight: bold; }
/* form-edu-table has both .form-edu-table AND .data-table — keep form's maroon header */
.form-edu-table.data-table th {
  background: linear-gradient(135deg, var(--maroon-700), var(--maroon-800)) !important;
  color: #fff;
  border: none;
}
.form-edu-table.data-table td {
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 6px;
}
.declaration {
  margin-top: 25px;
  margin-bottom: 20px;
  font-size: 11pt;
  text-align: justify;
}
.signature-section { margin-top: 40px; clear: both; }
.signature-row { display: flex; justify-content: space-between; align-items: flex-end; }
.date-place div { margin-bottom: 10px; }
.signature { text-align: center; margin-right: 30px; }
.signature div:first-child { border-top: 1px solid #000; padding-top: 5px; }

/* Search Results Table */
.search-results-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.search-results-table th {
  background: linear-gradient(135deg, var(--maroon-700), var(--maroon-800));
  color: #fff;
  font-weight: 700;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 2px solid rgba(212,175,55,0.35);
  font-size: 13.5px;
  letter-spacing: 0.3px;
}
.search-results-table td {
  padding: 13px 18px;
  border-bottom: 1px solid #eef0f4;
  color: var(--slate-700);
  font-size: 14px;
  background: #fff;
  transition: background var(--t-fast);
}
.search-results-table tr:hover td { background: var(--cream-50); }
.search-results-table tr:last-child td { border-bottom: none; }

/* ════════════════════════════════════════════
   MODALS
════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0;
  overflow: auto;
  background: rgba(15,23,42,0.65);
  backdrop-filter: blur(4px);
  animation: fadeIn var(--t-base) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content-large {
  background: var(--white);
  margin: 3% auto;
  padding: 0;
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 920px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25), 0 8px 24px rgba(0,0,0,0.12);
  animation: slideDown var(--t-slow) var(--ease) both;
  overflow: hidden;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--cream-50), var(--white));
}
.modal-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--maroon-700);
  font-weight: 700;
}

.close {
  color: var(--slate-500);
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: color var(--t-fast), transform var(--t-fast);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.close:hover {
  color: var(--maroon-700);
  background: var(--cream-100);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px 28px;
  max-height: 72vh;
  overflow-y: auto;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: var(--slate-100); }
.modal-body::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }

.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--cream-50);
}

#biodata-preview .biodata-display {
  margin: 0;
  box-shadow: none;
  max-width: 100%;
  min-height: auto;
  font-size: 10pt;
}

/* ════════════════════════════════════════════
   ALERT MESSAGES
════════════════════════════════════════════ */
.alert {
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
  animation: fadeUp 0.25s var(--ease) both;
}
.alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.alert-error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* ════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════ */
.footer-new {
  background: linear-gradient(180deg, #0c1220 0%, #090d16 100%);
  color: #94a3b8;
  margin-top: auto;
  border-top: 3px solid rgba(212,175,55,0.35);
  font-family: 'Inter', 'Nunito', sans-serif;
  padding: 48px 24px 24px;
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.footer-col h4 {
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
  font-family: 'Playfair Display', serif;
}
.footer-col h5 {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
}
.footer-col p {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: #94a3b8;
}
.footer-col small { color: #64748b; font-size: 12px; }

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13.5px;
  transition: color var(--t-fast), padding-left var(--t-base);
  display: inline-block;
  position: relative;
}
.footer-col ul li a::before {
  content: '›';
  margin-right: 6px;
  color: var(--gold);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.footer-col ul li a:hover {
  color: #e2e8f0;
  padding-left: 8px;
}
.footer-col ul li a:hover::before { opacity: 1; }

.footer-bottom {
  max-width: 1400px;
  margin: 24px auto 0;
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom small { color: #475569; font-size: 12.5px; }
.footer-bottom-links a {
  color: #475569;
  text-decoration: none;
  font-size: 12.5px;
  margin-left: 18px;
  transition: color var(--t-fast);
}
.footer-bottom-links a:hover { color: var(--gold); }

/* ════════════════════════════════════════════
   BIODATA TEMPLATE PREVIEWS (on-screen)
════════════════════════════════════════════ */
.tpl-elegant .biodata-header {
  border-bottom: 3px solid #2c3e50;
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.tpl-elegant .photo-section { float: left; margin: 0 12px 10px 0; }
.tpl-elegant .elg-layout { display: grid; grid-template-columns: 28% 1fr; gap: 12px; }
.tpl-elegant .elg-left {
  background: var(--slate-100);
  border: 1px solid var(--slate-300);
  padding: 10px;
  border-radius: 6px;
}
.tpl-elegant .elg-left .photo { width: 130px; height: 160px; border: 1px solid #000; margin: 0 auto 8px; }
.tpl-elegant .elg-left .photo img { width: 130px; height: 160px; object-fit: cover; }
.tpl-elegant .elg-chip  { display: block; margin: 2px 0; font-size: 10.5pt; }
.tpl-elegant .elg-name  { font-size: 18pt; font-weight: 700; letter-spacing: 1px; margin-bottom: 6px; }

.tpl-vibrant .biodata-header {
  background: linear-gradient(90deg, #0ea5e9, #22c55e);
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
}
.tpl-vibrant { position: relative; }
.tpl-vibrant .photo-section {
  position: absolute; right: 12px; top: 70px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.tpl-vibrant .chip {
  display: inline-block;
  background: var(--cream-100);
  border: 1px solid var(--cream-200);
  color: var(--maroon-800);
  border-radius: 14px;
  padding: 2px 8px;
  margin: 2px 4px;
  font-size: 10pt;
}
.tpl-vibrant .v-section {
  border-left: 4px solid var(--gold);
  padding-left: 8px;
  margin-top: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.tpl-vibrant .data-table th { background: var(--gold); color: var(--maroon-800); }

.tpl-professional .pro-banner {
  background: linear-gradient(90deg, var(--maroon-800), var(--maroon-700));
  color: #fff;
  padding: 12px 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tpl-professional .pro-photo { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; background: #fff; }
.tpl-professional .pro-photo img { width: 80px; height: 80px; object-fit: cover; }
.tpl-professional .pro-name  { font-size: 20pt; font-weight: 800; letter-spacing: 1px; }
.tpl-professional .pro-role  { font-size: 11pt; opacity: .9; }
.tpl-professional .pro-grid  { display: grid; grid-template-columns: 30% 1fr; gap: 14px; margin-top: 12px; }
.tpl-professional .pro-left  { background: var(--cream-100); border: 1px solid var(--cream-200); border-radius: 6px; padding: 10px; }
.tpl-professional .pro-section-title {
  color: var(--slate-900);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11pt;
  border-left: 4px solid var(--gold);
  padding-left: 6px;
  margin: 10px 0 6px;
}
.tpl-professional .pro-chip    { display: block; margin: 2px 0; font-size: 10.5pt; }
.tpl-professional .pro-right   { border-left: 3px solid var(--border); padding-left: 12px; }
.tpl-professional .pro-bullets { list-style: none; padding-left: 0; }
.tpl-professional .pro-bullets li { position: relative; padding-left: 14px; margin: 4px 0; }
.tpl-professional .pro-bullets li::before {
  content: '';
  width: 7px; height: 7px;
  background: #10b981;
  border-radius: 50%;
  position: absolute;
  left: 0; top: 7px;
}
.tpl-professional .biodata-header {
  background: linear-gradient(90deg, var(--maroon-800), var(--maroon-700));
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
}
.tpl-professional .photo-section {
  position: absolute; right: 12px; top: 70px;
  width: 90px; height: 90px;
  border-radius: 50%; overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.tpl-professional .photo-section img { width: 100%; height: 100%; object-fit: cover; }
.tpl-professional .section-header { border-left: 4px solid var(--gold); padding-left: 8px; }

.sample-resume { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.sample-header { background: linear-gradient(135deg, var(--maroon-800), var(--gold)); color: #fff; padding: 14px; display: flex; align-items: center; gap: 12px; }
.sample-header .ph { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; }
.sample-header .ph img { width: 80px; height: 80px; object-fit: cover; }
.sample-header .nm { font-size: 20pt; font-weight: 800; letter-spacing: 1px; }
.sample-header .rl { font-size: 11pt; opacity: .95; }
.sample-grid   { display: grid; grid-template-columns: 32% 1fr; gap: 14px; padding: 14px; }
.sample-left   { border-right: 2px solid var(--border); padding-right: 12px; }
.sample-section{ font-weight: 800; text-transform: uppercase; color: var(--slate-900); font-size: 11pt; margin: 10px 0 6px; }
.sample-chip   { display: block; margin: 2px 0; font-size: 10.5pt; }
.sample-right .section-header { text-align: left; border-left: 4px solid var(--gold); padding-left: 8px; }

.tpl-creative .cr-banner { background: linear-gradient(135deg, var(--maroon-800), var(--gold)); color: #fff; padding: 14px; border-radius: 8px; display: flex; align-items: center; gap: 12px; }
.tpl-creative .cr-name   { font-size: 20pt; font-weight: 800; letter-spacing: 1px; }
.tpl-creative .cr-role   { font-size: 11pt; opacity: .95; }
.tpl-creative .cr-photo  { width: 80px; height: 80px; border-radius: 12px; overflow: hidden; border: 3px solid #fff; }
.tpl-creative .cr-photo img { width: 80px; height: 80px; object-fit: cover; }
.tpl-creative .cr-grid   { display: grid; grid-template-columns: 32% 1fr; gap: 14px; margin-top: 12px; }
.tpl-creative .cr-left   { background: var(--slate-100); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.tpl-creative .cr-title  { color: var(--slate-900); font-weight: 800; text-transform: uppercase; font-size: 11pt; border-bottom: 2px solid var(--border); padding-bottom: 4px; margin: 8px 0; }
.tpl-creative .cr-chip   { display: block; margin: 2px 0; font-size: 10.5pt; }
.tpl-creative .cr-right .section-header { text-align: left; border-left: 4px solid var(--gold); padding-left: 8px; }

/* Current Photo Display */
.current-photo { margin-bottom: 14px; text-align: left; }
.current-photo img { border-radius: 8px; box-shadow: var(--shadow-sm); width: 100px; height: auto; }

/* ════════════════════════════════════════════
   PRESET CHIP BUTTONS (inside form sections)
════════════════════════════════════════════ */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */

/* 1200px */
@media (max-width: 1200px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

/* 1024px */
@media (max-width: 1024px) {
  .topbar-inner { padding: 12px 4%; gap: 16px; }
  .main-content,
  .admin-container,
  .settings-container,
  .view-section { width: 97%; padding: 24px; }
}

/* 768px */
@media (max-width: 768px) {
  .topbar-inner {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, var(--maroon-900), var(--maroon-800));
    border-bottom: 2px solid rgba(212,175,55,0.35);
    padding: 20px;
    gap: 8px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.35);
    z-index: 999;
  }
  .nav-links.show { display: flex; }
  .nav-link { width: 100%; border-radius: var(--radius-sm); text-align: left; }
  .nav-right > .status-pill,
  .nav-right > .btn-ghost,
  .nav-right > .btn-primary-ghost { display: none; }
  .nav-links .mobile-only-actions { display: block !important; }

  .main-content,
  .admin-container,
  .settings-container,
  .view-section { width: 98%; padding: 18px; border-radius: var(--radius-md); margin: 14px auto; }

  .form-section { padding: 18px; }

  .form-row,
  .professional-row,
  .personal-field-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .education-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .experience-row { grid-template-columns: 1fr; }

  .photo-upload-card { grid-template-columns: 1fr; }
  .photo-upload-thumb { width: 100%; height: 140px; }

  .form-edu-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-new  { padding: 36px 20px 20px; }

  .action-buttons { padding: 14px 16px; }
}

/* 480px */
@media (max-width: 480px) {
  .topbar-inner { padding: 10px 4%; }
  .brand-main   { font-size: 18px; }
  .brand-sub    { display: none; }

  .main-content,
  .admin-container,
  .settings-container { padding: 14px; }

  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; justify-content: center; }

  .search-results-table { display: block; overflow-x: auto; }

  .modal-content-large { width: 98%; margin: 2% auto; }
  .modal-header, .modal-body, .modal-footer { padding: 16px 18px; }

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

/* ════════════════════════════════════════════
   PRINT STYLES
════════════════════════════════════════════ */
@media print {
  body {
    background: white !important;
    color: #000;
    margin: 0;
    padding: 0;
    font-size: 11pt;
  }
  .container {
    box-shadow: none;
    max-width: none;
    width: 100%;
    background: white;
    margin: 0;
    padding: 0;
  }
  .topbar, .footer-new, .action-buttons,
  .form-section, .main-content, .modal,
  .btn-remove, .nav-toggle { display: none !important; }

  .view-section {
    display: block !important;
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
    margin: 0;
    width: 100%;
  }
  .biodata-display {
    margin: 0 auto;
    padding: 1cm;
    box-shadow: none;
    width: 100%;
    border: 1px solid #000;
    font-family: 'Times New Roman', Times, serif;
    border-radius: 0;
  }
  .biodata-header { font-size: 16pt; margin-bottom: 15px; }
  .section-header { font-size: 12pt; margin: 15px 0 8px; }
  .respect-text  { font-size: 11pt; }
  .info-table    { font-size: 11pt; }
  .data-table    { font-size: 10pt; }
  .data-table th, .data-table td { padding: 3px; }
  .declaration   { font-size: 10pt; margin-top: 15px; }
  .signature-section { margin-top: 25px; page-break-inside: avoid; }
  .photo-section { border: 1px solid #000 !important; }

  @page {
    size: A4;
    margin: 20mm;
  }
}
