/* CSS Design System - Boston Freedom Trail Companion */

:root {
  /* Color Palettes - Dark Mode (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #141b2d;
  --bg-tertiary: #1f293d;
  --border-color: rgba(255, 255, 255, 0.07);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-crimson: #c22e2e;
  --accent-crimson-hover: #e03b3b;
  --accent-crimson-glow: rgba(194, 46, 46, 0.4);
  
  --status-nearby: #f59e0b;
  --status-nearby-glow: rgba(245, 158, 11, 0.2);
  --status-visited: #10b981;
  --status-visited-glow: rgba(16, 185, 129, 0.2);
  
  --glass-bg: rgba(20, 27, 45, 0.75);
  --glass-border: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  
  --font-family-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-family-serif: 'Cinzel', Georgia, serif;
}

body.light-mode {
  /* Color Palettes - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --border-color: rgba(0, 0, 0, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-crimson: #a61c1c;
  --accent-crimson-hover: #bd2626;
  --accent-crimson-glow: rgba(166, 28, 28, 0.25);
  
  --status-nearby: #d97706;
  --status-nearby-glow: rgba(217, 119, 6, 0.15);
  --status-visited: #059669;
  --status-visited-glow: rgba(5, 150, 105, 0.15);
  
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #05070a; /* Deepest black for border overflow */
  font-family: var(--font-family-sans);
  color: var(--text-primary);
  transition: background-color 0.3s ease;
}

/* Main Native App Simulator on Desktop */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 540px; /* Constrains size on desktop */
  margin: 0 auto;
  background-color: var(--bg-primary);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

@media (min-width: 541px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e1111, #05070a);
    height: 100vh;
  }
  
  body.light-mode {
    background: radial-gradient(circle at top right, #f1e6e6, #e2e8f0);
  }
  
  .app-container {
    height: 92vh;
    border-radius: 28px;
    border: 4px solid var(--border-color);
  }
}

/* Header Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

#app-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-crimson);
  object-fit: cover;
}

.header-text h1 {
  font-family: var(--font-family-serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: var(--text-primary);
}

.header-text .subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-crimson);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background-color: var(--bg-tertiary);
}

.icon-btn:hover {
  color: var(--accent-crimson);
  background-color: var(--border-color);
}

/* Overall Progress Card */
.progress-section {
  padding: 16px 20px 8px 20px;
  background-color: var(--bg-primary);
  z-index: 8;
}

.progress-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-label p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.progress-percentage {
  font-family: var(--font-family-serif);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-crimson);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

body.light-mode .progress-bar-container {
  background-color: rgba(0, 0, 0, 0.05);
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-crimson) 0%, var(--accent-crimson-hover) 100%);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--accent-crimson-glow);
}

/* Scrollable Main Content */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 24px 20px;
  position: relative;
  scrollbar-width: none; /* Hide scrollbars */
}

.app-content::-webkit-scrollbar {
  display: none;
}

/* Tab Views management */
.tab-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

.section-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 16px;
}

/* Tab 1: Timeline Layout */
.timeline-container {
  position: relative;
  margin-top: 10px;
}

.timeline-line {
  position: absolute;
  left: 17px;
  top: 15px;
  bottom: 15px;
  width: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.sites-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 2;
}

/* Site Cards */
.site-card {
  display: flex;
  gap: 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.site-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

body.light-mode .site-card:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Site Node Icons on Timeline */
.site-node {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-serif);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Site Info Inside Card */
.site-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.site-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.site-distance {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent-crimson);
  background-color: var(--accent-crimson-glow);
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}

