/*
  Theme Name : Place Theme
  Author     : Bo Xi Men
  Description: main.css — Load đầu tiên.
               Cung cấp toàn bộ design tokens cho filter.css và modal.css.
               Không khai báo :root ở 2 file kia nữa.
*/

/* ==========================================================================
   🎨 DESIGN TOKENS — Nguồn sự thật duy nhất cho toàn theme
   ========================================================================== */

@font-face {
  font-display: swap;
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/lexend-v26-latin-regular.woff2') format('woff2');
}

/* lexend-600 - latin */
@font-face {
  font-display: swap;
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/lexend-v26-latin-600.woff2') format('woff2');
}


@font-face {
  font-display: swap; 
  font-family: 'BeVietnamPro';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/be-vietnam-pro-v12-latin_vietnamese-regular.woff2') format('woff2'); 
}

@font-face {
  font-display: swap; 
  font-family: 'BeVietnamPro';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/be-vietnam-pro-v12-latin_vietnamese-600.woff2') format('woff2'); 
}
:root {

  /* ── Backgrounds ── */
  --bg-deep:   #0b0d14;
  --bg-card:   #1a1d29;
  --bg-card-2: #252836;

  /* ── Text ── */
  --text:      #ffffff;
  --text-muted:#9ca3af;
  --text-dim:  #888888;
  --text-body: #d1d5db;   /* dropdown items, review content */

  /* ── Brand ── */
  --primary-blue: #2daae1;
  --primary-pink: #f472b6;  /* nhạt — tag, icon accent */
  --accent-pink:  #d63384;  /* đậm — CTA, gradient, category label */
  --accent-purple:#8e44ad;

  /* ── Semantic ── */
  --color-open:           #4ade80;
  --color-closed:         #ff4757;
  --color-star:           #f1c40f;
  --color-orange:         #fb923c;  /* tag-trending text */
  --color-orange-glow:    #ff7a3d;  /* tag-trending icon */
  --color-scrollbar:      #4b5563;  /* scrollbar thumb — dùng chung 3 file */
  --color-scrollbar-hover:#6b7280;

  /* ── Borders ── */
  --border:   #2a2d3d;
  --border-2: #333333;
  --border-3: #374151;   /* dropdown border */

  /* ── Gradients ── */
  --gradient-pink:        linear-gradient(90deg,  #d63384, #8e44ad);
  --gradient-blue:        linear-gradient(135deg, #3b82f6, #06b6d4 50%, #10b981);
  --gradient-modal:       linear-gradient(135deg, #ec4899, #8b5cf6);
  --gradient-modal-hover: linear-gradient(135deg, #db2777, #7c3aed);

  /* ── Radius ── */
  --radius-ss: 5px;
  --radius-sm: 8px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  /* ── Effects ── */
  --shadow-glow:    0 0 25px rgba(45,170,225,.5);
  --shadow-sticker: 5px 10px 0 rgba(0,0,0,.3);

  /* ── Layout ── */
  --container: 1200px;

  /* ─────────────────────────────────────────────────────────────────────────
     🗂  Z-INDEX SYSTEM — Phân tầng rõ ràng, không hardcode số ở bất cứ đâu.
         filter.css và modal.css dùng lại các biến này, KHÔNG khai báo thêm.

         Layer          │ Var              │ Value │ Phần tử
         ───────────────┼──────────────────┼───────┼──────────────────────────
         bg decoration  │ (không cần var)  │  -1   │ .shape-svg
         floating shape │ (không cần var)  │   0   │ .f-shape
         card / sticker │ (không cần var)  │   1   │ .place-card, .f-icon
         sticky ui      │ (không cần var)  │  10   │ .action-zone, .search-wrapper
         close btn      │ (không cần var)  │ 100   │ .close-btn
         back to top    │ (không cần var)  │ 200   │ #backToTop
         filter bar     │ --z-filter       │ 9000  │ .filter-bar, .filter-container
         click-out      │ --z-overlay      │ 9001  │ .dd-overlay, .sd-overlay
         dropdown panel │ --z-menu         │ 9002  │ .dd, .sd, .dropdown-menu
         modal overlay  │ --z-modal        │ 9998  │ .custom-static-modal
         lightbox       │ --z-lightbox     │ 9999  │ .sp-lightbox
     ───────────────────────────────────────────────────────────────────────── */
  --z-filter:   9000;
  --z-overlay:  9001;
  --z-menu:     9002;
  --z-modal:    9996;
  --z-lightbox: 9999;
}


/* ==========================================================================
   1. Z-INDEX — Áp dụng tập trung, không scatter rải rác trong từng block
   ========================================================================== */
.shape-svg           { z-index: -1; }
.f-shape             { z-index: 0; }
.f-icon,
.place-card,
.card-thumb          { position: relative; z-index: 1; }
.action-zone,
.search-wrapper      { position: relative; z-index: 10; }
.close-btn           { z-index: 100; }
#backToTop           { z-index: 200; }
.custom-static-modal { z-index: var(--z-modal); }
/* .sp-lightbox      { z-index: var(--z-lightbox); } → đặt trong lightbox partial */


/* ==========================================================================
   2. BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'BeVietnamPro', sans-serif;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}


/* ==========================================================================
   3. HERO / BANNER
   ========================================================================== */
.hero-banner {
  min-height: auto;
  border-radius: var(--radius-xl);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding: 50px;
  border: 1px solid var(--border);
  position: relative;
}

.tag-trending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,138,76,.3);
  border: 1px solid rgba(255,138,76,.6);
  color: var(--color-orange);
  text-shadow: 0 0 8px rgba(255,100,50,.4);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.tag-trending svg {
  color: var(--color-orange-glow);
  filter: drop-shadow(0 0 4px rgba(255,100,50,.6));
}

.svg-xl    { height: 22px; width: 22px; }
.hero-name { font-size: 42px; font-weight: 800; margin: 15px 0; line-height: 1.2; }
.hero-loc  { color: var(--text-dim); font-size: 14px; margin-top: 20px; }


/* ==========================================================================
   4. ACTION ZONE
   ========================================================================== */
.action-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.search-wrapper {
  width: 100%;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  padding: 12px 16px 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.search-wrapper:focus-within {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 1px rgba(214,51,132,.3);
}
.search-wrapper input {
  width: 100%;
  margin-left: 10px;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 16px;
}


/* ==========================================================================
   5. BTN GLOW RANDOM
   ========================================================================== */
.btn-glow-random {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,.2);
  background: var(--gradient-blue);
  background-size: 200% 200%;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
/*  font-family: 'Be Vietnam Pro', sans-serif;*/
  cursor: pointer;
  box-shadow:
    0 10px 40px rgba(59,130,246,.6),
    0 0 60px rgba(6,182,212,.4),
    inset 0 1px 0 rgba(255,255,255,.3);
  transition: all .4s cubic-bezier(.68,-.55,.265,1.55);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn-glow-random:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow:
    0 15px 50px rgba(59,130,246,.8),
    0 0 80px rgba(6,182,212,.6),
    inset 0 1px 0 rgba(255,255,255,.4);
  background-position: 100% 0;
}
.btn-glow-random::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,.1), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
}
.btn-glow-random:hover > svg { animation: spin-dice .6s ease-in-out; }

@keyframes shine     { 0% { left: -50%; } to { left: 150%; } }
@keyframes spin-dice { 0% { transform: rotate(0); } to { transform: rotate(1turn); } }


/* ==========================================================================
   6. FLOATING ICONS (stickers)
   ========================================================================== */
.floating-icons { position: fixed; inset: 0; pointer-events: none; }

.f-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  animation: floatSticker 6s ease-in-out infinite;
  font-size: 5rem;
  line-height: 1;
  text-shadow: var(--shadow-sticker);
}
.f-icon img {
  width: 65px; height: auto; display: block;
  filter: drop-shadow(var(--shadow-sticker));
}
.f-icon.chili  { top: 120px;    left: 60px;  --rotation: -20deg;  animation-delay: -4s; }
.f-icon.pizza  { top: 80px;     right: 80px; --rotation: -10deg;  animation-delay: -2s; }
.f-icon.hotdog { bottom: 150px; left: 80px;  --rotation: 15.5deg; }
.f-icon.lemon  { bottom: 120px; right: 60px; --rotation: 10deg; }

