﻿/* ========== GLOBAL ========== */
body {
  background: radial-gradient(circle at top, #fdfdfd 0%, #e5edf7 60%, #d9e2ec 100%);
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  min-height: 100vh;
  color: #0f172a;
  margin-top: 0px !important;
}
img,
.recipe-image,
.navbar img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* ========== NAVBAR ========== */
.navbar {
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.65);
  padding: 0.7rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.navbar .container {
  width: 100%;
  max-width: 1200px;
  height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}
.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}
.nav-left img {
  height: 45px;
  width: 45px;
  margin-right: 0.7rem;
}
.nav-left h3 {
  margin: 0;
  font-weight: 800;
  color: #f9fafb;
  font-size: 1.7rem;
  letter-spacing: 0.03em;
}
.nav-left p {
  margin: 0;
  font-size: 0.96rem;
  color: #9ca3af;
  font-weight: 400;
}
.nav-text {
  display: flex;
  flex-direction: column;
}
.nav-right .logo {
  height: 65px;
  width: auto;
}
@media (max-width: 600px) {
  .navbar {
    padding: 0.4rem 0;
  }
  .navbar .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    height: auto;
    padding: 0 0.5rem;
  }
  .nav-left {
    flex: 1;
    align-items: center;
  }
  .nav-left h3 {
    font-size: 1rem;
  }
  .nav-left p {
    font-size: 0.75rem;
  }
  .nav-right .logo {
    height: 30px;
  }
}

/* ========== PROMO BAR ========== */
.promo-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 24px;
  margin: 0 0 20px 0;
  background: linear-gradient(135deg, #ed1c24, #c84646);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.4);
  flex-wrap: wrap;
  border-radius: 0 0 24px 24px;
  gap: 20px;
}
.promo-text {
  font-size: 17px;
  font-weight: 500;
  color: #fef9c3;
  line-height: 1.3;
}
.promo-content {
  display: flex;
  flex-direction: column;
}

.promo-title {
  font-size: 20px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}

.cta-button {
  background: #0f172a;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.6);
  min-width: 120px;
}
.cta-button:hover {
  background: #111827;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.75);
}
@media (max-width: 767px) {
  .promo-bar {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 12px 16px;
  }
  .promo-text {
    font-size: 15px;
  }
  .cta-button {
    width: 100%;
    max-width: 220px;
  }
}

/* ========== MAIN LAYOUT ========== */
.main-content {
  display: flex;
  max-width: 1300px;
  margin: 2rem auto;
  gap: 2rem;
  padding: 0 1.5rem;
  min-height: calc(100vh - 140px);
}

/* Recipe count */
.recipe-count-bar {
  display: block;
  color: #ed1c24;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  justify-content: center;
  margin: 0 0 1rem 0;
}

/* Sidebar container */
#desktopFilters {
  flex-basis: 290px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  z-index: 10;
}

/* ========== GLASS FILTERS (DESKTOP + MOBILE) ========== */
.filters {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(241, 245, 249, 0.75));
  border-radius: 20px;
  padding: 16px 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.filter-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 14px;
}
.filter-header::before {
  content: "";
  width: 38px;
  height: 38px;
  border: none;
  /* border-radius: 6px; */
  background: url("chef.png") center/cover no-repeat;
  /* box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08); */
}



.filter-group {
  margin-bottom: 14px;
}
.filter-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}

/* Diet chips */
#dietTypeChipGroup {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.diet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.95);
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.1s ease;
}
.diet-chip-icon {
  width: 13px;
  height: 13px;
  border-radius: 999px;
}
.veg-dot {
  background: #16a34a;
}
.nonveg-dot {
  background: #ef4444;
}
.egg-dot {
  background: #f5c542; /* yellowish for egg */
}
.diet-chip:hover {
  background: rgba(226, 239, 255, 0.98);
  border-color: #38bdf8;
}
.diet-chip.active {
  background: linear-gradient(135deg, #ed1c24, #fb923c);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(248, 113, 113, 0.55);
  transform: translateY(-1px);
}

/* Range slider */
.time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #64748b;
}
#cookingTime,
#cookingTimeMobile {
  flex: 1;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #f97316;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.45);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #f97316;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

/* Radio pills */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  align-items: start;
}

/* Pill itself can grow in height */
.radio-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.92);
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: center;

  /* let content wrap and pill auto‑height */
  flex-wrap: wrap;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;

  color: #0f172a;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.1s ease,
    box-shadow 0.18s ease;
}

.radio-pill input {
  display: none;
}

