@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --bg: #fbfcfe;
  --card: #ffffff;
  --mint: #eaf6f2;
  --text: #2a2530;
  --text-soft: #6f6875;
  --grad-start: #f7c6d9;
  --grad-end: #c9b6e4;
  --pastel-blue: #eaf2fb;
  --pastel-pink: #fbedf3;
  --open: #12a150;
  --closed: #d94f4f;
  --accent: #8a6fd1;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(60, 40, 80, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  position: relative;
  overflow-x: hidden;
  text-rendering: optimizeSpeed;
}

img { max-width: 100%; }

/* ---------- Watermark background ---------- */
.watermark-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-pink));
}
.watermark-bg .wm-svg {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  animation: wm-drift 110s linear infinite;
  will-change: transform;
}
@keyframes wm-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-210px, -170px); }
}
@media (prefers-reduced-motion: reduce) {
  .watermark-bg .wm-svg { animation: none; }
}

a { text-decoration: none; color: inherit; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: transparent;
  contain: layout;
}

@media (min-width: 640px) {
  .wrap { max-width: 560px; }
}

/* ---------- Header / Brand ---------- */
.brand {
  text-align: center;
  padding: 32px 20px 20px;
}
.logo-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto;
}
.brand img.logo {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  display: block;
}
.brand .logo-gif-overlay {
  position: absolute;
  inset: 0;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}
.brand .logo-fallback {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
  color: #fff;
  font-size: 54px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.brand h1 {
  margin: 14px 0 2px;
  font-size: 27px;
  font-weight: 800;
}
@property --brand-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes brand-title-spin {
  to { --brand-angle: 360deg; }
}
.brand h1.brand-title {
  color: var(--accent); /* رنگ جایگزین برای مرورگرهایی که گرادیانت روی متن رو پشتیبانی نمی‌کنن */
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .brand h1.brand-title {
    background: conic-gradient(from var(--brand-angle), #7ba7d9, #e18fb5, #7ba7d9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: brand-title-spin 6s linear infinite;
  }
}
.brand p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.banner-slider {
  position: relative;
  margin: 12px 30px 22px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 2 / 1;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}
.banner-slider:active { cursor: grabbing; }
.banner-slider .banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
  display: block;
}
.banner-slider .banner-slide.active { opacity: 1; z-index: 1; }
.banner-slider .banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.banner-slider .banner-slide.default-slide {
  background: linear-gradient(120deg, var(--grad-start), var(--grad-end));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  padding: 0 20px;
}
.banner-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 6px;
}
.banner-dots span {
  width: 6px; height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.55);
  transition: width .25s ease, background .25s ease;
}
.banner-dots span.active { background: #fff; width: 18px; }

/* ---------- Branch list (home) ---------- */
.section-title {
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 10px;
  text-align: center;
}

.branch-list {
  padding: 0 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.branch-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  transition: transform .15s ease;
  contain: layout;
}
.branch-card:active { transform: scale(0.98); }

.branch-card .thumb {
  flex: 0 0 30%;
  aspect-ratio: 1 / 1;
  max-width: 130px;
  border-radius: 16px;
  background: var(--mint);
  object-fit: cover;
}

.branch-card .info { flex: 1; min-width: 0; }
.branch-card .info h3 {
  margin: -4px 0 4px;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.branch-card .info .category {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.branch-card .info .status-line {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.open { background: var(--open); }
.dot.closed { background: var(--closed); }
.status-text.open { color: var(--open); font-weight: 700; }
.status-text.closed { color: var(--closed); font-weight: 700; }

.chevron { color: #c9c2d1; font-size: 18px; }

/* ---------- Branch detail page ---------- */
.branch-hero {
  position: relative;
  margin: 16px 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}
.branch-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.branch-hero .no-image {
  width: 100%; height: 100%;
  background: linear-gradient(120deg, var(--grad-start), var(--grad-end));
}
.branch-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--card) 92%);
  pointer-events: none;
}
.back-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  border-radius: 20px;
  background: rgba(20, 15, 25, 0.45);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}
.back-btn .icon { font-size: 15px; line-height: 1; }

.title-card {
  position: relative;
  margin: -18px 20px 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 1;
}
.title-card .top-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.title-card h2 { margin: 0; font-size: 17px; font-weight: 800; }
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  color: #fff;
}
.badge.open { background: var(--open); }
.badge.closed { background: var(--closed); }
.title-card .hours-line {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-soft);
  text-align: center;
}