@keyframes floatSticker {
  0%,100% { transform: translateY(0)     rotate(var(--rotation, 0deg)); }
  50%     { transform: translateY(-25px) rotate(var(--rotation, 0deg)); }
}


/* ==========================================================================
   7. FLOATING SHAPES
   ========================================================================== */
.f-shape {
  position: absolute;
  pointer-events: none;
  will-change: transform;
  animation: floatShape 7s ease-in-out infinite;
}
@keyframes floatShape {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-14px); }
}

.triangle-pink {
  left: 10%; top: 30%;
  width: 0; height: 0;
  animation-delay: -3s;
}
.triangle-pink::before {
  content: '';
  position: absolute;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 30px solid var(--color-closed);
  transform-origin: center;
  animation: spinTriangle 15s linear infinite;
}
@keyframes spinTriangle { from { transform: rotate(-20deg); } to { transform: rotate(340deg); } }

.circle-blue {
  right: 10%; top: 40%;
  width: 16px; height: 16px;
  background: var(--primary-blue);
  border-radius: 50%;
  animation: floatCircle 6s ease-in-out infinite;
}
@keyframes floatCircle {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-20px); }
}

.sticker-wrap { position: relative; display: inline-block; }
.shape-svg {
  position: absolute;
  top: -30px; right: -30px;
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,100% { opacity: .7; transform: scale(1); }
  50%     { opacity: 1;  transform: scale(1.03); }
}


