/* =============================================================
   PigeonPed - Main Stylesheet
   Premium Racing Pigeon Pedigree Management System
   ============================================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700&display=swap');

/* CSS Variables */
:root {
  --primary: #1a56db;
  --primary-dark: #1341a8;
  --primary-light: #e8f0fe;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;

  /* Neutral (Light Theme) */
  --bg: #f8fafc;
  --bg-2: #f1f5f9;
  --bg-3: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  /* Sizing */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 4px 20px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 1.05rem; /* Increased font size */
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--secondary); }

img { max-width: 100%; height: auto; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text) !important;
}

.brand-icon { font-size: 1.5rem; }
.brand-text {
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-btn {
  display: block;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(26,86,219,0.4);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: var(--transition);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-user {
  cursor: pointer;
  color: var(--text) !important;
  font-weight: 600;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 160px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: var(--transition);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background: var(--bg-3);
  color: var(--text);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  min-height: calc(100vh - 64px - 80px);
  padding-bottom: 40px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-sub {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-dim) !important;
}

/* ===== FLASH MESSAGES ===== */
.flash-container {
  max-width: 1300px;
  margin: 16px auto 0;
  padding: 0 24px;
}

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-danger  { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.alert-info    { background: rgba(14,165,233,0.15); border: 1px solid rgba(14,165,233,0.3); color: #7dd3fc; }

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 1.2rem;
  padding: 0 4px;
  opacity: 0.7;
  transition: var(--transition);
}

.alert-close:hover { opacity: 1; }

/* ===== HERO (Landing) ===== */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #f8fafc 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(37,99,235,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(14,165,233,0.05) 0%, transparent 60%);
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  margin: 0 auto;
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-title span {
  background: linear-gradient(135deg, #2563eb, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-preview {
  position: relative;
}

.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transform: perspective(800px) rotateY(-8deg) rotateX(2deg);
  transition: var(--transition-slow);
}

.preview-card:hover {
  transform: perspective(800px) rotateY(-3deg) rotateX(1deg);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-3);
  transform: translateY(-1px);
  color: var(--text);
}

.btn-success {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16,185,129,0.35);
  color: #ffffff;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239,68,68,0.35);
  color: #ffffff;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.825rem;
}

.btn-lg {
  padding: 15px 32px;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  padding: 24px;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 48px 0; }

/* ===== PAGE HEADER ===== */
.page-header {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
  margin-bottom: 32px;
}

.page-header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}

.form-control::placeholder { color: var(--text-dim); }

select.form-control option {
  background: var(--bg-2);
  color: var(--text);
}

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

.form-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 5px;
}

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

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ===== FEATURES GRID ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: var(--transition);
}

.feature-card:hover::before { transform: scaleX(1); }

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(148,163,184,0.3);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== PIGEON TABLE ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--surface-2);
  padding: 14px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-pink   { background: #fdf2f8; color: #be185d; border: 1px solid #fbcfe8; }
.badge-gray   { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.badge-green  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-yellow { background: #fefce8; color: #a16207; border: 1px solid #fef08a; }

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(ellipse at center top, rgba(26,86,219,0.12) 0%, transparent 70%);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  position: relative;
  background: var(--surface);
  padding: 0 12px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ===== PEDIGREE CARD (Print/View) ===== */
.pedigree-wrapper {
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.pedigree-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  align-items: center;
}

/* The actual pedigree card container */
#pedigreeCard {
  background: #fff;
  color: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  font-family: Arial, Helvetica, sans-serif;
}

.ped-header {
  background: #fff;
  padding: 14px 20px 8px;
  text-align: center;
  border-bottom: 2px solid #333;
}

.ped-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.5px;
}

.ped-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 600px;
}

/* Left panel: main pigeon info + owner */
.ped-left {
  border-right: 2px solid #999;
  display: flex;
  flex-direction: column;
}

.ped-left-top {
  flex: 1;
  padding: 10px;
}

.ped-left-bottom {
  border-top: 2px solid #999;
  padding: 10px;
}