.gallery-row {
  display: flex;
  gap: 10px;
  margin: 0 20px 14px;
}
.gallery-row img {
  flex: 1;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.info-card {
  margin: 0 20px 14px;
  background: var(--mint);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.info-row:last-child { border-bottom: none; }
.info-row .icon { font-size: 15px; margin-top: 1px; }

.block-title {
  margin: 18px 20px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  text-align: center;
}

.route-buttons {
  display: flex;
  gap: 14px;
  margin: 0 20px 6px;
  justify-content: center;
}
.social-buttons {
  display: flex;
  gap: 14px;
  margin: 4px 20px 6px;
  justify-content: center;
}
.route-btn, .social-btn {
  flex: 1;
  text-align: center;
  background: var(--card);
  border-radius: 14px;
  padding: 14px 6px;
  box-shadow: var(--shadow);
  font-size: 11.5px;
  font-weight: 600;
}
.icon-circle {
  width: 38px; height: 38px;
  border-radius: 10px;
  margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  color: #fff;
  overflow: hidden;
}
.icon-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.icon-circle.instagram { background: linear-gradient(135deg,#f58529,#dd2a7b,#8134af); }
.icon-circle.whatsapp { background: #25d366; }
.icon-circle.telegram { background: #229ed9; }
.icon-circle.google-maps { background: #4285f4; }
.icon-circle.neshan { background: #f7941e; }
.icon-circle.balad { background: #1876f2; }

.about-card {
  margin: 0 20px 30px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text-soft);
  min-height: 60px;
  line-height: 1.9;
  text-align: center;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  overflow-x: auto;
  padding-top: 20px;
}
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1 0 26px;
  height: 100%;
  min-width: 26px;
}
.bar-value {
  font-size: 10.5px;
  color: var(--text-soft);
  margin-bottom: 3px;
  white-space: nowrap;
}
.bar {
  width: 100%;
  max-width: 22px;
  background: linear-gradient(180deg, var(--accent), var(--pastel-blue));
  border-radius: 6px 6px 2px 2px;
}
.bar-label {
  font-size: 9.5px;
  color: var(--text-soft);
  margin-top: 6px;
  white-space: nowrap;
}

.empty-hint { color: var(--text-soft); font-size: 12px; }

/* ---------- Admin ---------- */
.admin-wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 30px auto;
  padding: 0 16px;
}
.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.admin-card h2 { margin-top: 0; font-size: 17px; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-soft);
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
input[type=text], input[type=password], input[type=time], input[type=number], input[type=file], textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e4dfe8;
  font-family: inherit;
  font-size: 13.5px;
  background: #fbfaff;
}
textarea { resize: vertical; min-height: 70px; }
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-danger { background: var(--closed); color: #fff; }
.btn-secondary { background: #f0ecf5; color: var(--text); }

.admin-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0ecf5;
}
.admin-list-item:last-child { border-bottom: none; }
.admin-list-item img {
  width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--mint);
}
.admin-list-item .grow { flex: 1; }
.admin-list-item .name { font-weight: 700; font-size: 13.5px; }
.admin-list-item .meta { font-size: 11.5px; color: var(--text-soft); }
.admin-actions { display: flex; gap: 6px; }
.admin-actions .btn { padding: 6px 12px; font-size: 12px; }

.topnav {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.topnav h1 { font-size: 18px; margin: 0; }
.flash-msg {
  background: var(--mint);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  color: #16693f;
}
.login-box { max-width: 340px; margin: 80px auto; }
.error-msg { color: var(--closed); font-size: 13px; margin-bottom: 10px; }
