/* ExifTree — minimal, image-forward design */

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #e8a820;
  --accent-hover: #f0be44;
  --radius: 6px;
  --max-width: 1200px;
}

[x-cloak] { display: none !important; }
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); }

.nav-auth { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.nav-guest { display: flex; gap: 1rem; align-items: center; font-size: 0.9rem; }

/* User dropdown */
.nav-user-dropdown { position: relative; }
.nav-user-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.15s;
}
.nav-user-btn:hover { border-color: var(--text-muted); }
.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  padding: 0.5rem 0;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
}
.dropdown-menu a:hover { background: var(--border); color: var(--text); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 0.25rem 0; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { border-color: var(--text-muted); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #000; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 2rem; flex: 1; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.page-header p { color: var(--text-muted); margin-top: 0.25rem; }

/* Image grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.image-card {
  display: block;
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.15s;
}
.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-card:hover, .image-card-selected, .image-card-focused { transform: scale(1.02); }
.image-card-focused { outline: 2px solid var(--accent); outline-offset: 2px; }
.image-card-selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.image-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.6rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: rgba(255,255,255,0.75);
  font-size: 0.75rem;
  line-height: 1.4;
}
.image-card .overlay a.overlay-link { color: rgba(255,255,255,0.85); }
.image-card .overlay a.overlay-link:hover { color: var(--accent); }
.image-card-user {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.image-card-user:hover { color: var(--accent); }

/* Gear grid */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) { .gear-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .gear-grid { grid-template-columns: 1fr; } }

.gear-card {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.gear-card:hover, .gear-card-focused { border-color: var(--text-muted); }
.gear-card-focused { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Brand filter pills */
.brand-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.brand-pill:hover { border-color: var(--text-muted); color: var(--text); }
.brand-pill-active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.brand-pill-active:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.gear-card h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.gear-card .count { color: var(--text-muted); font-size: 0.85rem; }

/* Group cards */
.group-card {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.group-card h3 { margin-bottom: 0.25rem; }
.group-card .desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.group-card .stats { color: var(--text-muted); font-size: 0.8rem; }

/* Profile */
.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2rem;
}
.profile-header .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
}
.profile-header h1 { font-size: 1.5rem; }
.profile-header .bio { color: var(--text-muted); }

/* EXIF detail bar */
.exif-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 1rem 0;
  font-size: 0.85rem;
}
.exif-bar .exif-item { display: flex; flex-direction: column; }
.exif-bar .exif-label { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
@media (max-width: 640px) {
  .exif-bar { gap: 0.75rem 1.25rem; font-size: 0.8rem; }
  .exif-bar .exif-label { font-size: 0.65rem; }
}

/* Search */
.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  align-items: end;
}
.search-form .field { display: flex; flex-direction: column; gap: 0.25rem; }
.search-form label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.search-form input, .search-form select {
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}
.search-form input:focus, .search-form select:focus { outline: none; border-color: var(--accent); }

/* Auth forms */
.auth-form {
  max-width: 400px;
  margin: 3rem auto;
}
.auth-form h1 { margin-bottom: 1.5rem; text-align: center; }
.auth-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}
.auth-form label { font-size: 0.85rem; color: var(--text-muted); }
.auth-form input {
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form .btn { width: 100%; padding: 0.7rem; font-size: 1rem; margin-top: 0.5rem; }
.auth-form .alt { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }

/* Upload */
.upload-page { min-height: 70vh; position: relative; }
.upload-dropoverlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(232, 168, 32, 0.08);
  border: 3px dashed var(--accent);
  z-index: 999;
  pointer-events: none;
  align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--accent); font-weight: 700;
}
.upload-page-dragover .upload-dropoverlay { display: flex; }
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 6rem 3rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  margin-bottom: 2rem;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.upload-page-dragover .upload-zone { border-color: var(--accent); background: rgba(74, 158, 255, 0.08); }
.upload-zone:hover { border-color: var(--accent); }
.upload-zone p { color: var(--text-muted); }