/* IMPORTANT: allow text to wrap */
.radio-pill span {
  display: block;
  white-space: normal;  /* remove nowrap */
  line-height: 1.2;
}

.radio-pill:hover {
  background: rgba(226, 239, 255, 0.98);
  border-color: #38bdf8;
}

.radio-pill input:checked + span {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #f9fafb;
  border-radius: 999px;
  padding: 4px 9px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.45);
}


/* Clear button */
#clearBtn,
#clearBtnMobile {
  margin-top: 12px;
  width: 100%;
  border-radius: 999px;
  padding: 10px 0;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #0f172a, #020617);
  color: #f9fafb;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.7);
  transition:
    transform 0.1s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease;
}
#clearBtn:hover,
#clearBtnMobile:hover {
  filter: brightness(1.05);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.85);
  transform: translateY(-1px);
}

/* ========== RECIPES GRID (keep behavior) ========== */
#recipesGrid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.3rem;
}

/* Modern recipe card, but structure like before */
.recipe-card {
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at top left, #fefce8, #ffffff 48%, #e0f2fe 110%);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 26px 55px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(148, 163, 184, 0.24);
}
.recipe-card-image-wrap {
  position: relative;
  overflow: hidden;
}
.recipe-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.recipe-time-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #f9fafb;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.recipe-card-body {
  padding: 12px 12px 11px;
}
.recipe-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.recipe-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}
.recipe-meta {
  margin: 4px 0 6px;
  font-size: 0.78rem;
  color: #6b7280;
}

/* Diet icon square like before */
.diet-icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-block;
  box-sizing: content-box;
  border-radius: 3px;
}

/* Veg square + dot */
.diet-icon.veg {
  border: 2.5px solid green;
  background-color: transparent;
}

/* Non‑veg square + dot */
.diet-icon.non-veg {
  border: 2.5px solid red;
  background-color: transparent;
}
.diet-icon.egg {
  border: 2.5px solid #FFD700;
  background-color: transparent;
}
/* COMMON center dot */
.diet-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);  /* perfectly center inside square */
}

/* Color the dot per type */
.diet-icon.veg::before {
  background-color: green;
}
.diet-icon.non-veg::before {
  background-color: red;
}
.diet-icon.egg::before {
  background-color:#FFD700;
}
/* Badges row */
.badge-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  justify-content: flex-start;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  background: #f3f4f6;
  color: #374151;
}
.badge.on2cook {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-icon {
  font-size: 0.9rem;
}

/* ========== MOBILE FILTERS ONLY ON MOBILE ========== */
.mobile-filter-btn,
.mobile-filter-modal {
  display: none;
}
@media (max-width: 800px) {
  #desktopFilters {
    display: none !important;
  }
.mobile-filter-btn {
  display: flex !important;
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 5001;
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  box-shadow: 0 3px 18px rgba(0, 0, 0, 0.18);
  justify-content: center;
  align-items: center;
  cursor: pointer;
  animation: filterBounce 1.8s ease-in-out infinite; /* Continuous gentle bounce */
  transition: all 0.2s ease; /* Smooth hover interactions */
}

.mobile-filter-btn:hover {
  animation-play-state: paused; /* Pause bounce on hover */
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.mobile-filter-btn:active {
  transform: translateY(0) scale(0.98);
}

@keyframes filterBounce {
  0%, 100% { 
    transform: translateY(0); 
  }
  50% { 
    transform: translateY(-50px); 
  }
}

  .mobile-filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    z-index: 7000;
    justify-content: center;
    align-items: center;
    display: none;
  }
  .mobile-filter-modal.active {
    display: flex !important;
  }
  .mobile-filter-content {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border-radius: 18px;
    padding: 1.7rem 1.2rem;
    width: 96vw;
    max-width: 400px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(20px);
  }
  .close-filter-btn {
    position: absolute;
    top: 10px;
    right: 18px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #9ca3af;
    cursor: pointer;
    z-index: 10;
  }
  #recipesGrid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
@media (max-width: 1024px) and (min-width: 801px) {
  #recipesGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.empty-state {
  grid-column: 1 / -1;
  align-self: start;
  padding: 50px 50px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.95));
  border: 1px solid rgba(237, 28, 36, 0.18);
  box-shadow:
    0 22px 55px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(148, 163, 184, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}


.empty-illustration {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at top, #ffe6e6, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(237, 28, 36, 0.35);
  margin-bottom: 4px;
}
.empty-emoji {
  font-size: 1.8rem;
}
.empty-sparkle {
  position: absolute;
  bottom: -4px;
  right: -2px;
  font-size: 1rem;
}

.empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #231f20;
}

