

@import "tailwindcss";

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:root {
  --primary-color: #ffd700;
  --secondary-color: #ffffff;
  --accent-color: #25d366;
  --bg-color: #0c112b;
  --panel-bg: rgba(19, 27, 76, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: rgba(0, 0, 0, 0.4);
  --glow-effect: 0 0 15px rgba(255, 215, 0, 0.3);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: auto;
  direction: rtl;
  min-height: 100vh;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Fast image loading & smooth rendering engine */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.search-page-wrapper {
  background: radial-gradient(circle at top right, #17225c 0%, #0c112b 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 95px 16px !important;
  position: relative;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  touch-action: pan-y pinch-zoom;
}

.search-results-container {
  content-visibility: auto;
  contain-intrinsic-size: 500px;
}


.search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.circle-back-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px var(--glass-shadow);
  backdrop-filter: blur(10px);
}

.circle-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
  border-color: var(--primary-color);
}

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

.search-input-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--panel-bg);
  border: 1.5px solid var(--glass-border);
  border-radius: 30px;
  padding: 0 18px;
  height: 48px;
  gap: 10px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px var(--glass-shadow);
  transition: all 0.3s ease;
}

.search-input-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: var(--glow-effect);
}

.search-box-icon {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.search-input-box:focus-within .search-box-icon {
  color: var(--primary-color);
}

.search-input-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
  direction: rtl;
}

.search-input-box input::placeholder {
  color: var(--text-muted);
}


.search-categories-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 16px 0;
  margin-bottom: 12px;
  scrollbar-width: none; 
  scroll-snap-type: x mandatory;
}

.search-categories-bar::-webkit-scrollbar {
  display: none; 
}

.search-cat-btn {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-snap-align: start;
}

.search-cat-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.search-cat-btn.active {
  background: var(--primary-color);
  color: #0c112b;
  border-color: var(--primary-color);
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}


.search-results-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 80px; 
}

.results-row-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.4s ease;
}

.row-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-color);
  padding-right: 6px;
  border-right: 3px solid var(--primary-color);
  line-height: 1.2;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

#food-results, #home-results {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px;
}


.product-only-card {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px var(--glass-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-only-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 6px 15px rgba(255, 215, 0, 0.25);
  transform: translateY(-2px);
}

.product-only-card .result-card-img-wrap {
  width: 100%;
  height: 100%;
}

.product-only-card .result-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.result-card {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px var(--glass-shadow);
  backdrop-filter: blur(10px);
}

.result-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 6px 15px rgba(255, 215, 0, 0.15);
}

.result-card-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #111a4c;
  overflow: hidden;
  position: relative;
}

.result-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.result-card:hover .result-card-img-wrap img {
  transform: scale(1.08);
}

.result-card-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-card-tag {
  font-size: 10px;
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
}

.result-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 36px;
}


.result-card.page-card {
  aspect-ratio: 1.5;
  justify-content: center;
  align-items: center;
  padding: 16px;
  text-align: center;
  background: linear-gradient(135deg, rgba(25, 36, 94, 0.8) 0%, rgba(13, 18, 54, 0.8) 100%);
}

.page-card-icon {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.page-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}


.no-results-msg {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
}

.no-results-msg svg {
  color: var(--text-muted);
}

.no-results-msg p {
  font-size: 15px;
}


.search-footer-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 500px;
  height: 58px;
  background: rgba(19, 27, 76, 0.85);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px var(--glass-shadow);
  z-index: 100;
}

.square-search-history-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.square-search-history-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.square-search-history-btn:active {
  transform: scale(0.95);
}

.history-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: #ff4a4a;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0c112b;
}


.history-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-panel.active {
  opacity: 1;
  visibility: visible;
}

.history-panel-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(6, 8, 20, 0.75);
  backdrop-filter: blur(4px);
}

.history-panel-content {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 500px;
  background: rgba(14, 20, 56, 0.95);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1.5px solid var(--glass-border);
  border-bottom: none;
  backdrop-filter: blur(25px);
  padding: 24px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px var(--glass-shadow);
}

.history-panel.active .history-panel-content {
  transform: translate(-50%, 0);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.history-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-color);
}

.close-panel-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s;
}

.close-panel-btn:hover {
  color: var(--primary-color);
}

.history-list {
  list-style: none;
  overflow-y: auto;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-color);
}

.history-item-term {
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-item-term i {
  color: var(--text-muted);
  font-size: 12px;
}

.delete-single-history-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s;
}

.delete-single-history-btn:hover {
  color: #ff4a4a;
}

