/* ==========================================================================
   BirdLife Zimbabwe App - Custom Design System
   ========================================================================== */

:root {
  /* Dark Theme variables (default) */
  --bg-deep: #080c14;
  --bg-dark: #0b101a;
  --bg-card: rgba(19, 27, 44, 0.6);
  --bg-card-hover: rgba(27, 39, 62, 0.7);
  --bg-input: #121a29;
  --border: rgba(46, 163, 242, 0.15);
  --border-light: rgba(46, 163, 242, 0.3);
  --text-primary: #f0f3f6;
  --text-secondary: #b1bcce;
  --text-muted: #738096;
  
  --accent-blue: #2ea3f2;
  --accent-navy: #365392;
  --accent-green: #229901;
  --accent-green-bright: #34d011;
  --accent-red: #f85149;
  --accent-gold: #ffc72c;
  
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --backdrop-blur: blur(12px);
  --font-family: 'Open Sans', Arial, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  /* Light Theme variables */
  --bg-deep: #f4f7fa;
  --bg-dark: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4f8;
  --bg-input: #edf2f7;
  --border: #cfd9e6;
  --border-light: #b2c3d9;
  --text-primary: #1e2530;
  --text-secondary: #4e5a6c;
  --text-muted: #8290a6;
  
  --accent-blue: #2ea3f2;
  --accent-navy: #365392;
  --accent-green: #229901;
  --accent-green-bright: #229901;
  --shadow: 0 8px 32px 0 rgba(169, 184, 195, 0.15);
  --backdrop-blur: none;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s;
}

/* ---- GLOWING BACKGROUND ORBS ---- */
.background-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  transition: opacity 0.5s;
}

[data-theme="light"] .orb {
  opacity: 0.05;
}

.orb-blue {
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-navy) 0%, transparent 70%);
  animation: floatOrb 12s infinite alternate ease-in-out;
}

.orb-green {
  bottom: -150px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-green) 0%, transparent 70%);
  animation: floatOrb 15s infinite alternate-reverse ease-in-out;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 40px) scale(1.1); }
}

/* ---- APP SHELL LAYOUT ---- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Desktop) */
.sidebar {
  width: 260px;
  background-color: var(--bg-dark);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.brand-section {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 42px;
  height: 42px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-title span {
  color: var(--accent-blue);
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.nav-links {
  list-style: none;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
  background-color: var(--bg-card-hover);
  color: var(--accent-blue);
  border-left: 3px solid var(--accent-blue);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* User Profile footer in sidebar */
.user-profile-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  flex-direction: column;
  max-width: 150px;
}

.user-displayname {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  margin-top: 4px;
}

.badge-staff { background-color: var(--accent-red); color: white; }
.badge-ornithologist { background-color: var(--accent-blue); color: white; }
.badge-member { background-color: var(--accent-green); color: white; }
.badge-watcher { background-color: var(--text-muted); color: white; }

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
}

.logout-btn:hover {
  color: var(--accent-red);
}

/* Main Viewport */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

.header-bar {
  background-color: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: var(--backdrop-blur);
}

.page-title-section h2 {
  font-size: 20px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Mobile Top Bar / Bottom Bar styles */
.mobile-top-bar {
  display: none;
}
.mobile-bottom-nav {
  display: none;
}

/* Tab Screens container */
.tab-viewport {
  padding: 32px;
  flex: 1;
}

.tab-screen {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-screen.active {
  display: block;
}

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

/* ---- GLASSMORPHIC CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--backdrop-blur);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- FORMS & INPUTS ---- */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control, select, textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus, select:focus, textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(46, 163, 242, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-green);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-green-bright);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

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

.btn-accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ---- DASHBOARD TABS AND GRIDS ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.dash-main {
  grid-column: span 2;
}

.dash-sidebar {
  grid-column: span 1;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-blue);
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.news-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.news-item:last-child {
  border: none;
  padding: 0;
  margin: 0;
}

.news-item h4 {
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 700;
}

.news-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ---- IDENTIFICATION PAGE ---- */
.identify-container {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}

.identify-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.id-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.id-tab-btn:hover, .id-tab-btn.active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--bg-card-hover);
}

/* Wizard */
.wizard-step {
  display: none;
}
.wizard-step.active {
  display: block;
}

.wizard-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.wizard-option-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  background: rgba(0,0,0,0.1);
}

