/* ============================================
   Gallery styles — dark theme
   ============================================ */

* { box-sizing: border-box; }

body, .gallery-page {
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #020617;
  color: #e5e7eb;
  margin: 0;
  padding: 0;
}

a { color: inherit; }

.gallery-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

/* ---- Header ---- */
.gallery-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #1e293b;
}
.gallery-header h1 {
  font-size: 42px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  font-weight: 700;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.gallery-header .sub {
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
}
.gallery-header .user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5f5;
}
.gallery-header .user-chip img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---- Top action bar (filters + upload CTA) ---- */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filters a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #1e293b;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  color: #cbd5f5;
  background: #0b1220;
  transition: all .15s ease;
}
.filters a:hover { border-color: #38bdf8; color: #fff; }
.filters a.active {
  background: linear-gradient(135deg, #22c55e, #38bdf8);
  color: #001;
  border-color: transparent;
  font-weight: 600;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #38bdf8);
  color: #001;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: .25s;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.18);
}
.btn-primary:hover { transform: scale(1.03); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #0b1220;
  color: #cbd5f5;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: .2s;
}
.btn-secondary:hover { border-color: #38bdf8; color: #fff; }

.login-prompt {
  background: #0b1220;
  border: 1px dashed #1e293b;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 32px;
  text-align: center;
  font-size: 14px;
  color: #94a3b8;
}
.login-prompt a {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
}

/* ---- Masonry grid (CSS columns) ---- */
.isotope-container {
  column-count: 5;
  column-gap: 8px;
  margin: 0;
}
.isotope-container .item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 8px;
  display: block;
  width: 100%;
  padding: 0;
}
@media (max-width: 1200px) { .isotope-container { column-count: 4; } }
@media (max-width: 900px)  { .isotope-container { column-count: 3; } }
@media (max-width: 640px)  { .isotope-container { column-count: 2; column-gap: 6px; } .isotope-container .item { margin-bottom: 6px; } }
@media (max-width: 380px)  { .isotope-container { column-count: 2; column-gap: 4px; } .isotope-container .item { margin-bottom: 4px; } }

.item .thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #0b1220;
}
.img-fluid {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  transition: transform .5s ease;
}
.item .thumb:hover .img-fluid { transform: scale(1.03); }

.item .meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 14px 12px;
  background: linear-gradient(to top, rgba(2,6,23,.85), rgba(2,6,23,0));
  color: #fff;
  opacity: 0;
  transition: opacity .25s ease;
}
.item .thumb:hover .meta { opacity: 1; }
.item .meta .t { font-size: 14px; font-weight: 600; }
.item .meta .c {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .12em; opacity: .8; margin-top: 2px;
  color: #38bdf8;
}

.item .delete-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(2, 6, 23, .85);
  color: #fff;
  border: 1px solid #1e293b;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
}
.item .thumb:hover .delete-btn { opacity: 1; }
.item .delete-btn:hover { background: #ef4444; border-color: #ef4444; }

.empty {
  padding: 80px 20px;
  text-align: center;
  color: #64748b;
  border: 1px dashed #1e293b;
  border-radius: 12px;
}

/* ============================================
   gallery_upload.php — upload form page
   ============================================ */
.section {
  padding: 60px 20px;
  text-align: center;
}
.section h1 {
  font-size: 42px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.section .sub {
  color: #94a3b8;
  font-size: 14px;
  margin: 0 0 8px;
}

.contact-box {
  max-width: 520px;
  margin: 36px auto;
  background: #111827;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  text-align: left;
}
.contact-box label {
  display: block;
  text-align: left;
  margin-top: 16px;
  font-size: 14px;
  color: #cbd5f5;
}
.contact-box input,
.contact-box textarea,
.contact-box select {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border-radius: 10px;
  border: none;
  background: #020617;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
.contact-box textarea {
  min-height: 100px;
  resize: vertical;
}
.contact-box input[type=file] {
  padding: 10px;
  background: #020617;
  color: #cbd5f5;
}
.contact-box button {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #38bdf8);
  color: #001;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: .3s;
}
.contact-box button:hover { transform: scale(1.03); }
.contact-box .err {
  color: #fca5a5;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
}
.contact-box .hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 10px;
  text-align: center;
}
.image-preview {
  width: 100%;
  margin-top: 12px;
  border-radius: 10px;
  display: none;
  max-height: 320px;
  object-fit: cover;
}

/* ============================================
   gallery_view.php
   ============================================ */
.view-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
}
.back-link:hover { color: #38bdf8; }

.view-hero {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 28px;
}
.view-hero img {
  width: 100%;
  height: auto;
  display: block;
}
.view-info { padding: 24px 28px; }
.view-info .cat {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #38bdf8;
  margin-bottom: 8px;
}
.view-info h2 {
  font-size: 28px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: #fff;
}
.view-info p {
  color: #cbd5f5;
  line-height: 1.7;
  margin: 0 0 12px;
  white-space: pre-wrap;
}
.view-info .stamp {
  font-size: 12px;
  color: #64748b;
}

/* ---- Comments ---- */
.comments-section {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 28px;
}
.comments-section h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}
.comment-form {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #1e293b;
}
.comment-form .avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #0b1220;
  flex-shrink: 0;
  object-fit: cover;
}
.comment-form .input-stack { flex: 1; }
.comment-form textarea {
  width: 100%;
  border: none;
  background: #020617;
  color: #fff;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}
.comment-form .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 8px;
}
.comment-form .row .me {
  display: inline-flex; align-items: center; gap: 6px;
}
.comment-form button {
  padding: 10px 22px;
  background: linear-gradient(135deg, #22c55e, #38bdf8);
  color: #001;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}
.comment-form button:hover:not(:disabled) { transform: scale(1.03); }

.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #1e293b;
}
.comment-item:last-child { border-bottom: none; }
.comment-item .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #0b1220;
}
.comment-item .body { flex: 1; }
.comment-item .name {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
}
.comment-item .when {
  color: #64748b;
  font-size: 11px;
  margin-left: 6px;
}
.comment-item .text {
  font-size: 14px;
  color: #cbd5f5;
  line-height: 1.6;
  margin-top: 2px;
  white-space: pre-wrap;
}
.no-comments {
  text-align: center;
  color: #64748b;
  padding: 24px 0;
  font-size: 14px;
}