.empty-text {
  margin: 0;
  max-width: 380px;
  font-size: 0.9rem;
  color: #6b7280;
}

.empty-btn {
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ed1c24, #f97373);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(237, 28, 36, 0.55);
  transition: transform 0.1s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.empty-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(237, 28, 36, 0.7);
}

/* Search input styling */
#searchBarDesktop {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

#searchBarDesktop:focus {
  outline: none;
  border-color: #ed1c24;
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

/* Sort controls */
.sort-controls {
  display: flex;
  gap: 6px;
}

.sort-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.95);
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.sort-btn:hover {
  background: rgba(226, 239, 255, 0.98);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.sort-btn.active {
  background: linear-gradient(135deg, #ed1c24, #fb923c);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(237, 28, 36, 0.4);
}
/* Add to your existing CSS - mobile sort buttons need slight adjustment */
@media (max-width: 800px) {
  /* Mobile sort buttons - stack vertically for better space */
  .mobile-filter-content .sort-controls {
    flex-direction: column;
    gap: 8px;
  }
  
  .mobile-filter-content .sort-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
    border-radius: 12px;
  }
  
  /* Dark theme adjustments for mobile modal */
  .mobile-filter-content .sort-btn {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(148, 163, 184, 0.6);
    color: #0f172a;
  }
  
  .mobile-filter-content .sort-btn.active {
    background: linear-gradient(135deg, #ed1c24, #fb923c);
    color: white;
  }
  
  .mobile-filter-content .sort-btn:hover {
    background: rgba(226, 239, 255, 0.98);
    border-color: #38bdf8;
  }
}

/* Popup Modal Styles */
.popup-container {
  position: relative;
  background: #fff;
  padding: 24px;
  border-radius: 20px;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.popup-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.popup-close-btn:hover {
  background: #ef4444;
  transform: scale(1.1);
}

.popup-image-wrapper {
  position: relative;
  width: 100%;
  height: 70vh;
  max-height: 600px;
  overflow: hidden;
  border-radius: 16px;
  background: #f8fafc;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-image-wrapper:active {
  cursor: grabbing;
}

.popup-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  transition: transform 0.2s ease;
  user-select: none;
  pointer-events: auto;
  border-radius: 12px;
}
#popupPDF {
  width: 100%;
  height: 100%;
  transition: transform 0.2s ease;
  user-select: none;
  pointer-events: auto;
  border-radius: 12px;
}

.zoom-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.zoom-btn {
  background: rgba(15, 23, 42, 0.8);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-btn:hover {
  background: #ed1c24;
  transform: scale(1.05);
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-reset {
  font-size: 14px;
}

.zoom-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .popup-container {
    padding: 20px;
    margin: 10px;
    max-width: calc(100vw - 20px);
  }
  
  .popup-image-wrapper {
    height: 60vh;
  }
  
  .zoom-controls {
    bottom: 12px;
    padding: 6px 10px;
  }
  
  .zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}
.filter-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#applyBtnMobile {
  flex: 1;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 22px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#applyBtnMobile:hover,
#applyBtnMobile:active {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

#clearBtnMobile {
  flex: 1;
  margin: 0; /* Reset any existing margin */
}
/* Mobile sort controls - side by side */
.sort-controls-mobile {
  display: flex;
  gap: 8px;
  flex-direction: row; /* Force side-by-side */
}

.mobile-filter-content .sort-controls-mobile .sort-btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.88rem;
  border-radius: 12px;
  min-height: 48px; /* Touch-friendly */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Override the existing mobile sort stacking */
@media (max-width: 800px) {
  .mobile-filter-content .sort-controls {
    flex-direction: column !important;
  }
  
  .mobile-filter-content .sort-controls-mobile {
    flex-direction: row !important;
    gap: 8px;
  }
  
  .mobile-filter-content .sort-controls-mobile .sort-btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 14px 12px;
  }
}
/* ========== ENHANCED MOBILE FILTER PANEL ========== */
@media (max-width: 800px) {
  .mobile-filter-content {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.88));
    color: #0f172a;
    border-radius: 24px;
    padding: 24px 20px 28px;
    width: 94vw;
    max-width: 420px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 
      0 32px 80px rgba(15, 23, 42, 0.25),
      0 0 0 1px rgba(255, 255, 255, 0.7);
  }

  /* Enhanced header */
  .mobile-filter-content .filter-header {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    position: relative;
  }

  .mobile-filter-content .filter-header::before {
    background: url("chef.png") center/cover no-repeat;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  }

  /* Enhanced labels */
  .mobile-filter-content .filter-group label {
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
  }

  /* Search input - glassmorphism */
  #searchBarMobile {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    color: #0f172a;
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
  }

  #searchBarMobile:focus {
    outline: none;
    border-color: #ed1c24;
    box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.15);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
  }

  #searchBarMobile::placeholder {
    color: #94a3b8;
  }

  /* PERFECTED Sort buttons - side by side */
  .sort-controls-mobile {
    display: flex;
    gap: 10px;
    margin-top: 4px;
  }

  .mobile-filter-content .sort-controls-mobile .sort-btn {
    flex: 1;
    padding: 16px 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 16px;
    min-height: 52px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mobile-filter-content .sort-btn.active {
    background: linear-gradient(135deg, #ed1c24, #fb923c);
    color: white;
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(237, 28, 36, 0.35);
    transform: translateY(-2px);
  }

  .mobile-filter-content .sort-btn:hover:not(.active) {
    background: rgba(237, 28, 36, 0.08);
    border-color: #ed1c24;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(237, 28, 36, 0.15);
  }

  /* Select dropdowns - glassmorphism */
  .mobile-filter-content select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    color: #0f172a;
    backdrop-filter: blur(12px);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 44px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-filter-content select:focus {
    outline: none;
    border-color: #ed1c24;
    box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.15);
    background: rgba(255, 255, 255, 0.95);
  }

  /* Enhanced slider */
  .mobile-filter-content .time-row {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px 16px;
    border-radius: 16px;
    backdrop-filter: blur(12px);
    gap: 12px;
  }

  .mobile-filter-content #cookingTimeMobile {
    height: 6px;
    width: 80%;
    background: rgba(148, 163, 184, 0.4);
  }

  .mobile-filter-content input[type="range"]::-webkit-slider-thumb {
    height: 20px;
    background: linear-gradient(135deg, #ed1c24, #fb923c);
    border: 2px solid white;
    box-shadow: 0 6px 16px rgba(237, 28, 36, 0.3);
  }

  /* PERFECTED Action buttons */
  .filter-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    gap: 12px;
  }

  #applyBtnMobile {
    flex: 1;
    background: linear-gradient(135deg, #ed1c24, #fb923c);
    border-radius: 20px;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    min-height: 56px;
    box-shadow: 0 12px 32px rgba(237, 28, 36, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #applyBtnMobile:hover,
  #applyBtnMobile:active {
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(237, 28, 36, 0.45);
  }

  #clearBtnMobile {
    flex: 1;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
    border-radius: 20px;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    min-height: 56px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(12px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #clearBtnMobile:hover {
    background: linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(30, 41, 59, 1));
    border-color: rgba(237, 28, 36, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.4);
  }

  /* Close button */
  .close-filter-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 22px;
    font-weight: 300;
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
  }

  .close-filter-btn:hover {
    background: #ef4444;
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
  }

  /* Scrollbar */
  .mobile-filter-content::-webkit-scrollbar {
    width: 4px;
  }
  .mobile-filter-content::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 2px;
  }
  .mobile-filter-content::-webkit-scrollbar-thumb {
    background: rgba(237, 28, 36, 0.4);
    border-radius: 2px;
  }
}
/* ✅ FIX SEARCH BAR OVERFLOW */
.mobile-filter-content #searchBarMobile {
  box-sizing: border-box !important;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 14px 16px !important;
}

