:root {
  --bg-main: #0c0818;
  --bg-surface: #140e28;
  --bg-card: rgba(26, 17, 48, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(249, 115, 22, 0.6);
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-gradient: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%);
  --accent-cyan: #06b6d4;
  --accent-magenta: #ec4899;
  --accent-purple: #8b5cf6;
  --accent-gold: #fbbf24;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --text-main: #fdf4ff;
  --text-muted: #c4b5fd;
  --text-subtle: #8375a3;
  --glass-bg: rgba(14, 10, 28, 0.88);
  --glass-border: rgba(249, 115, 22, 0.18);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.6);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 50% -20%, rgba(139, 92, 246, 0.25) 0%, transparent 60%),
    radial-gradient(circle at 10% 20%, rgba(249, 115, 22, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 90% 40%, rgba(236, 72, 153, 0.12) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Nav */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 28px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  gap: 16px;
  min-height: 90px;
}

.nav-left .brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo {
  height: 80px;
  width: auto;
  max-width: 190px;
  border-radius: 14px;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(249, 115, 22, 0.4)) drop-shadow(0 2px 10px rgba(236, 72, 153, 0.3));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 26px rgba(249, 115, 22, 0.65)) drop-shadow(0 2px 14px rgba(236, 72, 153, 0.45));
}

.nav-center {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 18px rgba(249, 115, 22, 0.45);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 9px 16px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  width: 220px;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.25);
  width: 260px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(249, 115, 22, 0.55);
  filter: brightness(1.08);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(249, 115, 22, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Main Content Views */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Timeline Date Grouping */
.timeline-section {
  margin-bottom: 32px;
}

.timeline-header {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.photo-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-fav-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  color: #f43f5e;
  border-radius: var(--radius-full);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-card.selected {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

/* Albums Grid */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.album-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.album-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
}

.album-cover {
  aspect-ratio: 16/10;
  background: #1e293b;
  position: relative;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-info {
  padding: 16px;
}

.album-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.album-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  padding: 28px;
}

/* Auth / Avatar Selection */
.auth-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.auth-users-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.user-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-choice-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  transform: scale(1.03);
}

.choice-avatar {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.choice-name {
  font-weight: 700;
  font-size: 1rem;
}

/* PIN Pad */
.pin-pad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pin-header {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
  margin-bottom: 20px;
}

.pin-target-name {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
}

.pin-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.pin-dots .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.pin-dots .dot.filled {
  background: var(--primary);
  transform: scale(1.15);
  box-shadow: 0 0 12px var(--primary);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 300px;
}

.pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pin-key:hover:not(.empty) {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.pin-key:active:not(.empty) {
  transform: scale(0.95);
  background: var(--primary);
}

.pin-key.empty {
  border: none;
  background: transparent;
  cursor: default;
}

.pin-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 14px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin-bottom: 12px;
}

.dropzone-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.upload-progress-container {
  margin-top: 20px;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.2s ease;
}

.upload-status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* Batch Action Bar */
.batch-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 150;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translate(-50%, 60px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  z-index: 300;
  display: flex;
  flex-direction: column;
}

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px;
}

.lightbox-stage img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 310;
}

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

.lightbox-btn.close-btn { top: 20px; right: 20px; }
.lightbox-btn.prev-btn { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-btn.next-btn { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox-bar {
  padding: 16px 28px;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-info .photo-date {
  font-weight: 700;
  font-size: 1rem;
}

.lightbox-info .photo-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.lightbox-tools {
  display: flex;
  gap: 10px;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-tool.text-danger {
  color: #f87171;
}

.hidden {
  display: none !important;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .top-nav {
    padding: 10px 14px;
  }
  .search-box, .btn-text {
    display: none;
  }
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .photo-card {
    border-radius: 4px;
  }
  .lightbox-stage {
    padding: 10px;
  }
  .lightbox-btn.prev-btn, .lightbox-btn.next-btn {
    display: none;
  }
}
/* Checkbox selection overlay on photo cards */
.photo-select-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  color: #fff;
  opacity: 0;
  transition: all 0.15s ease;
  z-index: 10;
}

.photo-card:hover .photo-select-checkbox,
.photo-select-checkbox.checked,
.photo-card.selected .photo-select-checkbox {
  opacity: 1;
}

.photo-select-checkbox.checked {
  background: var(--primary);
  border-color: #fff;
  box-shadow: 0 0 10px var(--primary);
}

.photo-contributor-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: #a5b4fc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
/* Enhanced & Spacious Inline Dropzone */
.inline-dropzone {
  background: rgba(26, 17, 48, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px dashed rgba(249, 115, 22, 0.35);
  border-radius: var(--radius-lg);
  padding: 42px 32px;
  min-height: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  margin-bottom: 36px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.inline-dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(249, 115, 22, 0.1) 0%, rgba(236, 72, 153, 0.05) 50%, transparent 80%);
  pointer-events: none;
}

.inline-dropzone:hover, .inline-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(36, 22, 68, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(249, 115, 22, 0.25), 0 0 20px rgba(236, 72, 153, 0.2);
}

.drop-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 600px;
}

.drop-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(236, 72, 153, 0.25));
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 1px solid rgba(249, 115, 22, 0.45);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
  transition: transform 0.2s ease;
}

.inline-dropzone:hover .drop-icon-wrap {
  transform: scale(1.08);
}

.drop-primary-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.drop-secondary-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.inline-progress-wrap {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 8px;
  width: 100%;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.inline-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #8b5cf6, #ec4899, #f97316);
  width: 0%;
  transition: width 0.2s ease;
}

/* Fullscreen Window Drag & Drop Overlay */
.window-drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 8, 24, 0.88);
  backdrop-filter: blur(18px);
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px dashed var(--primary);
  pointer-events: none;
  animation: fadeIn 0.15s ease;
}

.window-drop-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin-top: 16px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