.upload-queue { display: flex; flex-direction: column; gap: 0.5rem; }
.upload-item {
  position: relative;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem; overflow: hidden;
}
.upload-item-info { display: flex; gap: 0.75rem; align-items: center; min-width: 0; flex: 1; }
.upload-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-size { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.upload-item-right { white-space: nowrap; font-size: 0.85rem; }
.upload-done { border-color: #4c4; }
.upload-error { border-color: #f44; }

.upload-progress-track {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--border);
}
.upload-progress-bar {
  height: 100%; background: var(--accent); transition: width 0.15s;
}
.upload-progress-done { background: #4c4; }

/* Members list */
.member-list { list-style: none; }
.member-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.member-list .role { color: var(--text-muted); font-size: 0.8rem; }

/* Collection grid */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) { .collection-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .collection-grid { grid-template-columns: 1fr; } }

.collection-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: border-color 0.15s;
}
.collection-card:hover { border-color: var(--text-muted); color: inherit; }

.collection-card-image {
  aspect-ratio: 1;
  background: var(--bg);
  overflow: hidden;
}
.collection-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.collection-card-info {
  padding: 0.75rem 1rem;
}
.collection-card-info h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.collection-card-info .count { color: var(--text-muted); font-size: 0.85rem; }

/* Collection detail */
.collection-header { margin-bottom: 2rem; }
.collection-header h1 { margin-bottom: 0.25rem; }
.collection-header .desc { color: var(--text-muted); }

/* Lightbox */
.lightbox {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95); z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem;
}
.lightbox img {
  max-width: 100%; max-height: 70vh; object-fit: contain;
  border-radius: var(--radius);
}
.lightbox-info {
  margin-top: 1rem; text-align: center; max-width: 800px;
}
.lightbox-exif {
  display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem;
}
.lightbox-exif .exif-item { display: flex; flex-direction: column; align-items: center; }
.lightbox-exif .exif-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.lightbox-exif .exif-value { color: var(--text); }
.lightbox-user { font-size: 0.9rem; margin-top: 0.5rem; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.5rem;
  background: none; border: none; color: var(--text-muted); font-size: 2rem;
  cursor: pointer; line-height: 1;
}
.lightbox-close:hover { color: var(--text); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1); border: none; color: var(--text);
  font-size: 2rem; padding: 0.5rem 1rem; cursor: pointer; border-radius: var(--radius);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-link {
  display: inline-block; margin-top: 0.75rem; font-size: 0.8rem;
  color: var(--accent); border: 1px solid var(--border); padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
}
.lightbox-link:hover { border-color: var(--accent); }

/* Photo manager */
.manage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.manage-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 4px;
}
@media (max-width: 768px) { .manage-grid { grid-template-columns: repeat(3, 1fr); } }

.manage-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  transition: transform 0.1s;
  min-width: 0;
}
.manage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.manage-item:hover { transform: scale(1.02); }
.manage-item-selected {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.manage-item-selected:hover { transform: none; }

.manage-check {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #000;
  font-weight: 700;
  transition: all 0.1s;
}
.manage-check-on {
  background: var(--accent);
  border-color: var(--accent);
}

.manage-vis-badge {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.vis-private { background: #d33; color: #fff; }
.vis-unlisted { background: #c80; color: #fff; }

/* Tag cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
  line-height: 1.8;
}

.tag-cloud-item {
  color: var(--text-muted);
  transition: color 0.15s;
  white-space: nowrap;
}
.tag-cloud-item:hover { color: var(--accent); }

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.15s;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); }

.tag-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  min-width: 1.2rem;
  text-align: center;
}

/* Footer */
.site-footer {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Empty states */
.empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Loading */
.htmx-indicator { opacity: 0; transition: opacity 0.2s; }
.htmx-request .htmx-indicator { opacity: 1; }

/* Responsive */
@media (max-width: 768px) {
  .site-nav { flex-wrap: wrap; padding: 0.75rem 1rem; gap: 0.75rem; }
  .nav-links { gap: 0.75rem; font-size: 0.8rem; }
  .container { padding: 1rem; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
  .image-card .overlay { display: none; }
  .profile-header { flex-direction: column; text-align: center; }
}