/* Ensure container doesn't clip */
.mobile-filter-content .filter-group {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  margin-bottom: 16px;
}
/* ========== DOWNLOAD BUTTON STYLES ========== */
/* ========== DOWNLOAD BUTTON - HOVER ONLY ========== */
.recipe-card-image-wrap {
  position: relative;
  overflow: hidden;
}

.download-btn {
  /* HIDDEN BY DEFAULT */
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 12px;
  left: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ed1c24, #fb923c);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(237, 28, 36, 0.4);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 15;
  backdrop-filter: blur(12px);
  transform: scale(0.8) translateY(4px);
}

.download-btn:hover {
  background: linear-gradient(135deg, #dc2626, #f59e0b);
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 28px rgba(237, 28, 36, 0.6);
}

.download-btn:active {
  transform: scale(0.95) translateY(0);
  box-shadow: 0 6px 16px rgba(237, 28, 36, 0.5);
}

.download-btn svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* SHOW ON HOVER */
.recipe-card:hover .download-btn,
.recipe-image:hover + .download-btn {
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) translateY(0);
}

/* Smooth entrance animation */
.recipe-card:hover .download-btn {
  animation: downloadBtnSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes downloadBtnSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Ensure button stays above time pill */
.recipe-time-pill {
  z-index: 10;
}
