/* Basic Reset & Font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Cairo", sans-serif;
  background-color: #12121f; /* Darker futuristic background */
  color: #e0e0e0; /* Light text color */
  line-height: 1.6;
  direction: rtl; /* Right-to-left layout */
  overflow-x: hidden; /* Prevent horizontal scroll */
}

h2,
h3 {
  color: #00e5ff; /* Brighter Cyan accent for headings */
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 700;
  text-shadow: 0 0 5px rgba(0, 229, 255, 0.5); /* Subtle glow */
}

a {
  color: #00e5ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ffffff;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Loading Spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(18, 18, 31, 0.85); /* Match body background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.spinner-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  border: 6px solid rgba(0, 229, 255, 0.2); /* Cyan border */
  border-top: 6px solid #00e5ff; /* Solid cyan top */
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 229, 255, 0.9); /* Cyan background */
  color: #12121f; /* Dark text */
  padding: 12px 25px;
  border-radius: 8px;
  z-index: 1002; /* Above popups */
  opacity: 0; /* Start hidden */
  transition: opacity 0.5s ease, bottom 0.5s ease;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 3px 10px rgba(0, 229, 255, 0.3);
}

.toast-notification.show {
  opacity: 1;
  bottom: 30px; /* Animate upwards slightly */
}

/* Image/Video Loading Placeholder */
.loading-placeholder {
  position: relative;
  background: linear-gradient(45deg, #1a1a2e, #2a2a3e);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px; /* Adjust as needed */
  border-radius: 8px;
  overflow: hidden;
}

.loading-placeholder::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 229, 255, 0.1),
    transparent
  );
  animation: loading-shine 1.5s infinite;
}

@keyframes loading-shine {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Navbar */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: transparent;
  padding: 15px 0;
  transition: background-color 0.4s ease, padding 0.4s ease,
    box-shadow 0.4s ease;
}

#navbar.scrolled {
  background-color: rgba(
    18,
    18,
    31,
    0.95
  ); /* Dark semi-transparent background */
  padding: 10px 0;
  box-shadow: 0 2px 15px rgba(0, 229, 255, 0.1);
}

.navbar-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left, /* Container for Cart */
.nav-right {
  /* Container for Logo */
  flex: 1;
}

.nav-center {
  /* Container for Title */
  flex: 0 0 auto; /* Don't grow or shrink, size based on content */
  text-align: center;
}

.nav-right {
  /* Logo container alignment */
  text-align: left; /* Align logo to the left (since dir=rtl makes left the start) */
}

.nav-left {
  /* Cart container alignment */
  text-align: right; /* Align cart to the right (since dir=rtl makes right the end) */
}

.logo {
  height: 40px; /* Adjust as needed */
  max-height: 40px;
  transition: height 0.4s ease;
  display: inline-block; /* Ensure it aligns correctly */
}

#navbar.scrolled .logo {
  height: 35px;
}

.restaurant-title {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-icon-container {
  position: relative;
  cursor: pointer;
  color: #ffffff;
  font-size: 1.5rem;
  transition: color 0.3s ease;
  display: inline-block; /* To contain the badge properly */
}

.cart-icon-container:hover {
  color: #00e5ff;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background-color: #ff4d4d; /* Red for attention */
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: bold;
  line-height: 1;
  min-width: 18px; /* Ensure minimum width */
  text-align: center;
  border: 1px solid #12121f;
}

/* Header Section */
#header {
  height: 100vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end; /* Align content to bottom */
  text-align: center;
  overflow: hidden;
}

.header-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: -2;
}

.header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(18, 18, 31, 0.1),
    rgba(18, 18, 31, 0.8)
  ); /* Gradient overlay */
  z-index: -1;
}

.header-content {
  z-index: 1;
  padding-bottom: 5vh; /* Space from bottom */
  width: 90%;
}

.menu-button {
  display: inline-block;
  background: linear-gradient(45deg, #00e5ff, #00aaff);
  color: #12121f; /* Dark text on bright button */
  padding: 15px 40px;
  border-radius: 50px; /* Pill shape */
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 20px;
  width: 90%;
  max-width: 400px; /* Max width for the button */
  box-shadow: 0 5px 15px rgba(0, 229, 255, 0.3);
}

.menu-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 229, 255, 0.5);
  color: #12121f;
}