/* ==========================================================================
   8. RESULTS GRID & CARDS
   ========================================================================== */
.section-title        { font-size: 24px; margin-bottom: 30px; }
.section-title .count { color: var(--text-dim); font-size: 18px; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.place-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid transparent;
  transition: transform .3s, border-color .3s;
  cursor: pointer;
}
.place-card:hover { transform: translateY(-5px); border-color: var(--border-2); }

.card-thumb     { height: 220px; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place-card:hover .place-title { color: var(--primary-pink);  }

.badge-rating {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--color-star);
  color: #000;
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 700; font-size: 12px;
}

.btn-wishlist {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.5rem;
    border-radius: 9999px;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-wishlist.is-not-faved {
    background-color: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.7);
}

.btn-wishlist.is-not-faved:hover {
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--text);
}

.btn-wishlist.is-faved {
    background-color: rgba(239, 68, 68, 0.8);
    color: var(--text);
    border-color: rgba(239, 68, 68, 0.2);
}



.card-content { padding: 15px; display: flex; flex-direction: column; gap: 5px; }

.category    { color: var(--primary-pink); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.place-title {margin: 5px 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.place-address {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-dim);
  overflow: hidden; margin-bottom: 12px;
}
.place-address svg { flex-shrink: 0; }
.address-text {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; word-break: break-all;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 400;
  background: rgba(255,255,255,.05);
  width: fit-content; white-space: nowrap;
}
.status-badge.is-open   { color: var(--color-open);   background: rgba(74,222,128,.1); }
.status-badge.is-closed { color: var(--color-closed); background: rgba(255,71,87,.1); }
.status-badge .dot      { font-size: 10px; }

.load-more-container { display: flex; justify-content: center; margin: 50px 0 100px; }
.btn-load-more {
  background: var(--gradient-pink);
  color: var(--text); border: 0;
  padding: 15px 40px; border-radius: 50px;
  font-size: 16px; font-weight: 700;
  cursor: pointer; transition: transform .3s, opacity .3s;
}
.btn-load-more:hover { opacity: .9; transform: scale(1.05); }


/* ==========================================================================
   9. BACK TO TOP
   ========================================================================== */
#backToTop {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-modal);
  color: var(--text);
  border: none; border-radius: 9999px; cursor: pointer;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  animation: slideInUp .5s ease-out forwards;
}
#backToTop:hover {
  transform: scale(1.1);
  background: var(--gradient-modal-hover);
  box-shadow: 0 20px 25px -5px rgba(236,72,153,.4);
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* ==========================================================================
   10. CLOSE BUTTON
   ========================================================================== */
.sp-lb-close,.modal-close-overlay{position:absolute;width:44px;height:44px;background:rgba(0,0,0,.6);border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--text);font-size:18px;cursor:pointer;transition:all 150ms cubic-bezier(.4,0,.2,1)}
.sp-lb-close{margin-top:30px;margin-right:30px}
.modal-close-overlay{top:24px;right:24px}
.sp-lb-close:hover,.modal-close-overlay:hover{background-color:rgb(239 68 68/.8)}
.sp-lb-close svg,.modal-close-overlay svg{pointer-events:none;transition:transform .3s ease}
.sp-lb-close:hover svg,.modal-close-overlay:hover svg{transform:rotate(90deg)}

/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .container    { padding: 0 15px; }
  .results-grid { grid-template-columns: repeat(2,1fr); gap: 15px; }
  .hero-banner  { height: 350px; padding: 30px; }
  .hero-name    { font-size: 32px; }
}

@media (max-width: 768px) {
  .nav-row                    { padding: 15px 0; }
  .header-right .nav-link     { display: none; }
  .hero-banner  { height: auto; min-height: 300px; padding: 40px 20px; text-align: center; flex-direction: column; justify-content: center; }
  .hero-name    { font-size: 28px; }
  .search-wrapper             { padding: 10px 15px; width: 95%; }
  .btn-glow-random { width: 100%; max-width: 300px; font-size: 16px; padding: 12px 20px; }
}

@media (max-width: 480px) {
  .filter-container { margin: 20px 0; justify-content: flex-start; overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
  .filter-bar       { padding: 8px 15px; width: max-content; }
  .results-grid     { grid-template-columns: 1fr; gap: 20px; }
  .place-card       { max-width: 100%; }
  .card-thumb       { height: 200px; }
  .btn-load-more    { width: 100%; padding: 12px; }
}