.site-snippet {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-meta-badges {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Checked/Visited card state */
.site-card.visited {
  border-color: rgba(16, 185, 129, 0.3);
}

.site-card.visited .site-node {
  background-color: var(--status-visited);
  border-color: var(--status-visited);
  color: white;
  box-shadow: 0 0 10px var(--status-visited-glow);
}

.site-card.visited h4 {
  color: var(--text-primary);
}

/* Nearby Card state */
.site-card.nearby {
  animation: pulse-border 2s infinite;
}

.site-card.nearby .site-node {
  background-color: var(--status-nearby);
  border-color: var(--status-nearby);
  color: white;
  box-shadow: 0 0 10px var(--status-nearby-glow);
}

@keyframes pulse-border {
  0% { border-color: var(--border-color); }
  50% { border-color: var(--status-nearby); box-shadow: 0 0 8px var(--status-nearby-glow); }
  100% { border-color: var(--border-color); }
}

/* Live Proximity Alert Banner */
.proximity-banner {
  background: linear-gradient(135deg, #1e1609 0%, #301f05 100%);
  border: 1px solid var(--status-nearby);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px var(--status-nearby-glow);
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode .proximity-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

@keyframes slideDown {
  from { transform: translateY(-15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.proximity-banner.hidden {
  display: none !important;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fbbf24;
}

body.light-mode .banner-content {
  color: #b45309;
}

.pulse-icon {
  font-size: 1.25rem;
  animation: pulse-icon-anim 1.5s infinite;
}

@keyframes pulse-icon-anim {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.banner-text strong {
  font-size: 0.88rem;
  font-weight: 700;
}

.banner-text span {
  font-size: 0.78rem;
}

.banner-btn {
  background-color: var(--status-nearby);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.banner-btn:hover {
  filter: brightness(1.15);
}

/* Tab 2: Map Canvas and Layout */
.map-view-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 210px); /* Fill space between header & navbar */
  position: relative;
}

@media (min-width: 541px) {
  .map-view-container {
    height: calc(92vh - 210px);
  }
}

.map-header-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
  box-shadow: var(--shadow-sm);
}

.map-header-overlay h3 {
  font-family: var(--font-family-serif);
  font-size: 0.95rem;
}

.map-status {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.map-status.active {
  color: var(--status-visited);
}

.canvas-wrapper {
  flex: 1;
  width: 100%;
  position: relative;
  background-color: #0c111e;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

body.light-mode .canvas-wrapper {
  background-color: #e2e8f0;
}

#map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#map-canvas:active {
  cursor: grabbing;
}

.map-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}

.map-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.map-ctrl-btn:hover {
  background-color: var(--accent-crimson);
  color: white;
  border-color: var(--accent-crimson);
}

.map-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
}

.map-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.secondary-btn {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

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

.map-resource-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}

.map-resource-links a {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-resource-links a:hover {
  color: var(--accent-crimson);
  text-decoration: underline;
}

/* Tab 3: Journal Styling */
.journal-header {
  margin-bottom: 16px;
}

.journal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.journal-title-row h3 {
  font-family: var(--font-family-serif);
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent-crimson) 0%, var(--accent-crimson-hover) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px var(--accent-crimson-glow);
}

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

.primary-btn.sm-btn {
  padding: 8px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background-color: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: 16px;
  margin-top: 20px;
}

.empty-state i {
  font-size: 2.2rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.empty-state h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 250px;
}

.journal-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.journal-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.journal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.journal-card-header h4 {
  font-family: var(--font-family-serif);
  font-size: 0.95rem;
}

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

.journal-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.journal-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.journal-photo-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: opacity 0.2s;
}

.journal-photo-thumbnail:hover {
  opacity: 0.85;
}

/* Bottom Navigation Bar */
.app-nav {
  display: flex;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 6px 12px 18px 12px; /* Extra bottom padding for mobile home indicators */
  z-index: 10;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 0;
  transition: all 0.2s ease;
  font-family: var(--font-family-sans);
}

.nav-item i {
  font-size: 1.15rem;
}

.nav-item span {
  font-size: 0.72rem;
  font-weight: 500;
}

.nav-item.active {
  color: var(--accent-crimson);
}

/* Slide-Up Drawer Overlay */
.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
}

.drawer-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.drawer-overlay.hidden .drawer-content {
  transform: translateY(100%);
}

.drawer-content {
  width: 100%;
  max-height: 85%;
  background-color: var(--bg-secondary);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}

.drawer-handle-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}

.drawer-drag-handle {
  width: 40px;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
}

.close-btn {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.15rem;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background-color: var(--bg-tertiary);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 30px 20px;
  scrollbar-width: none;
}

.drawer-body::-webkit-scrollbar {
  display: none;
}

/* Detail UI Content */
.detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-title-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.detail-header h3 {
  font-family: var(--font-family-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.detail-meta-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

.meta-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-item i {
  color: var(--accent-crimson);
  width: 14px;
}

.detail-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 16px;
  border-left: 2px solid var(--accent-crimson);
  padding-left: 8px;
}

.detail-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Accordion for Factoids */
.factoid-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.factoid-item {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background-color: var(--bg-primary);
  overflow: hidden;
}

.factoid-trigger {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.factoid-trigger i {
  transition: transform 0.2s;
  color: var(--text-muted);
}

.factoid-item.expanded .factoid-trigger i {
  transform: rotate(180deg);
}

.factoid-content {
  padding: 0 12px 10px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  border-top: 1px solid transparent;
  display: none;
}

.factoid-item.expanded .factoid-content {
  display: block;
  border-top-color: var(--border-color);
}

/* Checkin Action Card */
.detail-action-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.detail-action-card.unvisited {
  background: linear-gradient(135deg, rgba(194, 46, 46, 0.04) 0%, rgba(194, 46, 46, 0.08) 100%);
  border-color: rgba(194, 46, 46, 0.2);
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-info .status-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.status-info .status-val {
  font-size: 0.82rem;
  font-weight: 600;
}

/* Journal Area inside details */
.journal-entry-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.journal-textarea {
  width: 100%;
  height: 90px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-family-sans);
  font-size: 0.85rem;
  color: var(--text-primary);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.journal-textarea:focus {
  border-color: var(--accent-crimson);
}

.autosave-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  height: 12px;
}

/* Photo capture section inside details */
.photo-capture-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-item-container {
  position: relative;
  width: 76px;
  height: 76px;
}

.photo-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.delete-photo-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.camera-input-wrapper {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  border: 1.5px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.camera-input-wrapper:hover {
  border-color: var(--accent-crimson);
  color: var(--accent-crimson);
}

.camera-input-wrapper i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.camera-input-wrapper span {
  font-size: 0.62rem;
  font-weight: 500;
}

.camera-input-wrapper input {
  display: none;
}

/* Photo Viewer Lightbox */
.lightbox {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* --- Share & Back Up --- */
.journal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#share-modal {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.share-modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: var(--bg-secondary);
}

.share-modal-header h3 {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-modal-header h3 i { color: var(--accent-crimson); }

.share-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.share-status {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  padding: 10px 12px;
}

#save-cloud-btn { width: 100%; }

.share-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.share-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 4px;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.share-input {
  flex: 1;
  min-width: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-family-sans);
}

.copy-row .sm-btn { white-space: nowrap; }
.share-full { width: 100%; justify-content: center; }

.danger-link {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--accent-crimson);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  font-family: var(--font-family-sans);
}

.share-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 6px 0;
}

.share-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
