/* Constantinople & Bodrum — Flossyraptor Luxury Theme with Leaflet Voyage Maps */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #09090b;
  --bg-card: rgba(18, 18, 22, 0.78);
  --bg-card-hover: rgba(28, 28, 34, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(212, 175, 55, 0.55);
  
  --text-main: #f4f4f6;
  --text-muted: #94949e;
  --text-accent: #d4af37; /* Bosporus Champagne Gold */
  --accent-cyan: #2dd4bf; /* Aegean Turquoise */

  --primary: #d4af37;
  --primary-hover: #e5c158;
  --primary-text: #0a0a0c;
  
  --font-serif: "Cinzel", "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family: var(--font-sans);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: calc(80px + var(--safe-bottom));
}

/* Utilities */
.hidden { display: none !important; }
.accent { color: var(--text-accent); }
.center { text-align: center; }

/* Buttons & Inputs */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:active {
  transform: scale(0.96);
}

.primary-btn, .primary {
  background: linear-gradient(135deg, #d4af37, #b8860b);
  color: var(--primary-text);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}
.primary-btn.sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.ghost-btn, .ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.big {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.glow {
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.35);
}

input, select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 12px;
}
input:focus, select:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.08);
}

/* Cards & Glassmorphism */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}

/* Splash Video Modal (Contained, Luxury Scale) */
#disco-splash {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.disco-modal {
  position: relative;
  width: 100%;
  max-width: 320px;
  max-height: 320px;
  aspect-ratio: 1 / 1;
  background: #000;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

#disco-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}

.disco-skip {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.disco-skip:hover {
  background: var(--primary);
  color: #000;
}

/* Screen Gate */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  background: radial-gradient(circle at 50% 30%, #1a1712 0%, #0a0a0a 100%);
}
.card {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
}
.gate-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.card h1 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fcebb6 0%, #d4af37 50%, #aa7c11 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.card .subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}
.card .muted {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* Topbar & Sticky Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
}
.main-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fcebb6 0%, #d4af37 55%, #b8860b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sub-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.stats-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* Tabs */
.tabs {
  display: flex;
  padding: 0 16px 8px;
  gap: 8px;
}
.tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
}
.tab.active {
  color: var(--primary-text);
  background: var(--primary);
  font-weight: 600;
}

/* Controls & Category Chips */
.control-panel {
  padding: 8px 16px;
  background: #0d0d0f;
  border-bottom: 1px solid var(--border);
}
.chips-container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.chips-container::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  white-space: nowrap;
  transition: all 0.2s;
}
.chip.active {
  background: var(--text-accent);
  color: #000;
  font-weight: 600;
  border-color: var(--text-accent);
}

.action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.action-right {
  display: flex;
  gap: 8px;
}

/* Selection Bar */
.select-bar {
  position: sticky;
  top: calc(105px + var(--safe-top));
  z-index: 90;
  background: #1e1b15;
  border-bottom: 1px solid var(--primary);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}
.select-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.icon-btn {
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 4px 8px;
}

/* Media Grid & Timeline */
.content-area {
  padding: 12px;
  flex: 1;
}
.timeline-group {
  margin-bottom: 28px;
}
.timeline-header-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.timeline-title-group {
  display: flex;
  flex-direction: column;
}
.timeline-date-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fcebb6;
}
.timeline-anchorage-badge {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.timeline-map-thumb-btn {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--primary);
  color: var(--text-accent);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-badge {
  font-size: 0.75rem;
  color: var(--text-accent);
  background: rgba(212, 175, 55, 0.12);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-left: 4px;
}

.media-grid, .timeline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
@media (min-width: 600px) {
  .media-grid, .timeline-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}
@media (min-width: 1024px) {
  .media-grid, .timeline-grid { grid-template-columns: repeat(6, 1fr); gap: 10px; }
}

.media-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: #18181c;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.media-card * {
  pointer-events: none;
}
.media-card img, .media-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.media-card:hover img {
  transform: scale(1.04);
}
.media-card:active {
  opacity: 0.85;
}
.video-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}
.card-uploader-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #f5f5f7;
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 4px;
  max-width: calc(100% - 8px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-reaction-preview {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 4px;
}
.card-select-checkbox {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
}
.media-card.selected .card-select-checkbox {
  background: var(--text-accent);
  border-color: var(--text-accent);
  color: #000;
}

/* Interactive Journey Map View */
.journey-map-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 480px;
  background: #101014;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-legend-bar {
  padding: 10px 16px;
  background: rgba(20, 20, 24, 0.9);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-accent);
}
.journey-map-container {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
}
.lb-mini-map {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  border: 1px solid var(--border);
}

/* Floating Action Upload Button */
.fab-wrapper {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 80;
  pointer-events: none;
}
.fab-btn {
  pointer-events: auto;
  background: linear-gradient(135deg, #d4af37, #b8860b);
  color: #000;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
}
.fab-icon { font-size: 1.3rem; line-height: 1; }

/* Upload Modal / Drawer */
.upload-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
}
@media (min-width: 600px) {
  .upload-modal { align-items: center; justify-content: center; }
}
.upload-card {
  width: 100%;
  max-width: 500px;
  padding: 24px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 600px) {
  .upload-card { border-radius: var(--radius-lg); }
}
.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2dd4bf, #d4af37);
  transition: width 0.2s ease;
}
.upload-status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.batch-tagging {
  margin-bottom: 16px;
}
.batch-tagging label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.upload-items-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
  max-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upload-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.upload-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-item-pct {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: #000;
  touch-action: none;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: #000;
}
.lightbox-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}
.lightbox-meta {
  display: flex;
  flex-direction: column;
}
.lb-uploader { font-size: 0.95rem; font-weight: 600; color: #fff; }
.lb-date { font-size: 0.75rem; color: var(--text-muted); }
.lightbox-header-actions { display: flex; gap: 8px; }
.lb-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
}
.lb-close { font-size: 1.1rem; padding: 6px 10px; }

.lightbox-viewport {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lightbox-media-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-media-wrapper img, .lightbox-media-wrapper video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lightbox-bottom {
  position: relative;
  z-index: 10;
  padding: 12px 16px calc(16px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reactions-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.reaction-pill {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.reaction-pill.reacted {
  background: var(--text-accent);
  color: #000;
  font-weight: 600;
}
.comment-trigger-wrapper {
  display: flex;
  gap: 8px;
}
.comment-trigger-wrapper input {
  margin-bottom: 0;
  border-radius: var(--radius-full);
}

/* Details Drawer */
.details-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 18, 22, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border);
  z-index: 50;
  max-height: 70vh;
  overflow-y: auto;
  padding: 16px 20px calc(20px + var(--safe-bottom));
}
.drawer-handle {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  margin: 0 auto 16px;
  cursor: pointer;
}
.exif-grid p {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-main);
}
.exif-grid b { color: var(--text-muted); font-weight: 500; }
.drawer-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.comment-item {
  font-size: 0.85rem;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(90px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 24, 0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 3000;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h2 { font-size: 1.2rem; color: var(--text-main); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; max-width: 320px; margin: 0 auto; line-height: 1.5; }
