:root {
  --bg-main: #06070d;
  --bg-surface: #0d101c;
  --bg-elevated: #14192b;
  --border-subtle: rgba(56, 189, 248, 0.18);
  --border-pink: rgba(236, 72, 153, 0.35);

  --blue: #38bdf8;
  --blue-strong: #2563eb;
  --pink: #ec4899;
  --pink-bright: #f472b6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --danger: #fb7185;
  --success: #34d399;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-glow: 0 12px 32px rgba(37, 99, 235, 0.16), 0 4px 18px rgba(236, 72, 153, 0.12);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.16), transparent 42%),
    radial-gradient(circle at 85% 15%, rgba(236, 72, 153, 0.15), transparent 40%),
    radial-gradient(circle at 50% 95%, rgba(56, 189, 248, 0.10), transparent 45%);
  color: var(--text-primary);
  line-height: 1.5;
  direction: ltr;
}

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

a:hover {
  color: var(--pink-bright);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 7, 13, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.8);
  flex-shrink: 0;
}

.brand-accent {
  background: linear-gradient(90deg, var(--blue), var(--pink-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Search Bar */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 440px;
}

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 2.4rem 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.94rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.18);
}

.search-clear {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-primary);
  font-size: 0.82rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.search-clear.visible {
  display: inline-flex;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Category Pills */
.category-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.2rem 0 1rem;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}

.cat-pill:hover {
  color: var(--text-primary);
  border-color: var(--blue);
}

.cat-pill.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue-strong), var(--pink));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.28);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--blue-strong), var(--pink));
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.28);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 26px rgba(56, 189, 248, 0.35);
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.4);
  color: var(--danger);
  background: rgba(251, 113, 133, 0.1);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(251, 113, 133, 0.22);
  border-color: var(--danger);
}

/* Main container */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}

/* Adsterra Container (clean & invisible when empty) */
.ad-slot {
  width: 100%;
  margin: 0.75rem auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot:empty {
  display: none;
  margin: 0;
}

/* Gallery Grid - Mobile First */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
  }
}

.photo-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  border-color: var(--pink);
  box-shadow: 0 10px 28px rgba(236, 72, 153, 0.2);
}

.photo-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #05060b;
  overflow: hidden;
  cursor: pointer;
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.photo-card:hover .photo-thumb {
  transform: scale(1.03);
}

.photo-meta {
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  background: var(--bg-surface);
}

.photo-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-badge {
  font-size: 0.7rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.14);
  color: var(--pink-bright);
  border: 1px solid rgba(236, 72, 153, 0.32);
  flex-shrink: 0;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status & Empty states */
.status-box {
  text-align: center;
  padding: 2.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.4rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 5, 10, 0.96);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  padding: 0.85rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.lightbox-info {
  min-width: 0;
}

.lightbox-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--blue);
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0.75rem 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.75);
}

/* Admin Panel */
.panel {
  max-width: 820px;
  margin: 1.15rem auto;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-glow);
}

.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  color: var(--blue);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}

.input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

.dropzone {
  border: 2px dashed var(--border-pink);
  border-radius: var(--radius-md);
  padding: 1.7rem 1rem;
  text-align: center;
  background: rgba(236, 72, 153, 0.05);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  background: rgba(56, 189, 248, 0.09);
  border-color: var(--blue);
}

.dropzone p {
  margin: 0.3rem 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Bulk Preview Grid */
.bulk-summary {
  margin-top: 0.85rem;
  font-size: 0.86rem;
  color: var(--blue);
  font-weight: 600;
}

.bulk-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.55rem;
}

.bulk-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-main);
}

.bulk-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bulk-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(6, 7, 13, 0.85);
  color: #fff;
  font-size: 0.72rem;
  cursor: pointer;
}

.progress-wrap {
  margin-top: 0.9rem;
  display: none;
}

.progress-wrap.visible {
  display: block;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--pink));
  transition: width 0.2s ease;
}

.progress-text {
  margin-top: 0.4rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 0.9rem;
  font-size: 0.88rem;
  display: none;
}

.alert.show {
  display: block;
}

.alert.error {
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #fecdd3;
}

.alert.success {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

.admin-toolbar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.admin-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
}

.admin-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.admin-item-info {
  flex: 1;
  min-width: 0;
}

.admin-item-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-item-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.admin-item-actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}
