/* ==========================================================================
   OrcTech Travel Map — Modern Theme & Styles
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-surface: #101726;
  --bg-surface-elevated: #182238;
  --bg-glass: rgba(16, 23, 38, 0.85);
  --bg-glass-card: rgba(24, 34, 56, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.2);
  --border-accent: rgba(16, 185, 129, 0.4);

  --accent: #10b981;
  --accent-hover: #059669;
  --accent-glow: rgba(16, 185, 129, 0.35);
  --accent-secondary: #06b6d4;
  --accent-live: #ef4444;
  --accent-live-glow: rgba(239, 68, 68, 0.4);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-sub: #64748b;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --header-height: 68px;
  --sidebar-width: 440px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header Bar
   ========================================================================== */

.app-header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  flex-shrink: 0;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #10b981, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 0 20px var(--accent-glow);
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: block;
  background: linear-gradient(120deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Trip Controls & Status */
.trip-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--accent);
  pointer-events: none;
  font-size: 0.9rem;
}

.select-wrapper select {
  appearance: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 9px 38px 9px 36px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  max-width: 260px;
}

.select-wrapper select:hover, .select-wrapper select:focus {
  border-color: var(--accent);
  outline: none;
}

/* Live Traveling Status Badge */
.trip-status-badge {
  display: flex;
  align-items: center;
}

.badge-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseAnimation 1.6s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.badge-completed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--accent);
  color: #a7f3d0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.stats-pills {
  display: flex;
  gap: 8px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-pill i {
  color: var(--accent-secondary);
}

.stat-pill span {
  color: var(--text-main);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.5);
}

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

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

/* ==========================================================================
   Main Workspace Layout
   ========================================================================== */

.main-container {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  height: calc(100vh - var(--header-height));
}

.map-wrapper {
  flex: 1;
  position: relative;
  height: 100%;
  width: 100%;
}

#map {
  width: 100%;
  height: 100%;
  background: #111827;
  z-index: 1;
}

/* Floating Controls */
.map-floating-controls {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layer-selector {
  display: flex;
  flex-direction: column;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 5px;
  gap: 4px;
  box-shadow: var(--shadow-md);
}

.layer-btn, .floating-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.layer-btn:hover, .floating-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.layer-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}

.floating-btn {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Tour Controller Overlay */
.tour-controller {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-accent);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 380px;
  transition: var(--transition-smooth);
}

.tour-controller.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
}

.tour-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.tour-status {
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.tour-title {
  color: var(--text-main);
  font-weight: 600;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.btn-tour-nav {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-tour-play {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: var(--transition-fast);
}

.tour-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tour-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transition: width 0.3s ease;
}

/* ==========================================================================
   Sidebar: Details, Timeline & Gallery
   ========================================================================== */

.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 800;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.sidebar.collapsed {
  transform: translateX(100%);
  margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
}

.sidebar-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.status-pill.live {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.status-pill.completed {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent);
  color: #a7f3d0;
}

.btn-finish-trip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-finish-trip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.sidebar-trip-details h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.trip-meta-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.trip-meta-row strong {
  color: var(--text-main);
}

.sidebar-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

.sidebar-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  font-family: inherit;
}

.tab-btn:hover { color: var(--text-main); }
.tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.sidebar-filter-bar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  gap: 10px;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 100%;
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

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

/* Timeline Cards */
.stops-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.stops-timeline::before {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 24px;
  left: 17px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(16, 185, 129, 0.15) 100%);
  z-index: 1;
}

.timeline-card {
  position: relative;
  display: flex;
  gap: 14px;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 2;
}

.timeline-card:hover {
  border-color: var(--border-accent);
  background: rgba(24, 34, 56, 0.9);
  transform: translateX(4px);
}

.timeline-card.active {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 16px var(--accent-glow);
}

.timeline-node {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 8px var(--accent-glow);
  position: absolute;
  left: -20px;
  top: 18px;
}

.timeline-thumb-wrapper {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  background: #000;
}

.timeline-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-video-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: var(--accent);
  font-size: 1.3rem;
}

