/* ============================================================
   FOTO GALERİ — Main Stylesheet
   Mobile-first · Coffee tones · QR-code optimised UX
   ============================================================ */

/* ── Reset & Tokens ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-900: #1a0f00;
  --c-800: #2c1a00;
  --c-700: #4a2e00;
  --c-500: #8b5e3c;
  --c-300: #c4955a;
  --c-100: #f5ece2;
  --cream: #fdf8f3;
  --gold:  #c9973a;
  --white: #ffffff;

  --text:   #2c1a00;
  --muted:  #7a5c3e;
  --border: #e8d5be;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  --sh-sm: 0 1px 4px  rgba(44,26,0,.08);
  --sh-md: 0 4px 20px rgba(44,26,0,.12);
  --sh-lg: 0 12px 48px rgba(44,26,0,.22);

  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: .2s ease;
}

html { scroll-behavior: smooth; }

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

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253,248,243,.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--c-800);
  letter-spacing: .02em;
  display: flex;
  align-items: center;
}
.nav-logo {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}
.nav-link {
  font-size: .88rem;
  font-weight: 500;
  color: var(--c-500);
  padding: .38rem .8rem;
  border-radius: var(--r-sm);
  transition: background var(--ease), color var(--ease);
}
.nav-link:hover { background: var(--c-100); color: var(--c-800); }
.nav-actions { display: flex; gap: .4rem; align-items: center; }
.nav-logout  { color: #c0392b; }
.nav-logout:hover { background: #fdecea; color: #c0392b; }

/* ── Hero — compact for QR-code flow ──────────────────────── */
.hero {
  background:
    linear-gradient(160deg, rgba(26,15,0,.75) 0%, rgba(74,46,0,.58) 100%),
    linear-gradient(135deg, #3e2000 0%, #7a4010 50%, #c4955a 100%);
  padding: 2rem 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-content {
  max-width: 560px;
  text-align: center;
  color: var(--white);
}
.hero-content h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: .6rem;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.hero-content p {
  font-size: .95rem;
  opacity: .88;
  max-width: 420px;
  margin: 0 auto;
}

/* ── Upload Section ────────────────────────────────────────── */
.upload-section { flex: 1; padding: 1.75rem 1.25rem 3.5rem; }

.container { max-width: 620px; margin: 0 auto; }

.upload-card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: 2rem 1.75rem;
}
.upload-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--c-800);
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: var(--r-md);
  margin-bottom: 1.25rem;
  font-size: .88rem;
}
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: .1rem; }
.alert-error   { background: #fff2f2; border: 1px solid #ffbcbc; color: #c0392b; }
.alert-success { background: #f0faf4; border: 1px solid #a8e6be; color: #1d6f42; }

/* ── Drop Zone ─────────────────────────────────────────────── */
.drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 2.25rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
  margin-bottom: 1.25rem;
  background: var(--c-100);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--gold);
  background: #fdf3e3;
  box-shadow: 0 0 0 4px rgba(201,151,58,.12);
}

.drop-zone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.drop-icon { font-size: 2.6rem; margin-bottom: .65rem; }
.drop-zone-prompt p     { font-weight: 600; color: var(--c-700); margin-bottom: .2rem; font-size: .95rem; }
.drop-zone-prompt small { color: var(--muted); font-size: .8rem; }

