:root {
  --primary-color: #bb873a;
  --primary-dark: #9e6209;
  --secondary-color: #2c3e50;
  --accent-color: #12b3f3;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --text-color: #333;
  --text-light: #777;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

  /* Theme specific variables */
  --bg-color: #f9f9f9;
  --surface-color: white;
  --modal-footer-bg: #f8f8f8;
  --quantity-btn-bg: #f0f0f0;
  --quantity-btn-hover-bg: #e0e0e0;
  --empty-cart-icon-color: #ddd;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Cairo", sans-serif;
}

body {
  background-color: var(--bg-color); /* Use variable */
  color: var(--text-color);
  line-height: 1.6;
}

/* Navbar Styles */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 5%;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
  background-color: transparent;
}

.navbar.scrolled {
  background: linear-gradient(rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0));

  /* background-color: rgba(255, 255, 255, 0.98); */
  box-shadow: var(--shadow);
  padding: 15px 5%;
}

.logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 45px;
  width: auto;
  transition: var(--transition);
  -webkit-filter: drop-shadow(5px 5px 5px #eebbbb);
  filter: drop-shadow(5px 5px 5px #f19b9b);
}

.restaurant-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--light-color);
  margin-right: 15px;
  transition: var(--transition);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar.scrolled .restaurant-title {
  color: var(--primary-color);
  text-shadow: none;
}

.cart-icon {
  position: relative;
  font-size: 24px;
  color: var(--light-color);
  cursor: pointer;
  transition: var(--transition);
}

.navbar.scrolled .cart-icon {
  color: var(--dark-color);
}

.cart-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: bold;
}

/* Header Section */
.header {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 0;
}

.header-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  padding: 0 5%;
  width: 100%;
}

.header-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-subtitle {
  font-size: 1.5rem;
  margin-bottom: 40px;
  font-weight: 300;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.menu-btn {
  display: inline-block;
  width: 90%;
  padding: 18px 40px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin: 0 auto 30px;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.menu-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 25px;
}

.social-icon {
  color: white;
  font-size: 28px;
  transition: var(--transition);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.social-icon:hover {
  transform: translateY(-5px);
  color: var(--accent-color);
}

/* Food Class Section */
.food-section {
  padding: 100px 5% 80px;
  background-color: var(--bg-color); /* Use variable */
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
  font-size: 2.5rem;
  color: var(--dark-color);
  position: relative;
  font-weight: 700;
}

.section-title::after {
  content: "";
  display: block;
  width: 100px;
  height: 5px;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--accent-color)
  );
  margin: 20px auto 0;
  border-radius: 5px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 50px;
  font-size: 1.2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.food-classes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.food-classes-blind {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 30px;
}

.food-class-less {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  height: 100px;
  /* aspect-ratio: 1/1; */
}

.food-class {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  aspect-ratio: 1/1;
}

.food-class:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.food-class-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}

.food-class:hover .food-class-img {
  transform: scale(1.05);
}

.food-class-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  padding: 25px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Spinner */
.spinner-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--surface-color); /* Use variable */
  margin: 80px auto;
  max-width: 1000px;
  width: 90%;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  position: sticky;
  top: 0;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 30px;
  max-height: 70vh;
  overflow-y: auto;
}

.food-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.food-item {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  background-color: var(--surface-color); /* Use variable */
}

.food-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.food-item-img-container {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.food-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}

.food-item:hover .food-item-img {
  transform: scale(1.05);
}

.food-item-price {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: rgba(231, 76, 60, 0.95);
  color: white;
  padding: 6px 15px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.food-item-details {
  padding: 20px;
}

.food-item-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dark-color);
}

.food-item-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.add-to-cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
}

.add-to-cart-btn:hover {
  background: linear-gradient(to right, var(--primary-dark), #a53125);
  box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
}

.modal-footer {
  padding: 20px 30px;
  background-color: var(--modal-footer-bg); /* Use variable */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee; /* Keep light border for light theme */
  position: sticky;
  bottom: 0;
}

.total-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark-color);
}

.total-amount {
  color: var(--primary-color);
  font-size: 1.3rem;
}