.timeline-info {
  flex: 1;
  min-width: 0;
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-card-time {
  font-size: 0.75rem;
  color: var(--text-sub);
  flex-shrink: 0;
}

.timeline-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-card-tags {
  display: flex;
  gap: 6px;
}

.card-tag {
  font-size: 0.7rem;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--accent-secondary);
  font-weight: 600;
}

.card-tag.video-tag {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

/* Gallery Grid */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #000;
}

.gallery-item img, .gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img, .gallery-item:hover video {
  transform: scale(1.06);
}

.gallery-video-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(9, 13, 22, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
}

.gallery-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-meta {
  font-size: 0.7rem;
  color: var(--accent);
}

/* ==========================================================================
   Leaflet Custom Markers & Popups
   ========================================================================== */

.custom-photo-marker {
  position: relative;
  width: 46px;
  height: 46px;
  cursor: pointer;
}

.marker-pin-outer {
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #10b981, #059669);
  padding: 3px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 12px var(--accent-glow);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.custom-photo-marker.is-video .marker-pin-outer {
  background: linear-gradient(135deg, #0284c7, #0369a1);
}

.custom-photo-marker:hover .marker-pin-outer,
.custom-photo-marker.active .marker-pin-outer {
  transform: rotate(-45deg) scale(1.18);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.marker-thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: rotate(45deg);
  object-fit: cover;
  background: #111;
}

.marker-thumb-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #38bdf8;
  font-size: 0.9rem;
}

.marker-video-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #0284c7;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  z-index: 5;
  transform: rotate(45deg);
}

/* Leaflet Popup */
.travel-custom-popup .leaflet-popup-content-wrapper {
  background: var(--bg-surface-elevated) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color-hover) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.travel-custom-popup .leaflet-popup-content {
  margin: 0 !important;
  width: 260px !important;
}

.popup-card {
  display: flex;
  flex-direction: column;
}

.popup-image-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  cursor: pointer;
  background: #000;
}

.popup-image-wrap img, .popup-image-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.4);
}

.popup-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}

.popup-body {
  padding: 12px 14px;
}

.popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.popup-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.popup-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  font-size: 0.75rem;
  color: var(--text-sub);
}

.popup-view-btn {
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Fullscreen Lightbox (Photo & Video Player)
   ========================================================================== */

.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.lightbox-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 13, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  width: 90vw;
  max-width: 1050px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.lightbox-btn-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 10;
  transition: var(--transition-fast);
}

.lightbox-btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-media-container {
  position: relative;
  flex: 1;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.media-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-video-player {
  max-width: 100%;
  max-height: 70vh;
  outline: none;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition-fast);
  z-index: 5;
}

.lightbox-nav-btn:hover { background: var(--accent); }
.lightbox-nav-btn.prev { left: 16px; }
.lightbox-nav-btn.next { right: 16px; }

.lightbox-caption-bar {
  padding: 18px 24px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.lightbox-caption-main h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.lightbox-caption-main p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lightbox-caption-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modals & Forms
   ========================================================================== */

.modal-dialog {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.modal-dialog.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 2;
  width: 90vw;
  max-width: 580px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card-sm { max-width: 440px; }

.modal-header {
  padding: 18px 22px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.text-accent { color: var(--accent); }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.modal-close:hover { color: #fff; }

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 72vh;
  overflow-y: auto;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-group input, .input-group textarea, .input-group select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.input-group input:focus, .input-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.input-row {
  display: flex;
  gap: 12px;
}

.input-row .input-group { flex: 1; }

.helper-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.dropzone i {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.dropzone-compact {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-input-hidden { display: none; }

.gps-status-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gps-status-banner.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent);
  color: #6ee7b7;
}

.gps-status-banner.info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid #38bdf8;
  color: #bae6fd;
}

.file-info-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--accent);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 6px;
}

.upload-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.upload-progress-bar .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  transition: width 0.3s ease;
}

#uploadProgressText {
  font-size: 0.75rem;
  color: var(--accent);
}

.modal-footer {
  padding: 16px 22px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 900px) {
  .app-header { padding: 0 16px; }
  .stats-pills { display: none; }
  .sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  }
}

@media (max-width: 600px) {
  .brand-subtitle { display: none; }
  .header-actions span { display: none; }
  .sidebar { width: 100vw; }
}