.history-actions {
  display: flex;
  justify-content: center;
}

.clear-all-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 74, 74, 0.15);
  border: 1px solid rgba(255, 74, 74, 0.3);
  color: #ff6b6b;
  padding: 10px 24px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.clear-all-btn:hover {
  background: rgba(255, 74, 74, 0.3);
  transform: scale(1.02);
}

.clear-all-btn:active {
  transform: scale(0.98);
}


.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.confirm-modal.active {
  opacity: 1;
  visibility: visible;
}

.confirm-modal-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(6, 8, 20, 0.85);
  backdrop-filter: blur(5px);
}

.confirm-modal-box {
  position: relative;
  background: rgba(19, 27, 76, 0.95);
  border: 1.5px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px var(--glass-shadow);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-modal.active .confirm-modal-box {
  transform: scale(1);
}

.confirm-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 74, 74, 0.15);
  color: #ff4a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.confirm-modal-box h3 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.confirm-modal-box p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
}

.confirm-btn {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.confirm-btn.yes-btn {
  background: #ff4a4a;
  color: white;
  border: none;
}

.confirm-btn.yes-btn:hover {
  background: #ff2a2a;
}

.confirm-btn.no-btn {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid var(--glass-border);
}

.confirm-btn.no-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}


.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-modal.active {
  opacity: 1;
  visibility: visible;
}

.product-modal-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(6, 8, 20, 0.9);
  backdrop-filter: blur(8px);
}

.product-modal-container.full-image-lightbox {
  position: relative;
  width: 280px;
  max-width: 85vw;
  background: rgba(19, 27, 76, 0.95);
  border: 1.5px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(25px);
  box-shadow: 0 15px 40px var(--glass-shadow);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.product-modal.active .product-modal-container.full-image-lightbox {
  transform: scale(1);
}

.product-modal-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--glass-border);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
}

.product-modal-close-btn:hover {
  background: var(--primary-color);
  color: #0c112b;
}

.product-modal-image-wrap.full-screen-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: #0f1640;
}

.product-modal-image-wrap.full-screen-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =======================================================
   BOTTOM NAVIGATION BAR - Search Page Overrides
   ======================================================= */
.bottom-nav-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 64px !important;
  background: rgba(10, 15, 38, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-top: 1.5px solid rgba(245, 158, 11, 0.35) !important;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5) !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  box-sizing: border-box !important;
  user-select: none !important;
}

.bottom-nav-container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
  width: 100% !important;
  max-width: 540px !important;
  height: 100% !important;
  margin: 0 auto !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

.bottom-nav-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 !important;
  height: 100% !important;
  text-decoration: none !important;
  color: rgba(203, 213, 225, 0.7) !important;
  transition: color 0.15s ease, transform 0.15s ease !important;
  position: relative !important;
  cursor: pointer !important;
  padding: 4px 0 2px 0 !important;
}

.bottom-nav-item:active {
  transform: scale(0.92) !important;
}

.bottom-nav-item .nav-icon-box {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 28px !important;
  position: relative !important;
}

.bottom-nav-item .nav-icon-box svg {
  width: 22px !important;
  height: 22px !important;
  stroke: currentColor !important;
}

.bottom-nav-item .nav-label {
  font-family: 'Cairo', sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px !important;
  line-height: 1.2 !important;
  margin-top: 1px !important;
  white-space: nowrap !important;
}

.bottom-nav-item .nav-active-pill {
  position: absolute !important;
  top: 0 !important;
  width: 24px !important;
  height: 3px !important;
  background: linear-gradient(90deg, #f59e0b, #fbbf24) !important;
  border-radius: 0 0 4px 4px !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.8) !important;
  opacity: 0 !important;
  transform: scaleX(0) !important;
  transition: opacity 0.25s ease, transform 0.25s ease !important;
}

.bottom-nav-item.active {
  color: #f59e0b !important;
}

.bottom-nav-item.active .nav-icon-box {
  transform: translateY(-2px) !important;
}

.bottom-nav-item.active .nav-icon-box svg {
  stroke: #f59e0b !important;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.55)) !important;
}

.bottom-nav-item.active .nav-label {
  color: #f59e0b !important;
  font-weight: 800 !important;
}

.bottom-nav-item.active .nav-active-pill {
  opacity: 1 !important;
  transform: scaleX(1) !important;
}

@media (min-width: 768px) {
  .bottom-nav-bar {
    max-width: 520px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: 14px !important;
    border-radius: 35px !important;
    border: 1.5px solid rgba(245, 158, 11, 0.45) !important;
    height: 62px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6) !important;
  }
}

