:root {
  --bg: #0b0f0f;
  --panel: #121819;
  --panel-2: #0f1414;
  --text: #f5f5f0;
  --muted: #b7c0c0;
  --accent-green: #0f6f4a;
  --accent-white: #d7d7cf;
  --accent-red: #a1171a;
  --glow: rgba(191, 16, 26, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Vazirmatn", "Tahoma", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(15, 111, 74, 0.25), transparent 60%),
    radial-gradient(900px 500px at 85% 0%, rgba(161, 23, 26, 0.25), transparent 60%),
    linear-gradient(135deg, #0b0f0f 0%, #111616 45%, #0b0f0f 100%);
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

.flag-band {
  background: linear-gradient(90deg, var(--accent-green), var(--accent-white), var(--accent-red));
  height: 6px;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 32px 0 64px;
}

header {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-stats {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
}

.header-stats strong {
  color: var(--accent-red);
  font-size: clamp(2.2rem, 4vw, 3rem);
  display: inline-block;
  animation: heartbeat 1.6s ease-in-out infinite;
  position: relative;
}

.header-stats strong::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 999px;
  background: rgba(161, 23, 26, 0.2);
  filter: blur(6px);
  z-index: -1;
  animation: pulse-glow 1.6s ease-in-out infinite;
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(1.08);
  }
  40% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.1);
  }
  80% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.9);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.75;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.4;
  }
}

.brand h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  margin: 0;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-white), var(--accent-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand span {
  color: var(--muted);
  font-size: 1rem;
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 1px;
}


.hero {
  background: linear-gradient(135deg, rgba(15, 111, 74, 0.12), rgba(161, 23, 26, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.support-note {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px 18px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.support-note .note {
  margin: 0;
}

.section {
  margin-top: 28px;
  background: var(--panel);
  border-radius: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.not-found {
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.section h2 {
  margin: 0 0 16px;
  font-size: 1.4rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 600;
}

.toggle-btn.active {
  background: linear-gradient(90deg, var(--accent-green), var(--accent-red));
}

.cta {
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(90deg, var(--accent-green), var(--accent-red));
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 600;
  font-family: inherit;
}

.cta.alt {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.name {
  font-weight: 600;
}

.name.image-link,
.name.source-link {
  color: var(--accent-white);
  text-decoration: none;
}

.name.image-link:hover,
.name.source-link:hover {
  text-decoration: underline;
}

.image-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.image-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 14px;
  text-align: center;
  display: grid;
  gap: 10px;
}

.image-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
}

.image-placeholder {
  height: 180px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 111, 74, 0.2), rgba(161, 23, 26, 0.2));
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.record-meta,
.record-desc,
.record-source {
  color: var(--muted);
  line-height: 1.8;
  text-align: right;
}

.map-wrap {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: start;
}

.iran-map svg {
  width: 100%;
  height: auto;
}

.province-labels text {
  fill: rgba(245, 245, 240, 0.9);
  font-size: 13.5px;
  pointer-events: none;
}

.province-labels tspan:last-child {
  fill: rgba(245, 245, 240, 0.7);
  font-size: 15px;
}

.province {
  fill: #1f2324;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1;
  transition: fill 0.2s ease;
}

.province.level-0 {
  fill: #2a2f30;
}

.province.level-1 {
  fill: #c56a5c;
}

.province.level-2 {
  fill: #c13d2a;
}

.province.level-3 {
  fill: #8d1d1a;
}

.province.level-4 {
  fill: #5e0e12;
}

.map-legend {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.legend-title {
  color: var(--text);
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

.legend-swatch.level-1 {
  background: #c56a5c;
}

.legend-swatch.level-2 {
  background: #c13d2a;
}

.legend-swatch.level-3 {
  background: #8d1d1a;
}

.legend-swatch.level-4 {
  background: #5e0e12;
}

.upload-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.upload-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-red));
  transition: width 0.2s ease;
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pic-indicator {
  margin-right: 6px;
  font-size: 0.95rem;
  opacity: 0.85;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 6, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.gallery-modal.open {
  display: flex;
}

.gallery-content {
  max-width: 720px;
  width: min(90vw, 720px);
  background: var(--panel);
  border-radius: 18px;
  padding: 20px 16px 16px 64px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.gallery-content img {
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
}

.gallery-caption {
  color: var(--muted);
  text-align: center;
}

.gallery-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 10px;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.gallery-nav.prev {
  right: 12px;
}

.gallery-nav.next {
  left: 12px;
}

.desc-link {
  color: var(--accent-white);
  text-decoration: none;
  margin-right: 6px;
}

.desc-link:hover {
  text-decoration: underline;
}

form {
  display: grid;
  gap: 16px;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

.search-form input {
  direction: rtl;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.date-selects {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

label {
  font-size: 0.9rem;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  background: linear-gradient(90deg, var(--accent-green), var(--accent-red));
  color: var(--text);
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: right;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-card a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-actions button {
  padding: 8px 14px;
}

.admin-actions .reject {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-photo {
  width: 100%;
  max-width: 200px;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-red));
  color: var(--text);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 600;
  font-family: inherit;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer-button {
  margin-top: 10px;
}

@media (max-width: 600px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-wrap {
    grid-template-columns: 1fr;
  }
}
