

@import "tailwindcss";

: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;
}

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;
}


.search-page-wrapper {
  background: radial-gradient(circle at top right, #17225c 0%, #0c112b 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
  overflow-y: auto;
}


.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;
}