.social-media-links {
  margin-top: 15px;
}

.social-media-links a {
  color: #ffffff;
  font-size: 1.8rem;
  margin: 0 12px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-media-links a:hover {
  color: #00e5ff;
  transform: scale(1.1);
}

/* Food Class Section */
.food-classes-section {
  padding: 80px 5%;
  background-color: #1a1a2e; /* Slightly lighter dark shade */
}

.food-class-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(280px, 1fr)
  ); /* Responsive grid */
  gap: 30px;
}

.food-class-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #2a2a3e; /* Card background */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.food-class-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 229, 255, 0.2);
}

.food-class-item img {
  width: 100%;
  height: 250px; /* Fixed height for consistency */
  object-fit: cover;
  transition: transform 0.4s ease;
}

.food-class-item:hover img {
  transform: scale(1.1);
}

.food-class-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(
    to top,
    rgba(18, 18, 31, 0.9),
    rgba(18, 18, 31, 0.5)
  );
  color: #ffffff;
  padding: 15px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  transition: background 0.3s ease;
}

.food-class-item:hover .food-class-title {
  background: linear-gradient(
    to top,
    rgba(0, 229, 255, 0.8),
    rgba(0, 229, 255, 0.4)
  );
  color: #12121f;
}

/* Popups (General) */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(18, 18, 31, 0.9); /* Semi-transparent dark */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(5px); /* Frosted glass effect */
}

.popup.show {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background-color: #1a1a2e;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 800px; /* Max width for item popup */
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.2);
}

/* Custom scrollbar for popup */
.popup-content::-webkit-scrollbar {
  width: 8px;
}

.popup-content::-webkit-scrollbar-track {
  background: #2a2a3e;
  border-radius: 10px;
}

.popup-content::-webkit-scrollbar-thumb {
  background-color: #00e5ff;
  border-radius: 10px;
  border: 2px solid #2a2a3e;
}

.close-btn {
  position: absolute;
  top: 15px;
  left: 20px; /* Adjusted for LTR close button position in RTL */
  font-size: 2rem;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
  z-index: 11; /* Ensure it's above the fixed title */
}

.close-btn:hover {
  color: #ff4d4d; /* Red on hover */
}

/* Cart Popup */
#cart-popup .popup-content {
  max-width: 500px; /* Smaller width for cart */
}

.cart-items-list {
  margin-bottom: 20px;
  max-height: 40vh; /* Limit height */
  overflow-y: auto;
  padding-right: 10px; /* Space for scrollbar */
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #2a2a3e;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-details {
  flex-grow: 1;
  margin-right: 15px; /* Space between details and controls */
}

.cart-item-title {
  font-weight: bold;
  color: #ffffff;
}

.cart-item-price {
  color: #00e5ff;
  font-size: 0.9rem;
  text-align: right;
}

.cart-item-controls {
  display: flex;
  align-items: center;
}

.cart-item-controls button {
  background: none;
  border: 1px solid #00e5ff;
  color: #00e5ff;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  margin: 0 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.cart-item-controls button:hover {
  background-color: #00e5ff;
  color: #12121f;
}

.cart-item-count {
  min-width: 20px;
  text-align: center;
  font-weight: bold;
}

.cart-total {
  text-align: left; /* Align total to the left */
  margin-top: 20px;
  font-size: 1.2rem;
  font-weight: bold;
  border-top: 1px solid #3a3a4e;
  padding-top: 15px;
}

.cart-total strong {
  color: #00e5ff;
}

/* Item Popup */
.item-popup .popup-content {
  padding-top: 70px; /* Space for fixed title */
}

.popup-title-fixed {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  background-color: #1a1a2e; /* Match popup background */
  padding: 20px 30px;
  margin: 0; /* Override default margin */
  z-index: 10; /* Ensure it's above scrolling content */
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  box-sizing: border-box; /* Include padding in width */
  border-top-left-radius: 10px; /* Match popup radius */
  border-top-right-radius: 10px;
}

.item-list-grid {
  display: grid;
  grid-template-columns: 1fr; /* Change to single column */
  gap: 20px; /* Keep the gap */
}