/* Preview inside drop zone */
.drop-zone-preview { position: relative; z-index: 1; }
.drop-zone-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--r-sm);
  margin-bottom: .65rem;
  background: var(--c-800);
}
.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
#preview-filename { font-size: .8rem; color: var(--muted); word-break: break-all; }
.btn-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .28rem .65rem;
  font-size: .78rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--ease), color var(--ease);
}
.btn-remove:hover { border-color: #c0392b; color: #c0392b; }

/* ── Form Groups ───────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--c-700);
  margin-bottom: .35rem;
}
.optional { font-weight: 400; color: var(--muted); font-size: .78rem; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: .7rem .95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: .95rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color var(--ease), box-shadow var(--ease);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,151,58,.14);
}
.char-count {
  display: block;
  text-align: right;
  font-size: .76rem;
  color: var(--muted);
  margin-top: .25rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--c-700);
  color: var(--white);
  font-weight: 700;
  font-size: .95rem;
  padding: .85rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(74,46,0,.2);
  transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover  { background: var(--c-800); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(74,46,0,.28); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--c-700);
  font-weight: 600;
  font-size: .95rem;
  padding: .85rem 2rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { background: var(--c-100); border-color: var(--c-300); }

.btn-full { width: 100%; }

/* ── Success Box ───────────────────────────────────────────── */
.success-box { text-align: center; padding: 1.75rem 1rem; }
.success-icon {
  width: 60px; height: 60px;
  background: #e6f7ed;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  color: #27ae60;
  margin: 0 auto .9rem;
}
.success-box h3 { font-size: 1.2rem; margin-bottom: .4rem; color: var(--c-800); }
.success-box p  { color: var(--muted); font-size: .9rem; }
.success-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

/* ── Gallery ───────────────────────────────────────────────── */
.gallery-section { padding: 2rem 1rem 4rem; }
.gallery-container { max-width: 1200px; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.section-header h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--c-800);
}
.photo-count { color: var(--muted); font-size: .88rem; }

/* Masonry via CSS columns */
.gallery-masonry {
  columns: 2;
  column-gap: .85rem;
}
.gallery-item {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: .85rem;
  background: var(--white);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }

.gallery-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--c-100);
  line-height: 0;
}
.gallery-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .35s ease;
}
.gallery-item:hover .gallery-img-wrap img { transform: scale(1.04); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,15,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--ease);
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.overlay-zoom { font-size: 1.75rem; }

