:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --card: #1c2230;
  --card-hover: #232b3d;
  --text: #e6edf3;
  --muted: #93a1b5;
  --line: #2a3242;
  --accent: #6c8cff;
  --accent-2: #ff7eb6;
  --gold: #ffc63d;
  --green: #3fb950;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: inherit; }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 72px 20px 56px;
  text-align: center;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(108, 140, 255, 0.28), transparent 60%),
    radial-gradient(900px 400px at 85% 0%, rgba(255, 126, 182, 0.20), transparent 55%),
    linear-gradient(180deg, #11162200, #0d1117);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero__inner { max-width: 820px; margin: 0 auto; position: relative; z-index: 2; }

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.hero__logo {
  display: block;
  margin: 32px auto 10px;
  height: 150px;
  width: auto;
  max-width: 96%;
  object-fit: contain;
  padding: 28px 52px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .hero__logo { height: 92px; padding: 18px 28px; }
}

.hero__popper {
  margin-top: 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent-2), var(--gold));
  box-shadow: 0 10px 28px rgba(255, 126, 182, 0.4);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.hero__popper:hover { filter: brightness(1.07); transform: translateY(-2px); }
.hero__popper:active { transform: translateY(0) scale(0.97); }
.hero__popper-emoji { font-size: 18px; }

.hero__badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(108, 140, 255, 0.35);
}

.hero__title {
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.05;
  margin: 20px 0 14px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(120deg, #fff, #c8d4ff 60%, #ffc9e3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  font-size: clamp(15px, 2.4vw, 18px);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

.hero__subtitle strong { color: var(--text); }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  min-width: 92px;
}

.stat__num { font-size: 22px; font-weight: 800; }
.stat__label { font-size: 12px; color: var(--muted); }

/* ===== Layout ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 40px 20px 60px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.section-title { font-size: 24px; font-weight: 800; margin: 0; }

.sort { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }

.sort select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* ===== Grid + cards ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  background: var(--card-hover);
}

.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #0b0e14; }

.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card__media img { transform: scale(1.06); }

.card__rank {
  position: absolute; top: 12px; left: 12px;
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}

.card__type {
  position: absolute; top: 12px; right: 12px;
  background: rgba(108, 140, 255, 0.9);
  padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff;
}

.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }

.card__name { font-size: 18px; font-weight: 700; margin: 0; }
.card__name-ar { font-size: 13px; color: var(--muted); direction: rtl; }

.rating-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 15px; }
.rating-num { font-weight: 700; }
.rating-count { color: var(--muted); font-size: 13px; }

.card__addr {
  font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card__actions { display: flex; gap: 8px; margin-top: 6px; }

.btn {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn--primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border: none; color: #fff; }
.btn--primary:hover { filter: brightness(1.08); }

/* ===== Modal ===== */
.modal, .lightbox { position: fixed; inset: 0; z-index: 50; display: none; }
.modal[aria-hidden="false"], .lightbox[aria-hidden="false"] { display: block; }

.modal__backdrop { position: absolute; inset: 0; background: rgba(5, 8, 13, 0.72); backdrop-filter: blur(4px); }

.modal__panel {
  position: relative;
  max-width: 920px;
  margin: 4vh auto;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.modal__close {
  position: sticky; top: 12px; float: right; margin: 12px 12px 0 0;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(13, 17, 23, 0.9);
  color: var(--text); font-size: 22px; cursor: pointer; z-index: 5;
}
.modal__close:hover { background: var(--card-hover); }

.modal__content { padding: 0 0 28px; }

.detail__hero { aspect-ratio: 16 / 8; overflow: hidden; border-radius: 20px 20px 0 0; background: #0b0e14; }
.detail__hero img { width: 100%; height: 100%; object-fit: cover; }

.detail__head { padding: 22px 28px 0; }
.detail__title { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.detail__title-ar { color: var(--muted); direction: rtl; font-size: 15px; }

.detail__meta { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 14px 0 0; align-items: center; }
.detail__section { padding: 22px 28px 0; }
.detail__section h3 { font-size: 16px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer; transition: opacity 0.15s ease; }
.gallery img:hover { opacity: 0.82; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.info-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.info-item .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.info-item .value { font-size: 15px; font-weight: 600; word-break: break-word; }
.info-item a.value { color: var(--accent); text-decoration: none; }
.info-item a.value:hover { text-decoration: underline; }

/* rating breakdown */
.breakdown { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.bd-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bd-row .star-label { width: 42px; color: var(--muted); }
.bd-bar { flex: 1; height: 9px; border-radius: 6px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bd-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffac33); }
.bd-row .bd-count { width: 38px; text-align: right; color: var(--muted); }

.reviews { display: flex; flex-direction: column; gap: 12px; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.review__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.review__name { font-weight: 700; font-size: 14px; }
.review__date { font-size: 12px; color: var(--muted); }
.review__text { font-size: 14px; color: #d3dce8; }

.detail__cta { padding: 26px 28px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.detail__cta .btn { flex: 0 1 auto; min-width: 160px; }

/* ===== Lightbox ===== */
.lightbox { background: rgba(3, 5, 9, 0.94); }
.lightbox__img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 90vw; max-height: 88vh; border-radius: 10px; box-shadow: var(--shadow); }
.lightbox__close { position: absolute; top: 18px; right: 22px; font-size: 34px; color: #fff; background: none; border: none; cursor: pointer; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 44px; color: #fff; background: rgba(255,255,255,0.08); border: none; width: 56px; height: 56px; border-radius: 50%; cursor: pointer; }
.lightbox__nav:hover { background: rgba(255,255,255,0.2); }
.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }

.footer { text-align: center; padding: 30px 20px 50px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
  .detail__head, .detail__section, .detail__cta { padding-left: 18px; padding-right: 18px; }
  .lightbox__nav { width: 44px; height: 44px; font-size: 32px; }
}