.whatsapp-btn {
  background: linear-gradient(to right, #25d366, #128c7e);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
  background: linear-gradient(to right, #128c7e, #0e6e5e);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

/* Cart Modal */
.cart-items {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid #eee; /* Keep light border for light theme */
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.cart-item-text {
  flex: 1;
}

.cart-item-title {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 5px;
}

.cart-item-price {
  color: var(--primary-color);
  font-weight: 700;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-btn {
  background-color: var(--quantity-btn-bg); /* Use variable */
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  font-weight: bold;
  font-size: 1rem;
}

.quantity-btn:hover {
  background-color: var(--quantity-btn-hover-bg); /* Use variable */
}

.remove-item-btn {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1.2rem;
  margin-right: 10px;
  transition: var(--transition);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.remove-item-btn:hover {
  background-color: rgba(231, 76, 60, 0.1);
}

.empty-cart {
  text-align: center;
  padding: 40px 0;
  color: var(--text-light);
}

.empty-cart i {
  font-size: 3rem;
  color: var(--empty-cart-icon-color); /* Use variable */
  margin-bottom: 20px;
}

/* Floating Notification */
.notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--primary-color);
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 992px) {
  .header-title {
    font-size: 2.8rem;
  }

  .header-subtitle {
    font-size: 1.2rem;
  }

  .section-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 15px;
  }

  .restaurant-title {
    font-size: 1.8rem;
    margin-right: 10px;
  }

  .logo-img {
    height: 35px;
  }

  .header-title {
    font-size: 2.2rem;
  }

  .header-subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  .menu-btn {
    padding: 15px 30px;
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .food-classes {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .modal-content {
    width: 95%;
  }

  .food-items {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-direction: column;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .header-title {
    font-size: 1.8rem;
  }

  .restaurant-title {
    display: none;
  }

  .food-class-title {
    font-size: 1.2rem;
    padding: 15px;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .cart-item-quantity {
    width: 100%;
    justify-content: space-between;
  }
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Dark Theme Styles */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #d4a05d; /* Slightly lighter primary for dark */
    --primary-dark: #bb873a;
    /* --secondary-color: #5a7a9a; */ /* Keep secondary? */
    --accent-color: #4cc9f0; /* Lighter accent */
    --light-color: #3a3a3a; /* Dark surface */
    --dark-color: #e0e0e0; /* Light text on dark */
    --text-color: #e0e0e0; /* Light text */
    --text-light: #a0a0a0; /* Lighter light text */
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Darker shadow */

    /* Theme-specific overrides */
    --bg-color: #1f1f1f;
    --surface-color: #2d2d2d;
    --modal-footer-bg: #252525;
    --quantity-btn-bg: #444;
    --quantity-btn-hover-bg: #555;
    --empty-cart-icon-color: #555;
  }

  /* Adjust specific elements for dark theme */
  .navbar.scrolled {
    background: linear-gradient(rgba(0, 0, 0, 0.7) 40%, rgba(0, 0, 0, 0));
    /* background-color: rgba(31, 31, 31, 0.95); */ /* Alternative solid background */
  }
  .navbar.scrolled .restaurant-title {
    color: var(--primary-color); /* Use the adjusted primary */
  }
  .navbar.scrolled .cart-icon {
    color: var(--text-color); /* Use light text color */
  }
  .section-title {
    color: var(--text-color); /* Use light text */
  }
  .section-subtitle {
    color: var(--text-light); /* Use lighter light text */
  }
  .modal-content {
    box-shadow: 0 10px 50px rgba(255, 255, 255, 0.1); /* Lighter shadow for dark */
  }
  .food-item {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Adjust shadow */
  }
  .food-item:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  }
  .food-item-title {
    color: var(--text-color); /* Use light text */
  }
  .food-item-desc {
    color: var(--text-light); /* Use lighter light text */
  }
  .modal-footer {
    border-top: 1px solid #444; /* Darker border */
  }
  .total-price {
    color: var(--text-color); /* Use light text */
  }
  .total-amount {
    color: var(--primary-color); /* Use adjusted primary */
  }
  .cart-item {
    border-bottom: 1px solid #444; /* Darker border */
  }
  .cart-item-title {
    color: var(--text-color); /* Use light text */
  }
  .cart-item-price {
    color: var(--primary-color); /* Use adjusted primary */
  }
  .quantity-btn {
    color: var(--text-color); /* Ensure text is visible */
  }
  .remove-item-btn {
    color: #ff6b6b; /* Lighter red */
  }
  .remove-item-btn:hover {
    background-color: rgba(255, 107, 107, 0.1);
  }
  .notification {
    background-color: var(--primary-dark); /* Use darker primary */
    color: #fff; /* Ensure white text */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  }
}

/* Scroll to Top Button */
#scrollToTopBtn {
  display: none; /* Hidden by default */
  position: fixed;
  bottom: 20px;
  left: 30px; /* Changed from right to left */
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  font-size: 18px;
  box-shadow: var(--shadow);
  transition: background-color 0.3s, opacity 0.5s, visibility 0.5s;
  opacity: 0;
  visibility: hidden;
}

#scrollToTopBtn:hover {
  background-color: var(--primary-dark);
}

#scrollToTopBtn.show {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Adjust scroll-to-top button for dark theme */
@media (prefers-color-scheme: dark) {
  #scrollToTopBtn {
    background-color: var(--primary-color); /* Use adjusted primary */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); /* Darker shadow */
  }

  #scrollToTopBtn:hover {
    background-color: var(--primary-dark); /* Use adjusted darker primary */
  }
}
