/* SpecialsNite v2 — Reviews, Photos, Ratings, Venue Pins, My Activity */

/* ── Detail modal: side panel on desktop ── */
@media (min-width: 769px) {
  #detailModal { align-items: stretch; justify-content: flex-end; padding: 0; }
  #detailModal .modal-card { max-width: 420px; max-height: 100vh; height: 100vh; border-radius: 0; box-shadow: -4px 0 20px rgba(0,0,0,.15); animation: slideInRight .25s ease; }
  #submitModal .modal-card { max-height: 85vh; }
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ── Pin map z-index fix ── */
.pin-map-wrap { position: relative; z-index: 1; }
.pin-map-wrap .leaflet-container { height: 180px; width: 100%; position: relative; z-index: 1; }
.modal-card .stack-form { position: relative; z-index: 2; }

/* ── Venue pins — teardrop style ── */
.venue-pin-wrap { background: none !important; border: none !important; }
.venue-pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 4px; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s; position: relative; transform: rotate(-45deg); }
.venue-pin:hover { transform: rotate(-45deg) scale(1.15); }
.pin-label { color: #fff; font-size: 9px; font-weight: 700; line-height: 1; transform: rotate(45deg); }

/* ── Star ratings ── */
.star-rating { display: inline-flex; gap: 2px; font-size: 16px; line-height: 1; }
.star { color: var(--text-muted, #666); cursor: default; transition: color .1s; }
.star-filled { color: #ffc857; }
.star-interactive .star { cursor: pointer; }
.star-interactive .star:hover,
.star-interactive .star:hover ~ .star { color: #ffc857; }

/* ── Venue detail ── */
.venue-detail { padding: 4px 0; }
.venue-detail h2 { margin: 0 0 6px; font-size: 1.25rem; }
.venue-meta { font-size: .85rem; color: var(--text-secondary, #999); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.venue-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.venue-rating strong { font-size: 1.1rem; }
.venue-desc { font-size: .88rem; margin: 8px 0; color: var(--text-secondary, #ccc); }
.venue-addr, .venue-phone, .venue-web, .venue-hours { font-size: .85rem; margin: 4px 0; }
.venue-addr a, .venue-phone a, .venue-web a { color: var(--accent-blue, #15a8e8); }

.venue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

/* ── Button variants ── */
.btn-sm { padding: 6px 12px; border-radius: 6px; font-size: .82rem; font-weight: 600; border: none; cursor: pointer; transition: opacity .15s; }
.btn-sm:hover { opacity: .85; }
.btn-primary { background: var(--accent-red, #f2223b); color: #fff; }
.btn-secondary { background: var(--bg-surface, #1a1d28); color: var(--text-primary, #fff); border: 1px solid var(--line, #333); }
.btn-green { background: #2fd477; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-xs { padding: 3px 8px; font-size: .75rem; border-radius: 4px; border: none; cursor: pointer; }

/* ── Reviews ── */
.venue-reviews-section, .venue-photos-section { margin-top: 18px; border-top: 1px solid var(--line, #333); padding-top: 12px; }
.venue-reviews-section h3, .venue-photos-section h3 { font-size: 1rem; margin: 0 0 10px; }

.review-card { padding: 10px 0; border-bottom: 1px solid var(--line, #222); }
.review-card:last-child { border-bottom: none; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.review-author { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.review-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-blue, #15a8e8); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; }
.review-date { font-size: .75rem; color: var(--text-muted, #666); }
.review-title { font-weight: 600; font-size: .88rem; margin: 4px 0 2px; }
.review-body { font-size: .85rem; color: var(--text-secondary, #bbb); margin: 2px 0; line-height: 1.4; }

.review-form-wrap, .photo-upload-wrap { background: var(--bg-surface, #1a1d28); border: 1px solid var(--line, #333); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.review-form-wrap h4, .photo-upload-wrap h4 { margin: 0 0 10px; font-size: .95rem; }
.review-form input, .review-form textarea, .photo-upload-wrap input { width: 100%; padding: 8px 10px; border: 1px solid var(--line, #333); border-radius: 6px; background: var(--bg-card, #0c0e16); color: var(--text-primary, #fff); font-size: 16px !important; margin-bottom: 8px; box-sizing: border-box; }
.review-form-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ── Photos ── */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.photo-card { border-radius: 6px; overflow: hidden; position: relative; }
.photo-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.photo-caption { font-size: .72rem; padding: 4px 6px; color: var(--text-secondary, #bbb); }
.photo-date { font-size: .7rem; color: var(--text-muted, #666); position: absolute; bottom: 2px; right: 4px; }

/* ── Status badges ── */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600; text-transform: capitalize; }
.badge-green { background: rgba(47,212,119,.15); color: #2fd477; }
.badge-yellow { background: rgba(255,200,87,.15); color: #e5a800; }
.badge-red { background: rgba(231,76,60,.15); color: #e74c3c; }
.badge-featured { background: rgba(245,179,1,.18); color: #f5b301; font-weight: 800; }

/* ── Venue menu (detail modal) ── */
.venue-menu-section { margin-top: 18px; }
.menu-group { margin-bottom: 14px; }
.menu-group-title { font-size: .92rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary, #bbb); margin: 0 0 6px; }
.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.menu-item-main { display: flex; flex-direction: column; }
.menu-item-name { font-weight: 600; }
.menu-item-desc { font-size: .82rem; color: var(--text-muted, #888); }
.menu-item-price { font-weight: 700; white-space: nowrap; }

/* ── Newsletter signup ── */
.newsletter-form { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.newsletter-form input[type=email] { flex: 1 1 160px; min-height: 44px; font-size: 16px; }
.newsletter-form button { min-height: 44px; }
.owner-menu-section { font-size: .88rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary, #bbb); margin: 14px 0 4px; }

/* ── My Activity ── */
.my-activity { padding: 4px 0; }
.my-activity h2 { margin: 0 0 12px; }

.activity-tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.activity-tab { padding: 6px 14px; border-radius: 20px; font-size: .82rem; font-weight: 600; border: 1px solid var(--line, #333); background: transparent; color: var(--text-secondary, #aaa); cursor: pointer; white-space: nowrap; transition: all .15s; }
.activity-tab.active { background: var(--accent-red, #f2223b); color: #fff; border-color: var(--accent-red, #f2223b); }

.activity-content { display: none; }
.activity-content.active { display: block; }

.activity-card { padding: 10px 12px; background: var(--bg-surface, #1a1d28); border: 1px solid var(--line, #222); border-radius: 8px; margin-bottom: 8px; }
.activity-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.activity-card-header strong { font-size: .9rem; }
.activity-title { font-weight: 600; font-size: .85rem; margin: 2px 0; }
.activity-body { font-size: .83rem; color: var(--text-secondary, #bbb); margin: 2px 0; }
.activity-meta { font-size: .78rem; color: var(--text-muted, #666); margin-top: 6px; display: flex; align-items: center; gap: 8px; }

/* ── Leaflet popup overrides ── */
.leaflet-popup-content { font-size: .85rem; line-height: 1.4; }
.leaflet-popup-content .btn-sm { margin-top: 6px; display: inline-block; }
.leaflet-popup-content .star-rating { font-size: 12px; }

/* ── Muted text ── */
.muted { color: var(--text-muted, #777); font-size: .85rem; }

/* ── List Search & Sort Toolbar ── */
.list-toolbar { margin-bottom: 10px; }
.list-toolbar-row { display: flex; gap: 8px; align-items: center; }
.list-toolbar .list-search { flex: 1; padding: 8px 12px; border: 1px solid var(--line, #333); border-radius: 8px; background: var(--bg-surface, #1a1d28); color: var(--text-primary, #fff); font-size: 16px !important; outline: none; min-width: 0; }
.list-toolbar .list-search:focus { border-color: var(--accent-blue, #15a8e8); }
.list-toolbar .list-search::placeholder { color: var(--text-muted, #666); }
.list-toolbar .list-sort { padding: 8px 10px; border: 1px solid var(--line, #333); border-radius: 8px; background: var(--bg-surface, #1a1d28); color: var(--text-primary, #fff); font-size: 16px !important; cursor: pointer; flex-shrink: 0; }
.list-toolbar-count { font-size: .78rem; color: var(--text-muted, #666); margin-top: 4px; }

/* ── Admin Card Layout ── */
.admin-card-list { display: flex; flex-direction: column; gap: 8px; }
.admin-card {
  background: var(--bg-card, #0c0e16); border: 1px solid var(--line, #222); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; transition: border-color .15s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .admin-card:hover { border-color: var(--accent-blue, #15a8e8); } }
.admin-card-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-card-title { font-weight: 600; font-size: .95rem; color: var(--text-primary, #fff); }
.admin-card-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-card-badge {
  font-size: .68rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; text-transform: capitalize;
}
.admin-card-badge.verified { background: rgba(16,185,129,.15); color: #10b981; }
.admin-card-badge.pending { background: rgba(245,158,11,.15); color: #f59e0b; }
.admin-card-badge.inactive { background: rgba(239,68,68,.15); color: #ef4444; }
.admin-card-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted, #888); margin-top: 4px; }
.admin-card-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px;
}
.admin-action {
  padding: 6px 14px; border: none; border-radius: 6px; font-size: .82rem; font-weight: 600;
  cursor: pointer; min-height: 36px; z-index: 3; position: relative;
}
.admin-action-primary { background: var(--accent-blue, #15a8e8); color: #fff; }
.admin-action-success { background: #10b981; color: #fff; }
.admin-action-danger { background: #ef4444; color: #fff; }
.admin-action:active { opacity: .8; }
.role-sel, .active-sel {
  padding: 4px 8px; border: 1px solid var(--line, #333); border-radius: 6px;
  background: var(--bg-surface, #1a1d28); color: var(--text-primary, #fff); font-size: 16px !important;
}
.admin-tabs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.admin-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line, #333); white-space: nowrap; }
.admin-tabs button {
  background: transparent; border: none; color: var(--text-muted, #888); padding: 10px 16px;
  font-size: .85rem; cursor: pointer; border-bottom: 2px solid transparent; flex-shrink: 0;
}
.admin-tabs button.active { color: var(--accent-blue, #15a8e8); border-bottom-color: var(--accent-blue, #15a8e8); font-weight: 600; }

/* ── Verification form ── */
.stack-form label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-secondary, #aaa); margin-bottom: 10px; }
.stack-form label input,
.stack-form label textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line, #333); border-radius: 6px; background: var(--bg-card, #0c0e16); color: var(--text-primary, #fff); font-size: 16px !important; box-sizing: border-box; }

/* ── Verified-diner review badge ── */
.verified-diner-badge {
  display: inline-flex; align-items: center; gap: 3px; vertical-align: middle;
  margin-left: 6px; padding: 2px 8px 2px 5px; border-radius: 999px;
  background: rgba(21,168,232,.12); color: var(--accent-blue, #15a8e8);
  font-size: .68rem; font-weight: 700; letter-spacing: .01em; line-height: 1.4;
  border: 1px solid rgba(21,168,232,.35); white-space: nowrap;
}
.verified-diner-badge svg { flex-shrink: 0; }
.review-card.review-verified { border-left: 3px solid var(--accent-blue, #15a8e8); padding-left: 10px; }

/* ── Real-time deal windows / countdown ── */
.deal-window {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  line-height: 1.4; white-space: nowrap; vertical-align: middle;
}
.deal-window .dw-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.deal-window.dw-active { background: rgba(34,197,94,.15); color: #16a34a; border: 1px solid rgba(34,197,94,.4); }
.deal-window.dw-active .dw-dot { animation: dwpulse 1.6s ease-in-out infinite; }
.deal-window.dw-soon { background: rgba(229,168,0,.15); color: #b98700; border: 1px solid rgba(229,168,0,.4); }
@keyframes dwpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
[data-theme="dark"] .deal-window.dw-active { color: #4ade80; }
[data-theme="dark"] .deal-window.dw-soon { color: #f5c518; }

/* ── Saved deals + loyalty ── */
.btn-save.is-saved { background: var(--brand-red, #e64848); color: #fff; border-color: var(--brand-red, #e64848); }
.nav-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--brand-red, #e64848); color: #fff; font-size: .72rem; font-weight: 800; text-align: center; line-height: 20px; vertical-align: middle; }
.rewards-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 4px 0 14px; }
.rewards-summary > div { text-align: center; padding: 12px 8px; border-radius: 12px; background: rgba(230,72,72,.08); border: 1px solid rgba(230,72,72,.2); }
.rewards-summary strong { display: block; font-size: 1.5rem; line-height: 1.1; color: var(--brand-red, #e64848); }
.rewards-summary span { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary, #8b93a7); }
.rewards-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.reward-badge { font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(21,168,232,.12); color: var(--accent-blue, #15a8e8); border: 1px solid rgba(21,168,232,.3); }
.rewards-next { font-size: .82rem; margin-bottom: 12px; }
.list-controls { display: flex; gap: 8px; margin-bottom: 8px; }
.list-controls input[type="search"] { flex: 1; min-height: 44px; font-size: 16px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line, #2a2e3d); background: var(--bg-card, #171a24); color: var(--text-primary, #eef); }
.list-controls select { min-height: 44px; font-size: 16px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line, #2a2e3d); background: var(--bg-card, #171a24); color: var(--text-primary, #eef); }
.list-count { font-size: .82rem; margin: 4px 0 10px; }
.saved-list { display: flex; flex-direction: column; gap: 8px; }
.saved-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-card, #171a24); border: 1px solid var(--line, #2a2e3d); }
.saved-card-main strong { display: block; font-size: .96rem; }
.saved-card-main p { margin: 2px 0 0; font-size: .82rem; }
.saved-card-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.saved-price { font-weight: 800; color: var(--brand-red, #e64848); }
.saved-remove { min-height: 36px; }
.saved-empty { padding: 24px 12px; text-align: center; }
@media (max-width: 620px) {
  .rewards-summary { grid-template-columns: repeat(3,1fr); }
  .list-controls { flex-direction: column; }
}

/* ── Venue self-service portal ── */
.venue-portal-status { padding: 10px 14px; border-radius: 10px; font-size: .85rem; font-weight: 600; margin-bottom: 14px; }
.venue-portal-status.is-verified { background: rgba(34,197,94,.12); color: #16a34a; border: 1px solid rgba(34,197,94,.35); }
.venue-portal-status.is-pending { background: rgba(229,168,0,.12); color: #b98700; border: 1px solid rgba(229,168,0,.35); }
.venue-portal-specials-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.owner-special-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line, #2a2e3d); background: var(--bg-card, #171a24); margin-bottom: 8px; }
.owner-special-main { min-width: 0; }
.owner-special-actions { display: flex; gap: 6px; flex-shrink: 0; }
.badge-pending { background: rgba(229,168,0,.15); color: #b98700; }
.venue-special-form { margin-top: 12px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line, #2a2e3d); }
.venue-special-form h4 { margin: 0 0 10px; }
@media (max-width: 620px) {
  .owner-special-row { flex-direction: column; align-items: flex-start; }
  .venue-portal-specials-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
