/* ============================================
   PhotoGallery — Tabler Overrides & Custom
   Palette: Soft Indigo + Warm Gray
   ============================================ */

:root {
  /* Palette */
  --tblr-primary: #6366f1;
  --tblr-primary-rgb: 99, 102, 241;
  --tblr-font-sans-serif: 'Source Sans 3', sans-serif;
  --tblr-body-bg: #f5f5f4;
  --tblr-body-color: #334155;
  --tblr-border-color: #e7e5e4;

  /* App tokens */
  --pg-primary: #6366f1;
  --pg-primary-hover: #4f46e5;
  --pg-primary-subtle: #eef2ff;
  --pg-bg: #f5f5f4;
  --pg-surface: #ffffff;
  --pg-border: #e7e5e4;
  --pg-text: #334155;
  --pg-text-heading: #1e293b;
  --pg-text-muted: #94a3b8;
  --pg-success: #16a34a;
  --pg-danger: #dc2626;
  --pg-warning: #d97706;
  --pg-info: #0891b2;
  --pg-font-display: 'Nunito', sans-serif;
}

/* Headings use Nunito */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--pg-font-display);
  color: var(--pg-text-heading);
}

/* Navbar brand */
.navbar-brand {
  font-family: var(--pg-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--pg-primary) !important;
}

/* Primary button overrides */
.btn-primary {
  --tblr-btn-bg: var(--pg-primary);
  --tblr-btn-border-color: var(--pg-primary);
  --tblr-btn-hover-bg: var(--pg-primary-hover);
  --tblr-btn-hover-border-color: var(--pg-primary-hover);
}
.btn-outline-primary {
  --tblr-btn-color: var(--pg-primary);
  --tblr-btn-border-color: var(--pg-primary);
  --tblr-btn-hover-bg: var(--pg-primary);
  --tblr-btn-hover-border-color: var(--pg-primary);
}
a { color: var(--pg-primary); }
a:hover { color: var(--pg-primary-hover); }

/* Badge pill for keywords */
.badge-keyword {
  background: var(--pg-primary-subtle);
  color: var(--pg-primary);
  font-weight: 500;
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: 0.375rem;
  overflow: hidden;
  background: var(--pg-border);
  display: block;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.photo-thumb:hover img { transform: scale(1.05); }

/* Space cards */
.space-card-cover {
  height: 160px;
  background: var(--pg-primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.space-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.space-card-placeholder {
  font-family: var(--pg-font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--pg-primary);
}

/* Photo detail layout */
.photo-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .photo-detail-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* Doodle overlay */
.photo-doodle-container {
  position: relative;
  display: inline-block;
  width: 100%;
}
.photo-doodle-container img {
  width: 100%;
  border-radius: 0.375rem;
}
#doodle-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--pg-border);
  border-radius: 0.5rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.upload-zone:hover,
.upload-zone.active {
  border-color: var(--pg-primary);
  background: var(--pg-primary-subtle);
}
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.upload-preview__item {
  width: 80px;
  height: 80px;
  border-radius: 0.25rem;
  overflow: hidden;
}
.upload-preview__item img { width: 100%; height: 100%; object-fit: cover; }

/* Duplicate review */
.dup-photo {
  flex: 0 0 150px;
  position: relative;
  border: 2px solid transparent;
  border-radius: 0.375rem;
  overflow: hidden;
  transition: border-color 0.15s, opacity 0.15s;
}
.dup-photo.marked {
  border-color: var(--pg-danger);
  opacity: 0.5;
}
.dup-photo img {
  width: 150px;
  height: 150px;
  object-fit: cover;
}
@media (max-width: 768px) {
  .dup-photo { flex: 0 0 120px; }
  .dup-photo img { width: 120px; height: 120px; }
}

/* Keyword picker (JS widget) */
.keyword-picker {
  position: relative;
}
.keyword-picker .dropdown-menu {
  max-height: 200px;
  overflow-y: auto;
}

/* Filter bar */
.filter-bar-mobile { display: none; }
@media (max-width: 768px) {
  .filter-bar-desktop { display: none !important; }
  .filter-bar-mobile { display: block; }
}
@media (min-width: 769px) {
  .filter-bar-mobile { display: none; }
}

/* Bottom sheet for mobile filters */
.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  border: none;
  border-radius: 1rem 1rem 0 0;
  max-height: 70vh;
  width: 100%;
  max-width: 100%;
  padding: 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 1050;
}
.bottom-sheet::backdrop { background: rgba(0,0,0,0.4); }

/* Empty state */
.empty-state-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 1rem;
}

/* Shared view (public, no-auth page) */
.shared-photo-img {
  max-height: 80vh;
  margin: 0 auto;
  border-radius: 0.375rem;
}

/* Auth pages */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pg-bg);
}

/* Slider / range input */
input[type="range"] {
  accent-color: var(--pg-primary);
}

/* Progress bar override */
.progress-bar {
  background-color: var(--pg-primary);
}
