/* ============================================================================
   RECOMMENDATIONS PAGE - SOFT UI / FLOATING ISLAND DESIGN
   ============================================================================ */

:root {
  --rec-primary: #1e293b; /* Slate 800 */
  --rec-accent: #6366f1; /* Indigo 500 */
  --rec-bg-start: #f8fafc; /* Slate 50 */
  --rec-bg-end: #eff6ff;   /* Blue 50 */
  --rec-surface: #ffffff;
  --rec-text-muted: #64748b;
  --rec-border: #e2e8f0;
  
  --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.08);
  --shadow-card: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

/* Main Container with Subtle Gradient Background */
.recommendations-main {
  min-height: 100vh;
  background: linear-gradient(to bottom right, var(--rec-bg-start), var(--rec-bg-end));
  font-family: 'Jost', sans-serif;
  padding-bottom: 100px;
  position: relative;
}

/* Subtle Mesh/Glow behind content */
.recommendations-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 600px;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================================
   HERO SECTION (CENTERED & CLEAN)
   ============================================================================ */
.recommendations-hero {
  padding: 60px 20px 40px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.recommendations-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--rec-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--rec-text-muted);
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================================
   FILTERS SECTION (FLOATING ISLAND)
   ============================================================================ */
.recommendations-filters {
  padding: 0 20px 50px;
  position: sticky;
  top: 20px; /* Floats when scrolling */
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none; /* Pass clicks through the wrapper */
}

.filters-container {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  padding: 8px 12px;
  border-radius: 100px; /* Pill shape */
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,0.8);
  pointer-events: auto; /* Re-enable clicks */
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filters-container::-webkit-scrollbar { display: none; }

.filters-header { display: none; } /* Hidden */

.filters-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
}

/* Filter Buttons (Clean Pills) */
.filter-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rec-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
}

.filter-btn:hover {
  background: rgba(0,0,0,0.04);
  color: var(--rec-primary);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: var(--rec-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.25);
  transform: scale(1.05);
}

.filter-icon { font-size: 1.2em; }

.filter-count {
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font-size: 0.75em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* ============================================================================
   RECOMMENDATIONS GRID & CARDS
   ============================================================================ */
.recommendations-section {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
  animation: fadeInUp 0.6s ease-out;
}

/* Home page recommendations grid (index.html) */
#recommendationsHomeGrid {
  margin-bottom: 24px;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1200px) {
  #recommendationsHomeGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #recommendationsHomeGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #recommendationsHomeGrid {
    grid-template-columns: 1fr;
  }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Design (Soft & Round) */
.rec-card {
  background: var(--rec-surface);
  border-radius: 32px; /* Super round corners */
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-card);
  border: 4px solid white; /* Inner frame effect */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.rec-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
  z-index: 5;
}

/* Featured Badge (Floating) */
.rec-featured-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  color: #f59e0b;
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Card Image */
.rec-card-image {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 28px 28px 0 0;
  background: #f1f5f9;
}

/* Card Content */
.rec-card-content {
  padding: 24px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Category Pill */
.rec-card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rec-accent);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rec-card-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--rec-primary);
  margin: 0 0 8px;
  line-height: 1.2;
}

