/* SmartLobang Premium Responsive Card Grid Design System */

:root {
  --sl-bg-page: #f8fafc;
  --sl-bg-card: #ffffff;
  --sl-border: #e2e8f0;
  --sl-border-hover: #cbd5e1;
  --sl-text: #1e293b;
  --sl-text-muted: #64748b;
  
  /* Badge and Tag tint colors */
  --sl-hi: #10b981;
  --sl-mid: #f59e0b;
  --sl-lo: #ef4444;
}

/* Container Structure */
.sl-deals-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--body-font), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--sl-text);
  padding: 20px 0;
}

/* Search and Filter Row */
.sl-controls-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--sl-border);
  padding-bottom: 20px;
}

.sl-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sl-tab {
  font-family: var(--ui-font), inherit !important;
  background: #f1f5f9;
  border: 1px solid var(--sl-border);
  border-radius: 99px;
  padding: 8px 18px;
  font-size: 12px !important;
  font-weight: 600;
  color: var(--sl-text-muted);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.sl-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.sl-tab.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

/* Search Bar Input & Filter Group */
.sl-filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.sl-search-wrapper {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.sl-search-input {
  font-family: var(--ui-font), inherit !important;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--sl-border);
  border-radius: 99px;
  padding: 9px 20px;
  color: var(--sl-text);
  font-size: 13px !important;
  outline: none;
  transition: all 0.2s ease;
}

.sl-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.sl-search-input::placeholder {
  color: #94a3b8;
}

.sl-sort-wrapper {
  position: relative;
}

.sl-sort-select {
  background: #ffffff !important;
  border: 1px solid var(--sl-border) !important;
  border-radius: 99px !important;
  padding: 9px 20px !important;
  color: var(--sl-text) !important;
  font-size: 13px !important;
  font-family: var(--ui-font), inherit !important;
  outline: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  background-size: 14px !important;
  padding-right: 40px !important;
}

.sl-sort-select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15) !important;
}

/* Cards Grid Layout */
.sl-deals-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 24px !important;
  margin-bottom: 40px !important;
  min-height: 200px !important;
  position: relative !important;
  align-items: start !important; /* Prevent cards from stretching vertically */
}

/* Card Styling */
.sl-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.sl-card:hover {
  transform: translateY(-4px);
  border-color: var(--sl-border-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.sl-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
  background: #f1f5f9;
}

.sl-card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.sl-card:hover .sl-card-img-wrapper img {
  transform: scale(1.03);
}

/* Confidence Score Overlay Badge */
.sl-confidence-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sl-confidence-badge.hi {
  background: var(--sl-hi);
}

.sl-confidence-badge.mid {
  background: var(--sl-mid);
}

.sl-confidence-badge.lo {
  background: var(--sl-lo);
}

.sl-confidence-badge.no-img {
  position: relative;
  display: inline-block;
  margin: 12px 12px 0 12px;
  align-self: flex-end;
  box-shadow: none;
}

.sl-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Tag Pills (Matches Screenshot Tints) */
.sl-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}

.sl-tag {
  font-family: var(--ui-font), inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 10px;
  border-radius: 99px;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Specific Tags Colors */
.sl-tag.type {
  background: #fff7ed !important;
  border: 1px solid #ffedd5 !important;
  color: #ea580c !important;
}

.sl-card.supermarket .sl-tag.type {
  background: #f0fdf4 !important;
  border: 1px solid #dcfce7 !important;
  color: #16a34a !important;
}

.sl-card.shopee .sl-tag.type {
  background: #fff5f5 !important;
  border: 1px solid #ffe3e3 !important;
  color: #e53e3e !important;
}

.sl-tag.area {
  background: #eef2ff !important;
  border: 1px solid #e0e7ff !important;
  color: #4f46e5 !important;
}

/* Card Header Titles */
.sl-card-title {
  margin: 0;
  font-family: var(--title-font), inherit !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  line-height: 1.3;
}

/* Description Text */
.sl-card-summary {
  font-family: var(--text-font), inherit !important;
  font-size: 14px !important;
  color: #475569 !important;
  line-height: 1.6 !important;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prices Row (For Supermarkets & Shopee) */
.sl-card-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

.sl-price-deal {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.sl-price-original {
  font-size: 0.9rem;
  color: var(--sl-text-muted);
  text-decoration: line-through;
}

.sl-badge-discount {
  font-size: 0.72rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Meta Data Fields */
.sl-card-meta {
  font-family: var(--text-font), inherit !important;
  font-size: 13px !important;
  color: #475569 !important;
  border-top: 1px solid #f1f5f9 !important;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sl-card-meta b {
  color: #0f172a !important;
  font-weight: 700;
}

.sl-meta-item.social a {
  color: #2563eb !important;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.84rem;
  display: inline-block;
  margin-top: 2px;
}

.sl-meta-item.social a:hover {
  text-decoration: underline;
}

/* Footer & Actions (Matches Screenshot) */
.sl-card-footer {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.sl-spacer {
  flex: 1;
}

/* Lowercase light source link */
.sl-btn-src-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
  background: transparent;
  border: none;
  padding: 0;
}

.sl-btn-src-text:hover {
  color: #2563eb !important;
}

/* Supermarket/Shopee Action Buttons */
.sl-btn-src, .sl-btn-buy-shopee {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none !important;
  color: #ffffff !important;
  background: #2563eb;
  transition: all 0.2s ease;
  border: none;
}

.sl-btn-src:hover {
  background: #1d4ed8;
}

.sl-btn-buy-shopee {
  background: #f97316;
}

.sl-btn-buy-shopee:hover {
  background: #ea580c;
}

/* Loading, Error and Empty States */
.sl-loading, .sl-error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: var(--sl-text-muted);
  font-weight: 600;
}

.sl-loading-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.sl-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-radius: 50%;
  border-top-color: #2563eb;
  animation: sl-spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes sl-spin {
  to { transform: rotate(360deg); }
}

.sl-pagination-row {
  text-align: center;
  margin-top: 20px;
}

.sl-btn-load-more {
  background: #ffffff;
  border: 1px solid var(--sl-border);
  color: var(--sl-text);
  border-radius: 99px;
  padding: 10px 30px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.sl-btn-load-more:hover {
  background: #f8fafc;
  border-color: var(--sl-border-hover);
}

.sl-btn-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sl-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
}

.sl-empty-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.sl-empty-state h3 {
  margin: 0 0 6px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.sl-empty-state p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--sl-text-muted);
}

/* Sidebar Columns Layout */
.sl-deals-layout {
  display: flex;
  gap: 30px;
  max-width: 1200px;
  margin: 20px auto 0 auto;
}

/* Left Sidebar Navigation */
.sl-deals-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 40px;
  height: fit-content;
  background: #ffffff;
  border: 1px solid var(--sl-border);
  border-radius: 16px;
  padding: 24px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  align-self: flex-start;
}

.sl-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sl-text-muted);
  margin-bottom: 16px;
  padding-left: 8px;
}