/* Right panel: ancestry tree */
.ped-right {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

/* Generation columns */
.ped-col {
  border-right: 1px solid #aaa;
  display: flex;
  flex-direction: column;
}

.ped-col:last-child { border-right: none; }

/* Individual ancestor cells */
.ped-cell {
  flex: 1;
  padding: 8px 10px;
  border-bottom: 1px solid #aaa;
  font-size: 0.72rem;
  line-height: 1.4;
  position: relative;
  min-height: 80px;
}

.ped-cell:last-child { border-bottom: none; }

/* Color schemes per generation & gender */
.ped-cell.gen1.male   { background: #cce5ff; }
.ped-cell.gen1.female { background: #ffe0f0; }
.ped-cell.gen2.male   { background: #d4edda; }
.ped-cell.gen2.female { background: #fff3cd; }
.ped-cell.gen3.male   { background: #cce5ff; }
.ped-cell.gen3.female { background: #f8d7da; }

/* Main pigeon cell */
.ped-main-pigeon {
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid #999;
}

.ped-ring {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0d47a1;
}

.ped-name-cell {
  font-weight: 700;
  font-style: italic;
  font-size: 0.78rem;
  color: #b71c1c;
  margin: 2px 0;
}

.ped-gen-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1a237e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ped-breeder {
  font-size: 0.72rem;
  color: #333;
  font-weight: 600;
  margin: 2px 0;
}

.ped-strain {
  font-size: 0.68rem;
  font-style: italic;
  color: #555;
  margin: 2px 0;
}

.ped-achievements {
  font-size: 0.65rem;
  color: #333;
  margin-top: 4px;
  line-height: 1.35;
}

.ped-color-dot {
  font-size: 0.68rem;
  color: #444;
}

/* Ring label style */
.ped-ring-box {
  background: rgba(255,255,255,0.7);
  border: 1px dashed #333;
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 6px;
  display: inline-block;
}

/* Owner info at bottom left */
.ped-owner {
  font-size: 0.75rem;
  color: #000;
  line-height: 1.6;
}

.ped-owner-name {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
}

/* Stamp/badge area */
.ped-stamp {
  border: 3px solid #1565c0;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 8px 0;
  background: #fff;
  text-align: center;
}

.ped-stamp-year {
  font-size: 1.8rem;
  font-weight: 900;
  color: #1565c0;
  line-height: 1;
}

/* ===== DASHBOARD ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ===== PIGEON SELECTOR ===== */
.pigeon-selector {
  background: var(--bg-2);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-direction: column;
}

.pigeon-selector:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.pigeon-selector.filled {
  border-style: solid;
  border-color: var(--primary);
  background: rgba(26,86,219,0.08);
  text-align: left;
  flex-direction: row;
  justify-content: flex-start;
}

/* ===== PEDIGREE BUILDER ===== */
.pedigree-builder {
  display: grid;
  grid-template-columns: 200px 1fr 1fr 1fr;
  gap: 2px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.pb-column {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pb-column-header {
  background: var(--surface-2);
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
}

.pb-cell {
  flex: 1;
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 90px;
  transition: var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.pb-cell:hover { background: var(--surface-2); }

.pb-cell.male   { border-left-color: #60a5fa; }
.pb-cell.female { border-left-color: #f472b6; }

.pb-ring {
  font-size: 0.78rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 3px;
}

.pb-name {
  font-size: 0.82rem;
  font-weight: 600;
  font-style: italic;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.pb-info {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pb-empty {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  padding: 8px;
}

.pb-add-btn {
  font-size: 1.5rem;
  color: var(--text-dim);
  transition: var(--transition);
}

.pb-cell:hover .pb-add-btn {
  color: var(--primary);
  transform: scale(1.2);
}

/* ===== EXPORT ACTIONS ===== */
.export-btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26,86,219,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(26,86,219,0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-preview { display: none; }
  .form-grid-3  { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    transition: var(--transition-slow);
    pointer-events: none;
    z-index: 999;
  }
  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .page-header-inner { flex-direction: column; align-items: flex-start; }
  .pedigree-builder { grid-template-columns: 1fr; }
  .pb-column-header { display: none; }
  .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.8rem; }
  .hero-actions { flex-direction: column; }
  .btn-lg { width: 100%; justify-content: center; }
}

/* ===== PRINT STYLES (for pedigree card) ===== */
@media print {
  body { background: #fff !important; }
  .navbar, .footer, .pedigree-actions, .flash-container { display: none !important; }
  .main-content { padding: 0 !important; }
  #pedigreeCard {
    box-shadow: none !important;
    border: 1px solid #ccc;
  }
  .pedigree-wrapper {
    padding: 0 !important;
    max-width: 100%;
  }
}

/* ===== SELECT2 STYLE OVERRIDE ===== */
.select-search {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
}

.select-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.4rem;
  padding: 4px;
  line-height: 1;
  transition: var(--transition);
}

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

/* ===== MISC ===== */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.fw-bold { font-weight: 700; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tab system */
.tabs {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
}

.tab-btn {
  flex: 1;
  padding: 9px 16px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== RESPONSIVE MEDIA QUERIES ===== */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 40px 16px;
  }
  .hero-actions {
    justify-content: center;
  }
  .page-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  /* Mengatur ulang layout form orang tua yang memakai flex style="display: flex; gap: 8px;" */
  #father_new_mode > div, #mother_new_mode > div {
    flex-direction: column;
    gap: 12px;
  }
}
