/* RealRRR User Panel - Modern Luxury Fintech & Real Estate UI */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --font-primary: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  
  /* Parrot Green Color Palette */
  --parrot-main: #22c55e;
  --parrot-light: #4ade80;
  --parrot-neon: #10e589;
  --parrot-dark: #16a34a;
  --parrot-glow: rgba(34, 197, 94, 0.25);
  
  --emerald-accent: #10b981;
  --gold-accent: #f59e0b;
  --amber-accent: #f59e0b;
}

* {
  font-family: var(--font-primary);
  box-sizing: border-box;
}

/* ======================================================== */
/* DEFAULT: LIGHT MODE */
/* ======================================================== */
html, html.light, html:not(.dark) {
  --bg-page: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --table-head: #f8fafc;
  --table-border: #e2e8f0;
  --table-hover: #f1f5f9;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 13px;
}

/* ======================================================== */
/* DARK MODE: PARROT GREEN LUXURY ACCENTS */
/* ======================================================== */
html.dark {
  --bg-page: #090e1a;
  --bg-sidebar: #0c1222;
  --bg-header: rgba(12, 18, 34, 0.95);
  --bg-card: #0f172a;
  --bg-card-alt: #131d33;
  --bg-input: #090e1a;
  --border-color: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --table-head: #0b1220;
  --table-border: #1e293b;
  --table-hover: rgba(30, 41, 59, 0.4);
}

/* Custom Refined Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #25334c;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--parrot-main);
}

/* Typography Utility */
.font-display {
  font-family: var(--font-display);
}

/* Card Styles */
.glass-panel {
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
}

.glass-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html:not(.dark) .glass-card {
  background: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

html.dark .glass-card {
  background: linear-gradient(135deg, rgba(20, 30, 50, 0.45) 0%, rgba(15, 23, 42, 0.85) 100%);
  box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.4);
}

.glass-card:hover {
  border-color: rgba(34, 197, 94, 0.4);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08), 0 0 12px -2px rgba(34, 197, 94, 0.15);
}

/* Parrot Neon Gradient Text */
.parrot-gradient-text {
  background: linear-gradient(135deg, #86efac 0%, #22c55e 50%, #15803d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .parrot-gradient-text {
  background: linear-gradient(135deg, #bbf7d0 0%, #4ade80 50%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gold-gradient-text {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Standardized Compact Sidebar Navigation Link */
.nav-item {
  position: relative;
  transition: all 0.18s ease;
  font-size: 12.5px;
  font-weight: 500;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.12) 0%, rgba(34, 197, 94, 0.02) 100%);
  color: #16a34a !important;
  font-weight: 600;
  border-left: 3px solid #22c55e;
}

html.dark .nav-item.active {
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.15) 0%, rgba(74, 222, 128, 0.02) 100%);
  color: #4ade80 !important;
  border-left: 3px solid #4ade80;
}

.nav-item.active i {
  color: #22c55e !important;
}
html.dark .nav-item.active i {
  color: #4ade80 !important;
}

/* Status Badges - Compact & Standard */
.badge-active {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}
html.dark .badge-active {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.3);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}
html.dark .badge-pending {
  color: #fbbf24;
}

.badge-completed, .badge-matured {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}
html.dark .badge-completed, html.dark .badge-matured {
  color: #60a5fa;
}

.badge-closed, .badge-rejected {
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}
html.dark .badge-closed, html.dark .badge-rejected {
  color: #fb7185;
}

.badge-renewed {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 600;
}
html.dark .badge-renewed {
  color: #a78bfa;
}

/* Module Section Animations */
.module-section {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.module-section.active {
  display: block;
}

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

/* Status Beacon */
.status-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.status-beacon::after {
  content: '';
  position: absolute;
  top: -2.5px;
  left: -2.5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: pulseBeacon 1.8s infinite;
  opacity: 0.6;
}

.status-beacon.green {
  background-color: var(--parrot-main);
}
.status-beacon.green::after {
  background-color: var(--parrot-main);
}

@keyframes pulseBeacon {
  0% { transform: scale(0.8); opacity: 0.8; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Genealogy Tree Styling */
.tree-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 16px 0;
  overflow-x: auto;
}

.tree-node-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 160px;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.tree-node-card:hover {
  border-color: var(--parrot-main);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--parrot-glow);
}

.tree-line-v {
  width: 2px;
  height: 24px;
  background: var(--border-color);
  margin: 0 auto;
}

.tree-line-h {
  height: 2px;
  background: var(--border-color);
  position: relative;
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  animation: slideToastIn 0.25s ease-out;
  transition: all 0.25s ease;
  font-size: 12px;
}

.toast.toast-success {
  border-left: 4px solid var(--parrot-main);
}
.toast.toast-error {
  border-left: 4px solid #ef4444;
}
.toast.toast-info {
  border-left: 4px solid #3b82f6;
}
.toast.toast-warning {
  border-left: 4px solid #f59e0b;
}

@keyframes slideToastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 10px;
}

@media (min-width: 1024px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* Button & Icon Standards (Standard & Small as requested) */
.btn-compact {
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.icon-box-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.icon-box-xs {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Print Friendly */
@media print {
  .no-print, .mobile-bottom-nav, aside, header {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
}