.sl-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sl-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  color: var(--sl-text-muted);
  text-decoration: none !important;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sl-sidebar-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sl-sidebar-link.active {
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.sl-link-icon {
  font-size: 16px;
}

.sl-deals-content {
  flex-grow: 1;
  min-width: 0;
}

/* Responsive Mobile Layout Rules */
@media (max-width: 992px) {
  .sl-deals-layout {
    flex-direction: column;
    gap: 20px;
  }
  
  .sl-deals-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    padding: 16px;
    border-radius: 12px;
    box-shadow: none;
  }
  
  .sl-sidebar-title {
    display: none;
  }
  
  .sl-sidebar-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .sl-sidebar-nav::-webkit-scrollbar {
    display: none;
  }
  
  .sl-sidebar-link {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 99px;
    background: #f1f5f9;
    border: 1px solid var(--sl-border);
  }
  
  .sl-sidebar-link:hover {
    background: #e2e8f0;
  }
  
  .sl-sidebar-link.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
  }
}

/* 🍽️ Typographic Dining Card Styling */
.sl-dining-card {
  background: linear-gradient(135deg, #fdfaf6 0%, #f4ebd9 100%) !important;
  border: 1px solid rgba(220, 205, 180, 0.4) !important;
  border-radius: 16px !important;
  padding: 18px 16px 14px 16px !important; /* Compressed height & padding */
  box-shadow: 0 15px 35px rgba(200, 185, 160, 0.35), 0 5px 15px rgba(0, 0, 0, 0.05) !important; /* Enhanced drop-shadow */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.sl-dining-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(190, 170, 140, 0.45), 0 8px 20px rgba(0, 0, 0, 0.06) !important; /* Pronounced hover shadow */
  border-color: rgba(220, 205, 180, 0.8) !important;
}

.sl-dining-card-inner {
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}

/* Badge Top Right - Removed */
.sl-dining-badge {
  display: none !important;
}

/* Restaurant Title (Pink Establishment Name) */
.sl-dining-title {
  font-size: 24px !important; /* Larger font size */
  font-weight: 700 !important;
  color: #be185d !important; /* Pink / Magenta */
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin: 0 0 10px 0 !important;
  font-family: 'Outfit', 'Inter', sans-serif !important;
  line-height: 1.2 !important;
}

/* Discount Details - Removed from HTML */
.sl-dining-promo {
  display: none !important;
}

/* Description / Subtitle */
.sl-dining-desc {
  font-size: 16px !important; /* Larger font size */
  line-height: 1.5 !important;
  color: #475569 !important; /* Muted slate grey */
  margin-bottom: 14px !important;
  font-weight: 500 !important;
}

/* Divider Line - Removed */
.sl-dining-divider {
  display: none !important;
}

/* Footer Row Layout */
.sl-dining-card-footer-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  width: 100% !important;
  margin-top: 12px !important; /* Sits directly below content */
  padding-top: 8px !important;
}

/* Dates (Moved Up, Pink Color, Left Aligned) */
.sl-dining-dates {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  align-items: flex-start !important; /* Align left */
  text-align: left !important;
}

.sl-dining-date-item {
  font-size: 13px !important; /* Larger font size */
  font-weight: 600 !important;
  color: #be185d !important; /* Pink / Magenta */
  line-height: 1.3 !important;
}

.sl-dining-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important; /* 20% smaller than 32px */
  height: 26px !important;
  background: #000000 !important; /* Sleek Black */
  color: #ffffff !important;
  border-radius: 50% !important;
  font-size: 13px !important; /* Scaled down icon size */
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.2s ease-in-out !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
}

.sl-dining-btn:hover {
  background: #be185d !important; /* Pink / Magenta on Hover */
  box-shadow: 0 4px 10px rgba(190, 24, 93, 0.2) !important;
  transform: scale(1.08) !important;
}