.food-item-card {
  position: relative;
  background-color: #2a2a3e;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.food-item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 15px rgba(0, 229, 255, 0.15);
}

.food-item-image-container {
  position: relative;
  height: 180px; /* Fixed height for item images */
}

.food-item-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.food-item-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(18, 18, 31, 0.8), transparent);
  color: #ffffff;
  padding: 10px;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
}

.food-item-price {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 229, 255, 0.8); /* Cyan background */
  color: #12121f; /* Dark text */
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.food-item-details {
  padding: 15px;
  text-align: center;
}

.add-to-cart-btn {
  background: linear-gradient(45deg, #00e5ff, #00aaff);
  color: #12121f;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 0; /* Center button */
}

.add-to-cart-btn i {
  margin-left: 8px; /* Space between icon and text (RTL) */
}

.add-to-cart-btn:hover {
  background: linear-gradient(45deg, #00ccee, #0099dd);
  transform: scale(1.05);
}

/* WhatsApp Button */
.whatsapp-button {
  display: inline-flex; /* Use inline-flex for icon alignment */
  align-items: center;
  justify-content: center;
  background-color: #25d366; /* WhatsApp green */
  color: white;
  padding: 12px 25px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  margin-top: 20px;
  width: 100%; /* Make button full width within its container */
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.whatsapp-button i {
  margin-left: 10px; /* Space between icon and text (RTL) */
  font-size: 1.3rem;
}

.whatsapp-button:hover {
  background-color: #1ebe5a;
  transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .navbar-container {
    width: 95%;
    justify-content: space-between; /* Distribute space */
  }
  .nav-left {
    /* Cart Icon Container */
    flex-basis: 50px; /* Give cart icon a fixed base width */
    flex-grow: 0;
    order: 3; /* Cart on the right */
    text-align: right; /* Align icon within its container */
  }
  .nav-center {
    /* Title Container */
    flex-grow: 1; /* Allow title to take up remaining space */
    padding: 0 10px; /* Add some padding around title */
    order: 2; /* Title in the middle */
    text-align: center;
  }
  .nav-right {
    /* Logo Container */
    flex-basis: 50px; /* Give logo a fixed base width */
    flex-grow: 0;
    order: 1; /* Logo on the left */
    text-align: left; /* Align icon within its container */
  }
  .restaurant-title {
    font-size: 0.9rem;
    display: none; /* Hide title on mobile */
  }
  .logo {
    height: 35px;
    max-height: 35px;
  }
  #navbar.scrolled .logo {
    height: 30px;
  }
  .menu-button {
    padding: 12px 30px;
    font-size: 1rem;
    width: 80%;
  }
  .social-media-links a {
    font-size: 1.5rem;
    margin: 0 8px;
  }
  .food-classes-section {
    padding: 60px 3%;
  }
  .food-class-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }
  .item-list-grid {
    grid-template-columns: 1fr; /* Ensure single column on tablet/mobile */
    gap: 15px;
  }
  .popup-content {
    width: 95%;
    padding: 20px;
  }
  .item-popup .popup-content {
    padding-top: 60px; /* Adjust for smaller fixed title */
  }
  .popup-title-fixed {
    padding: 15px 20px;
    font-size: 1.1rem;
  }
  .close-btn {
    top: 10px;
    left: 15px;
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .food-class-grid {
    grid-template-columns: 1fr; /* Single column on very small screens */
    gap: 15px;
  }
  .item-list-grid {
    grid-template-columns: 1fr; /* Ensure single column on smallest screens */
    gap: 10px;
  }
  .food-item-image-container {
    height: 150px;
  }
  .logo {
    height: 30px;
  }
  #navbar.scrolled .logo {
    height: 28px;
  }
  .cart-icon-container {
    font-size: 1.3rem;
  }
  .cart-badge {
    top: -5px;
    right: -8px;
    font-size: 0.6rem;
    min-width: 15px;
  }
  .restaurant-title {
    display: none; /* Hide title on very small screens */
  }
  .logo {
    /* Re-apply logo size for this breakpoint */
    height: 30px;
    max-height: 30px;
  }
  #navbar.scrolled .logo {
    /* Re-apply scrolled logo size */
    height: 28px;
  }
}