.rec-card-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--rec-text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.rec-card-description {
  font-size: 1rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Coupon / Promo Section (Clean Box) */
.rec-card-promo {
  background: #f0fdf4; /* Mint Green bg */
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  margin-bottom: 24px;
  border: 1px solid #dcfce7;
}

.rec-card-promo-label {
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.rec-card-promo-code {
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: #166534;
}

.rec-card-promo-code[data-promo-visible="false"] {
  display: none;
}

.rec-card-promo-toggle {
  margin-top: 10px;
  width: 100%;
}

/* Buttons */
.rec-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  border: none;
}

.rec-btn-primary {
  background: var(--rec-primary);
  color: white;
}

.rec-btn-primary:hover {
  background: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.rec-btn-secondary {
  background: #f1f5f9;
  color: var(--rec-primary);
}

.rec-btn-secondary:hover {
  background: #e2e8f0;
}

/* Loading & Empty States */
.loading-state, .empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--rec-text-muted);
}
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--rec-border);
  border-top-color: var(--rec-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state-icon { font-size: 4rem; margin-bottom: 20px; opacity: 0.4; }


/* ============================================================================
   MODAL (CLASSIC STYLE PRESERVED)
   ============================================================================ */
.recommendation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: white;
  border-radius: 24px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  animation: slideUp 0.3s ease-out;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  z-index: 10;
  transition: all 0.2s;
  color: #334155;
}
.modal-close:hover { background: #f1f5f9; transform: scale(1.1); }

.modal-body { padding: 0; }
.rec-modal-image { width: 100%; height: 450px; object-fit: cover; }
.rec-modal-content-section { padding: 40px; }
.rec-modal-map {
  width: 100%;
  height: 350px;
  border-radius: 16px;
  margin-top: 24px;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 1024px) {
  .recommendations-hero h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
  .recommendations-hero { padding-top: 40px; }
  .recommendations-hero h1 { font-size: 2rem; }
  
  .filters-container {
    width: 100%;
    border-radius: 16px;
    justify-content: flex-start;
  }
  
  .modal-content {
    max-height: 100vh;
    border-radius: 20px 20px 0 0;
    margin-top: auto;
  }
  .rec-modal-image { height: 280px; }
  .rec-modal-content-section { padding: 24px 20px; }
  .modal-close { top: 16px; right: 16px; }
  
  .rec-card-actions { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .recommendations-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   MAP RECOMMENDATIONS - Green Markers & Modal
   ============================================================================ */

/* Custom marker styling */
.recommendation-marker {
  background: transparent !important;
  border: none !important;
}

/* User location marker (L.icon) */
.user-avatar-marker {
  border-radius: 50%;
  border: 3px solid #f97316;
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.5);
  background: white;
  object-fit: cover;
}

.recommendation-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.recommendation-popup .leaflet-popup-content {
  margin: 12px;
}

/* Map Modal Overlay */
.rec-map-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
}

.rec-map-modal-content {
  background: #ffffff;
  border-radius: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: recModalSlideIn 0.3s ease-out;
}

@keyframes recModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rec-map-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: #374151;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s;
}

.rec-map-modal-close:hover {
  background: #ffffff;
  transform: scale(1.1);
}

.rec-map-modal-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 24px 24px 0 0;
}

.rec-map-modal-image-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-radius: 24px 24px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-map-modal-body {
  padding: 24px;
}

.rec-map-modal-category {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #22c55e;
  margin-bottom: 8px;
}

.rec-map-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.rec-map-modal-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
}

.rec-map-modal-description {
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 20px;
}

.rec-map-modal-offer {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left: 4px solid #22c55e;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.rec-map-modal-offer strong {
  color: #16a34a;
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
}

.rec-map-modal-offer p {
  margin: 0;
  color: #166534;
  font-size: 14px;
  line-height: 1.5;
}

.rec-map-modal-promo {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.rec-map-modal-promo-label {
  font-weight: 700;
  color: #92400e;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.rec-map-modal-promo-code {
  font-family: monospace;
  font-size: 20px;
  font-weight: 700;
  color: #78350f;
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  display: none;
  margin-bottom: 8px;
}

.rec-map-modal-promo-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.rec-map-modal-promo-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.rec-map-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.rec-map-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.rec-map-modal-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
}

.rec-map-modal-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.rec-map-modal-btn-secondary {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #e2e8f0;
}

.rec-map-modal-btn-secondary:hover {
  background: #e2e8f0;
}

.rec-map-modal-minimap {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .rec-map-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  
  .rec-map-modal-content {
    max-height: 95vh;
    border-radius: 24px 24px 0 0;
    margin-top: auto;
  }
  
  .rec-map-modal-image {
    height: 180px;
    border-radius: 24px 24px 0 0;
  }
  
  .rec-map-modal-title {
    font-size: 1.5rem;
  }
}
