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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2e2e2e;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #e85d04;
  --accent-hover: #f48c06;
  --danger: #c0392b;
  --warning: #e67e22;
  --success: #27ae60;
  --radius: 6px;
  --font: system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.navbar-brand { font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.nav-links { list-style: none; display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text); font-size: 0.9rem; }
.nav-links a:hover { color: var(--accent); }

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

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 1.75rem; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge--active { background: #1a3a1a; color: var(--success); }
.badge--sold { background: #1a1a3a; color: #5b8dee; }
.badge--donated { background: #3a1a3a; color: #c07ec0; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: var(--border); color: var(--text); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #a93226; color: #fff; }
.btn--warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn--sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert--error { background: #2d1010; color: #f5a0a0; border: 1px solid #6b2020; }

/* ProdJex Grid */
.prodjex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.prodjex-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.prodjex-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.prodjex-card__image { aspect-ratio: 16/9; overflow: hidden; }
.prodjex-card__image img { width: 100%; height: 100%; object-fit: cover; }
.prodjex-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.prodjex-card__body { padding: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.prodjex-card__body h2 { font-size: 1.1rem; }
.prodjex-card__title { color: var(--muted); font-size: 0.9rem; }
.prodjex-card__date { color: var(--muted); font-size: 0.8rem; }

/* ProdJex Hero */
.prodjex-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: start;
}
@media (max-width: 700px) { .prodjex-hero { grid-template-columns: 1fr; } }

.prodjex-hero__image { width: 100%; border-radius: var(--radius); object-fit: cover; }
.prodjex-hero__info { display: flex; flex-direction: column; gap: 0.75rem; }
.prodjex-hero__info h1 { font-size: 1.75rem; }
.prodjex-subtitle { color: var(--muted); }
.status-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; font-size: 0.9rem; }

/* ProdJex description */
.prodjex-description {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}
.prodjex-description h1,.prodjex-description h2,.prodjex-description h3 { margin: 1rem 0 0.5rem; }
.prodjex-description p { margin-bottom: 0.75rem; }
.prodjex-description code { background: var(--border); padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.9em; }
.prodjex-description pre { background: var(--border); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }

/* Update feed */
.update-feed h2 { font-size: 1.4rem; margin-bottom: 1.5rem; }

.update-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.update-post__header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.update-post__header h3 { font-size: 1.1rem; }
.update-post__header time { color: var(--muted); font-size: 0.85rem; }
.update-post__body { line-height: 1.8; }
.update-post__body p { margin-bottom: 0.75rem; }
.update-post__images { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.update-post__images img { max-width: 100%; width: 200px; height: 150px; object-fit: cover; border-radius: var(--radius); cursor: pointer; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--surface); color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
.admin-table tr:hover td { background: #ffffff08; }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Forms */
.form, .auth-form { max-width: 720px; }
.auth-form { max-width: 400px; margin: 3rem auto; }
.auth-form h1 { margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; color: var(--muted); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 200px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

.status-fields { margin-top: 0.5rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ProdJex hero media */
.prodjex-hero__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: var(--border); cursor: pointer; }
.prodjex-hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.prodjex-hero__media:hover img { transform: scale(1.02); }
.prodjex-hero__media--placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.9rem; }

/* Media sections */
.media-section { margin-bottom: 2.5rem; }
.media-section__title { font-size: 1.2rem; margin-bottom: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; }

/* Photo gallery */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}
.photo-gallery__item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--border);
}
.photo-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.photo-gallery__item:hover img { transform: scale(1.05); }
.photo-gallery__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.photo-gallery__item:hover .photo-gallery__overlay { opacity: 1; }

/* Video gallery */
.video-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.video-gallery__item { border-radius: var(--radius); overflow: hidden; background: #000; }
.video-player { width: 100%; display: block; border-radius: var(--radius); max-height: 360px; }
.video-player--post { width: 100%; max-height: 280px; border-radius: var(--radius); display: block; }

/* Update post images / videos */
.update-post__images { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.update-post__image-wrap {
  width: 160px;
  height: 120px;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--border);
  flex-shrink: 0;
}
.update-post__image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.update-post__image-wrap:hover img { transform: scale(1.05); }
.update-post__videos { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.is-open { display: flex; }
.lightbox__img { max-width: 90vw; max-height: 88vh; object-fit: contain; border-radius: var(--radius); user-select: none; }
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}
.lightbox__close:hover { opacity: 1; }
.lightbox__prev, .lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 3rem;
  line-height: 1;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  border-radius: var(--radius);
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.lightbox__prev:hover, .lightbox__next:hover { opacity: 1; background: rgba(255,255,255,0.2); }
.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }
.lightbox__prev.hidden, .lightbox__next.hidden { display: none; }

/* Upload controls */
.upload-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.4rem; }
.upload-status { font-size: 0.85rem; }
.upload-status--ok { color: var(--success); }
.upload-status--error { color: #f5a0a0; }

/* Misc */
.empty-state { color: var(--muted); font-style: italic; text-align: center; padding: 3rem 0; }
.cover-preview { display: block; max-width: 300px; border-radius: var(--radius); margin-bottom: 0.75rem; }
.post-images { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.post-image-thumb { width: 100px; height: 75px; object-fit: cover; border-radius: var(--radius); }
.post-videos { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }
.form + .form { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