.gallery-meta    { padding: .65rem .85rem .8rem; }
.gallery-name    { display: block; font-size: .85rem; font-weight: 600; color: var(--c-800); margin-bottom: .15rem; }
.gallery-caption {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Empty State */
.empty-state { text-align: center; padding: 4.5rem 1rem; }
.empty-icon  { font-size: 3.5rem; margin-bottom: .9rem; opacity: .45; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: .45rem; color: var(--c-700); }
.empty-state p  { color: var(--muted); margin-bottom: 1.4rem; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .7rem;
  border-radius: var(--r-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--c-700);
  background: var(--white);
  border: 1.5px solid var(--border);
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.page-btn:hover         { background: var(--c-100); border-color: var(--c-300); }
.page-btn--active       { background: var(--c-700); color: var(--white); border-color: var(--c-700); }
.page-btn--active:hover { background: var(--c-800); border-color: var(--c-800); }
.page-dots { color: var(--muted); font-size: .88rem; padding: 0 .25rem; }

/* ── Lightbox Modal ────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.active { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,15,0,.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-content {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  max-width: min(92vw, 900px);
  max-height: 92vh;
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
}
.modal-content img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #111;
  display: block;
}
.modal-close {
  position: absolute;
  top: .65rem; right: .65rem;
  z-index: 2;
  background: rgba(255,255,255,.92);
  border: none;
  border-radius: 50%;
  width: 38px; height: 38px;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-800);
  box-shadow: var(--sh-sm);
  transition: background var(--ease);
}
.modal-close:hover { background: var(--c-100); }
.modal-info { padding: .9rem 1.1rem; }
.modal-info strong { display: block; font-size: .95rem; font-weight: 700; color: var(--c-800); margin-bottom: .2rem; }
.modal-info p      { font-size: .85rem; color: var(--muted); }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  padding: 1.4rem 1.25rem;
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Admin ─────────────────────────────────────────────────── */
.admin-body { background: #f6f1eb; }

.admin-navbar { background: var(--c-800); border-bottom-color: var(--c-700); }
.admin-navbar .nav-brand { color: var(--white); }
.admin-navbar .nav-link  { color: rgba(255,255,255,.75); }
.admin-navbar .nav-link:hover { background: rgba(255,255,255,.1); color: var(--white); }
.admin-navbar .nav-logout       { color: #ff8a80; }
.admin-navbar .nav-logout:hover { background: rgba(255,138,128,.12); color: #ff8a80; }

.admin-main { padding: 2rem 1.25rem 4rem; }
.admin-main .container { max-width: 1200px; }

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .85rem;
  margin-bottom: 2.25rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 1.15rem 1rem;
  text-align: center;
  box-shadow: var(--sh-sm);
}
.stat-num            { font-size: 2.1rem; font-weight: 800; line-height: 1; margin-bottom: .25rem; color: var(--c-700); }
.stat-num--pending   { color: #e67e22; }
.stat-num--approved  { color: #27ae60; }
.stat-num--rejected  { color: #c0392b; }
.stat-label          { font-size: .8rem; color: var(--muted); font-weight: 500; }

.admin-section { margin-bottom: 2.75rem; }
.admin-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-800);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px; height: 22px;
  border-radius: 50px;
  font-size: .73rem;
  font-weight: 700;
  padding: 0 6px;
}
.badge--pending  { background: #fef3e2; color: #e67e22; }
.badge--approved { background: #e6f7ed; color: #27ae60; }
.badge--rejected { background: #fdecea; color: #c0392b; }
.empty-state-sm  { color: var(--muted); font-size: .88rem; padding: .75rem 0; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.admin-card {
  background: var(--white);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
}
.admin-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--c-100);
  overflow: hidden;
}
.admin-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.status-badge {
  position: absolute;
  top: .45rem; left: .45rem;
  font-size: .7rem;
  font-weight: 700;
  padding: .18rem .5rem;
  border-radius: 50px;
}
.status-badge--pending  { background: rgba(230,126,34,.9); color: #fff; }
.status-badge--approved { background: rgba(39,174,96,.9);  color: #fff; }
.status-badge--rejected { background: rgba(192,57,43,.9);  color: #fff; }

.admin-card-body  { padding: .7rem .9rem; flex: 1; }
.admin-card-meta  { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; flex-wrap: wrap; margin-bottom: .25rem; }
.admin-card-meta strong { font-size: .88rem; color: var(--c-800); }
.meta-date  { font-size: .73rem; color: var(--muted); }
.admin-caption {
  font-size: .8rem; color: var(--muted); line-height: 1.4;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.admin-card-actions {
  display: flex;
  gap: .4rem;
  padding: .65rem .9rem;
  border-top: 1px solid var(--border);
  background: #faf7f3;
  flex-wrap: wrap;
}
.btn-approve, .btn-reject, .btn-delete {
  flex: 1;
  padding: .42rem .55rem;
  border: none;
  border-radius: var(--r-sm);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--ease), transform var(--ease);
  white-space: nowrap;
}
.btn-approve:hover, .btn-reject:hover, .btn-delete:hover { opacity: .82; transform: translateY(-1px); }
.btn-approve { background: #e6f7ed; color: #27ae60; }
.btn-reject  { background: #fef3e2; color: #e67e22; }
.btn-delete  { background: #fdecea; color: #c0392b; flex: 0 0 auto; padding: .42rem .65rem; }

/* ── Admin Login ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--c-900) 0%, var(--c-700) 100%);
}
.login-card {
  width: 100%;
  max-width: 370px;
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 2.4rem 1.9rem;
  box-shadow: var(--sh-lg);
}
.login-logo  { font-size: 2.4rem; text-align: center; margin-bottom: .9rem; }
.login-card h1 { font-size: 1.45rem; text-align: center; color: var(--c-800); margin-bottom: .25rem; }
.login-sub  { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 1.65rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .upload-card { padding: 1.5rem 1rem; }
  .hero-content h1 { font-size: 1.4rem; }
  .hero-content p  { font-size: .88rem; }
  .gallery-masonry { columns: 2; column-gap: .6rem; }
  .gallery-item    { margin-bottom: .6rem; }
  .admin-grid      { grid-template-columns: 1fr 1fr; }
  .stats-row       { grid-template-columns: 1fr 1fr; }
  .modal-content img { max-height: 62vh; }
  .success-actions { flex-direction: column; }
  .success-actions .btn-primary,
  .success-actions .btn-secondary { width: 100%; text-align: center; }
}

@media (min-width: 600px) {
  .gallery-masonry { columns: 3; }
}

@media (min-width: 1000px) {
  .gallery-masonry { columns: 4; column-gap: 1rem; }
  .gallery-item    { margin-bottom: 1rem; }
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .hero-content h1 { font-size: 2.5rem; }
}