.wizard-option-card:hover {
  border-color: var(--border-light);
}

.wizard-option-card.selected {
  border-color: var(--accent-blue);
  background-color: rgba(46, 163, 242, 0.1);
  color: var(--accent-blue);
}

.wizard-option-card img {
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
}

.wizard-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

/* Photo Scanner */
.photo-upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  background-color: rgba(0, 0, 0, 0.15);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.photo-upload-zone:hover {
  border-color: var(--accent-blue);
  background-color: var(--bg-card-hover);
}

.photo-upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.photo-upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.scanner-container {
  position: relative;
  max-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  display: none;
}

.scanner-image {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--accent-green-bright);
  box-shadow: 0 0 10px 2px var(--accent-green-bright);
  animation: scanLaser 2.2s infinite ease-in-out;
  display: none;
}

@keyframes scanLaser {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.sample-photos-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.sample-photo-thumbnail {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.sample-photo-thumbnail:hover {
  border-color: var(--accent-blue);
  transform: scale(1.05);
}

/* Sound Identifier */
.sound-waveform-canvas {
  width: 100%;
  height: 120px;
  background-color: #050a12;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 16px 0;
}

.sound-samples-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.sound-sample-item {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.sound-sample-item:hover {
  border-color: var(--accent-blue);
  background-color: rgba(46, 163, 242, 0.05);
}

.sound-sample-info h5 {
  font-size: 13px;
  font-weight: 700;
}

.sound-sample-info p {
  font-size: 11px;
  color: var(--text-muted);
}

/* Identification Results display */
.results-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.result-card-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.result-card-item:hover {
  border-color: var(--border-light);
}

.result-card-details h4 {
  font-size: 15px;
  font-weight: 700;
}

.result-card-details .scientific {
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
}

.result-card-details .local {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.result-conf-bar-container {
  width: 150px;
  text-align: right;
}

.result-conf-value {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}

.result-conf-track {
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.result-conf-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
  border-radius: 3px;
}

/* ---- FIELD GUIDE ---- */
.guide-header-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.guide-search-wrapper {
  flex: 1;
  min-width: 250px;
}

.guide-filter-wrapper {
  width: 180px;
}

.guide-birds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.bird-guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.bird-guide-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
}

.bird-card-image-container {
  height: 160px;
  background-color: #0b121c;
  position: relative;
  overflow: hidden;
}

.bird-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bird-card-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  color: white;
}

.badge-resident { background-color: var(--accent-navy); }
.badge-migratory { background-color: var(--accent-gold); color: #1e2530; }
.badge-rare { background-color: var(--accent-red); }

.bird-card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bird-card-info h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.bird-card-info .scientific {
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.bird-card-info .local-names {
  font-size: 11px;
  color: var(--text-muted);
}

/* Detailed Bird Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(5, 8, 14, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modalScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

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

.modal-close-btn:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-bird-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.modal-bird-image {
  width: 100%;
  height: 480px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background-color: #050c18;
  border: 1px solid var(--border);
}

.modal-bird-details h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-bird-details .scientific {
  font-size: 14px;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.modal-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-meta-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.modal-meta-box strong {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
}

.modal-meta-box span {
  font-size: 13px;
  font-weight: 600;
}

/* Range map styling */
.range-map-container {
  width: 100%;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #080d16;
  margin-top: 12px;
  position: relative;
}

.range-map-svg {
  width: 100%;
  height: 100%;
}

/* ---- MY SIGHTINGS & PENTAD GRID MAP ---- */
.sightings-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

/* Zimbabwe Pentad Grid Map Simulator */
.pentad-grid-map {
  width: 100%;
  height: 280px;
  background-color: #060a12;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.pentad-map-canvas {
  width: 100%;
  height: 100%;
}

.pentad-info-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(11, 16, 26, 0.85);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.pentad-info-overlay strong {
  color: var(--accent-blue);
}

.sightings-list-container {
  max-height: 500px;
  overflow-y: auto;
}

.sighting-card-item {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  transition: var(--transition);
}

.sighting-card-item:hover {
  border-color: var(--border-light);
}

.sighting-image-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: #0b121c;
  flex-shrink: 0;
}

.sighting-details {
  flex: 1;
}

.sighting-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.sighting-bird-name {
  font-size: 14px;
  font-weight: 700;
}

.sighting-count-badge {
  background-color: var(--accent-navy);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.sighting-meta-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.sighting-notes {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sighting-verification-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
  margin-top: 8px;
  display: block;
}

.badge-verified { background-color: rgba(34, 153, 1, 0.15); color: var(--accent-green-bright); }
.badge-corrected { background-color: rgba(255, 199, 44, 0.15); color: var(--accent-gold); }
.badge-pending { background-color: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* Corrections action buttons */
.sighting-actions-row {
  margin-top: 10px;
  display: flex;
  gap: 12px;
}

.sighting-action-link {
  font-size: 11px;
  color: var(--accent-blue);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}

.sighting-action-link:hover {
  color: white;
}

/* Sighting Correction details row */
.corrections-sublist {
  background-color: rgba(0, 0, 0, 0.15);
  border-left: 2px solid var(--border);
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.correction-subitem {
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.correction-subitem:last-child {
  border: none;
  padding: 0;
}

.correction-subitem-user {
  font-weight: 700;
  color: var(--text-primary);
}

.correction-subitem-text {
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---- COMMUNITY HUB CHAT ---- */
.community-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
}

.chat-rooms-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-room-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.chat-room-btn:hover, .chat-room-btn.active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background-color: var(--bg-card-hover);
}

.chat-window {
  display: flex;
  flex-direction: column;
  height: 480px;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages-log {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg-bubble {
  max-width: 75%;
  display: flex;
  flex-direction: column;
}

.chat-msg-bubble.self {
  align-self: flex-end;
}

.chat-msg-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-msg-bubble.self .chat-msg-meta {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-text {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.chat-msg-bubble.self .chat-msg-text {
  background-color: var(--accent-navy);
  border-color: var(--accent-blue);
}

.chat-input-row {
  padding: 16px;
  border-top: 1px solid var(--border);
  background-color: var(--bg-dark);
  display: flex;
  gap: 12px;
}

/* ---- MEMBERSHIP & ONBOARDING ---- */
.membership-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.tier-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.tier-card:hover {
  border-color: var(--border-light);
}

.tier-card.selected {
  border-color: var(--accent-blue);
  background-color: rgba(46, 163, 242, 0.05);
}

.tier-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tier-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.tier-price span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.tier-features {
  list-style: none;
  padding: 16px 0;
  text-align: left;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tier-features li::before {
  content: "✓ ";
  color: var(--accent-green-bright);
  font-weight: bold;
}

/* EcoCash payment simulation modal details */
.billing-portal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.ecocash-logo {
  font-size: 20px;
  font-weight: 800;
  color: #ff3b30;
  letter-spacing: -0.5px;
}
.ecocash-logo span { color: #007aff; }

/* ---- AUTH SCREENS ---- */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  background-color: var(--bg-deep);
}

.auth-container {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.4s ease-out;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
}

.auth-header h1 {
  font-size: 22px;
  font-weight: 800;
}

.auth-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 20px;
}

.auth-footer-text a {
  color: var(--accent-blue);
  text-decoration: underline;
  cursor: pointer;
}

/* ---- RESPONSIVE MEDIA QUERIES ---- */
@media (max-width: 900px) {
  /* Hide sidebar, show mobile bottom-nav */
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    padding-bottom: 60px; /* offset bottom bar height */
  }
  
  .header-bar {
    padding: 12px 16px;
  }
  
  .tab-viewport {
    padding: 16px;
  }
  
  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bg-dark);
    border-top: 1px solid var(--border);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: var(--backdrop-blur);
  }
  
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    flex: 1;
    height: 100%;
  }
  
  .mobile-nav-item.active {
    color: var(--accent-blue);
  }
  
  .mobile-nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
  }
  
  /* Grid layouts to single column */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dash-main {
    grid-column: span 1;
  }
  .dash-sidebar {
    grid-column: span 1;
  }
  
  .identify-container {
    grid-template-columns: 1fr;
  }
  .identify-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .id-tab-btn {
    white-space: nowrap;
    padding: 10px 14px;
  }
  
  .sightings-layout {
    grid-template-columns: 1fr;
  }
  
  .community-layout {
    grid-template-columns: 1fr;
  }
  .chat-rooms-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .chat-room-btn {
    white-space: nowrap;
  }
  
  .membership-tiers-grid {
    grid-template-columns: 1fr;
  }
  .billing-portal {
    grid-template-columns: 1fr;
  }
  
  .modal-bird-grid {
    grid-template-columns: 1fr;
  }
  .modal-content {
    max-height: 95vh;
  }
}

/* ==========================================================================
   Admin Panel Custom CSS
   ========================================================================== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-table-container {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: rgba(54, 83, 146, 0.2);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

.admin-table td {
  color: var(--text-secondary);
  font-size: 13px;
  vertical-align: middle;
}

.admin-table tr:hover {
  background: var(--bg-card-hover);
}

.role-select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  width: 100%;
  max-width: 140px;
}

.role-select:focus {
  border-color: var(--accent-blue);
}

/* ==========================================================================
   iNaturalist-style Observations and Consensus CSS
   ========================================================================== */
.inat-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: rgba(34, 153, 1, 0.12);
  border: 1px solid rgba(34, 153, 1, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
  backdrop-filter: var(--backdrop-blur);
}

.inat-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.inat-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-green-bright);
}

.inat-stat-lbl {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Sightings List Grid Mode */
.sightings-list-container.grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  max-height: none;
}

.sightings-list-container.grid-mode .sighting-card-item {
  flex-direction: column;
  margin-bottom: 0;
  height: 100%;
  padding: 12px;
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
}

.sightings-list-container.grid-mode .sighting-image-thumb {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-sm);
}

.sightings-list-container.grid-mode .sighting-details {
  display: flex;
  flex-direction: column;
  height: calc(100% - 152px);
  justify-content: space-between;
}

.sightings-list-container.grid-mode .sighting-notes {
  margin-top: 6px;
  font-size: 11px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sightings-list-container.grid-mode .sighting-verification-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  margin-top: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Observer Avatar overlapping layout for inat grid */
.observer-avatar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.observer-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid var(--border-light);
  flex-shrink: 0;
}

/* Consensus Modal Columns */
.consensus-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.consensus-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.consensus-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.consensus-section-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.consensus-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.consensus-vote-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.consensus-vote-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.consensus-vote-taxon {
  color: var(--accent-blue);
  font-weight: 600;
}

/* View toggle active styling */
.view-toggles button.active {
  background-color: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.badge-research-grade {
  background-color: rgba(34, 153, 1, 0.15);
  color: var(--accent-green-bright);
}
.badge-needs-id {
  background-color: rgba(255, 199, 44, 0.15);
  color: var(--accent-gold);
}
.badge-casual {
  background-color: rgba(248, 81, 73, 0.15);
  color: var(--accent-red);
}

/* ---- COMMUNITY SUBNAV & LEADERBOARDS ---- */
.community-subnav {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.community-subnav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.community-subnav-btn:hover {
  color: var(--accent-blue);
  background-color: var(--bg-card-hover);
  border-color: var(--border-light);
}

.community-subnav-btn.active {
  color: #ffffff;
  background-color: var(--accent-navy);
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(46, 163, 242, 0.3);
}

[data-theme="light"] .community-subnav-btn.active {
  color: #ffffff;
  background-color: var(--accent-navy);
}

.community-subscreen {
  animation: fadeIn 0.3s ease-in-out;
}

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

.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.leaderboard-item:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.leaderboard-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.rank-1 {
  background-color: var(--accent-gold);
  color: #080c14 !important;
}

.rank-2 {
  background-color: #cfd9e6;
  color: #080c14 !important;
}

.rank-3 {
  background-color: #cd7f32;
  color: #ffffff !important;
}

.rank-other {
  background-color: var(--bg-input);
  color: var(--text-secondary);
}

.leaderboard-details {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leaderboard-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.leaderboard-count {
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 700;
}

/* Light / Dark adjustments for Zimbabwe topographic map container */
.range-map-container {
  width: 240px;
  height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #f7ebd9; /* Cream background to match physical map border */
  background-image: url('/zimbabwe_map.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 16px auto 0 auto;
  position: relative;
  overflow: hidden;
}

body[data-theme="dark"] .range-map-container {
  filter: brightness(0.75) contrast(1.1) saturate(0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: #0a0d16;
}

/* Responsive adjustment for leaderboards */
@media (max-width: 768px) {
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }
}
