/* ========================= */
/* Define CSS Variables */
/* ========================= */
/* Note: --color-primary, --color-secondary, and --color-card-bg are dynamically set in the blade template */
:root {
  --primary-red: var(--color-primary, #ff0000); /* Use dynamic color or fallback to red */
  --dark-bg: var(--color-secondary, #1a1a1a); /* Use dynamic secondary color or fallback */
  --card-bg: var(--color-primary, var(--color-secondary, #1d1d1d)); /* Use lighter card color or secondary */
  --text-color: var(--color-text, #ffffff);
}

/* ========================= */
/* Global Styles for HTML and Body */
/* ========================= */
* {
  box-sizing: border-box;
}

html {
  background-color: transparent !important;
  background: transparent !important;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  background-color: transparent !important;
  background: transparent !important;
  color: var(--text-color);
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
  font-family: 'Noto Kufi Arabic', sans-serif;
  min-height: 100vh;
  padding-bottom: 20px;
}

/* Make container-fluid transparent */
.container-fluid {
  background-color: transparent !important;
  background: transparent !important;
  margin: 0;
  padding: 0;
}

/* Tablet and Desktop Responsive Styles */
@media (min-width: 768px) {
  body {
    max-width: 900px;
  }
}

@media (min-width: 1024px) {
  body {
    max-width: 1200px;
  }
}

@media (min-width: 1440px) {
  body {
    max-width: 1400px;
  }
}

#menu-container {
  scroll-behavior: smooth;
  overflow-y: auto;
  height: calc(100vh - 200px);
}

@media (min-width: 768px) {
  #menu-container {
    height: calc(100vh - 215px);
  }
}

@media (min-width: 1024px) {
  #menu-container {
    height: calc(100vh - 230px);
  }
}

/* Improve mobile scrollbar appearance */
#menu-container::-webkit-scrollbar {
  width: 6px;
}
#menu-container::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  opacity: 0.5;
  border-radius: 6px;
}

/* ========================= */
/* Top Navigation Bar */
/* ========================= */
.top-bar {
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
}

@media (min-width: 768px) {
  .top-bar {
    padding: 12px 20px;
  }
}

@media (min-width: 1024px) {
  .top-bar {
    padding: 15px 24px;
  }
}

/* ========================= */
/* Logo Styles */
/* ========================= */
.logo {
  height: 45px;
}

.logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .logo {
    height: 50px;
  }
}

@media (min-width: 1024px) {
  .logo {
    height: 55px;
  }
}

/* ========================= */
/* Language Selector Styles */
/* ========================= */
.language-selector {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  width: 40px;
  height: 40px;
}

.language-selector:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.language-selector .fa-globe {
  color: var(--primary-red);
  font-size: 1.2rem;
}

.language-selector .current-language {
  display: none;
}

.language-selector .fa-chevron-down {
  display: none;
}

@media (min-width: 768px) {
  .language-selector {
    padding: 8px;
    width: 38px;
    height: 38px;
  }
  
  .language-selector .fa-globe {
    font-size: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .language-selector {
    padding: 10px;
    width: 42px;
    height: 42px;
  }
  
  .language-selector .fa-globe {
    font-size: 1.3rem;
  }
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 10px;
  padding: 6px 0;
  display: none;
  width: fit-content;
  min-width: 120px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  animation: dropdownFadeIn 0.2s ease;
  overflow: hidden;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.language-dropdown.active {
  display: block;
}

.language-option {
  display: block;
  width: 100%;
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  border: none;
  background: transparent;
  white-space: nowrap;
  box-sizing: border-box;
  text-align: left;
}

.language-option:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.language-option:active {
  background: rgba(255, 255, 255, 0.2);
}

/* ========================= */
/* Menu Header Styles */
/* ========================= */
.menu-header {
  color: var(--primary-red);
  font-size: 2.5rem;
  text-align: center;
  margin: 12px 0;
  font-family: 'Monoton', cursive;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
  .menu-header {
    font-size: 3rem;
    margin: 15px 0;
  }
}

@media (min-width: 1024px) {
  .menu-header {
    font-size: 3.5rem;
    margin: 18px 0;
  }
}

/* ========================= */
/* Category Icons Container */
/* ========================= */
.category-icons {
  display: flex;
  overflow-x: auto;
  padding: 12px 15px;
  gap: 15px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: 45px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99;
}

.category-icons::-webkit-scrollbar {
  display: none;
}

/* Adjust sticky offsets within scroll container */
.category-icons { top: 45px; }
.group-icons { top: 0; position: sticky; }

@media (min-width: 768px) {
  .category-icons {
    padding: 15px 20px;
    gap: 20px;
    top: 50px;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (min-width: 1024px) {
  .category-icons {
    padding: 18px 24px;
    gap: 24px;
    top: 55px;
  }
}

/* ========================= */
/* Individual Category Item */
/* ========================= */
.category-item {
  text-align: center;
  min-width: 95px;
  max-width: 95px;
  cursor: pointer;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.25);
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
  padding: 6px;
}

@supports (background: color-mix(in srgb, red, transparent)) {
  .category-item {
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary-red) 25%, transparent);
  }
}

.category-item:hover {
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .category-item {
    min-width: 105px;
    max-width: 105px;
    padding: 8px;
    border-radius: 14px;
  }
}

@media (min-width: 1024px) {
  .category-item {
    min-width: 120px;
    max-width: 120px;
    padding: 10px;
  }
}

/* Category thumbnail inside category-item */
.category-thumb {
  position: relative;
  width: 100%;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}
.category-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.category-thumb .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 40%, rgba(0,0,0,0.55) 100%);
}

@media (min-width: 768px) {
  .category-thumb {
    height: 65px;
  }
}

@media (min-width: 1024px) {
  .category-thumb {
    height: 75px;
  }
}

/* Ensure active state is visible even without hover */
.category-item.active { border-color: var(--primary-red); }

.category-name {
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .category-name {
    font-size: 0.85rem;
  }
}

@media (min-width: 1024px) {
  .category-name {
    font-size: 0.9rem;
  }
}

/* ========================= */
/* Group Title Styles */
/* ========================= */
.group-title {
  font-size: 1.2rem;
  margin: 15px 15px 10px 15px;
  color: #ffffff;
  font-weight: 500;
  position: relative;
  padding: 10px 0;
  grid-column: 1 / -1;
  text-align: center;
  /*background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);*/
  border-radius: 8px;
}

@media (min-width: 768px) {
  .group-title {
    font-size: 1.4rem;
    margin: 20px 20px 15px 20px;
    padding: 12px 0;
  }
}

@media (min-width: 1024px) {
  .group-title {
    font-size: 1.6rem;
    margin: 24px 24px 18px 24px;
    padding: 14px 0;
  }
}

/* ========================= */
/* Grid Layout for Items */
/* ========================= */
.group-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 15px;
  margin-bottom: 20px;
}

/* Tablet: 3 columns */
@media (min-width: 768px) {
  .group-section {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
  }
}

/* Desktop: 3-4 columns depending on screen size */
@media (min-width: 1024px) {
  .group-section {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 24px;
  }
}

@media (min-width: 1440px) {
  .group-section {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}

/* ========================= */
/* Menu Item Card (Blade structure) */
/* ========================= */
.menu-item {
  /*background: var(--card-bg);*/
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.25);
  border: 2px solid rgba(255, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 0, 0, 0.35);
}

@supports (background: color-mix(in srgb, red, transparent)) {
  .menu-item {
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary-red) 25%, transparent);
    border: 2px solid color-mix(in srgb, var(--primary-red) 25%, transparent);
  }
  
  .menu-item:hover {
    box-shadow: 0 10px 22px color-mix(in srgb, var(--primary-red) 35%, transparent);
  }
}

.item-image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.item-info {
  padding: 12px;
}

.item-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.item-description {
  font-size: 0.85rem;
  margin: 0 0 10px 0;
  color: #ddd;
}

.item-price {
  font-size: 1rem;
  color: var(--text-color);
}

@media (min-width: 768px) {
  .item-image img {
    height: 180px;
  }
  
  .item-info {
    padding: 14px;
  }
  
  .item-name {
    font-size: 1.1rem;
  }
  
  .item-description {
    font-size: 0.9rem;
  }
  
  .item-price {
    font-size: 1.1rem;
  }
}

@media (min-width: 1024px) {
  .item-image img {
    height: 200px;
  }
  
  .item-info {
    padding: 16px;
  }
  
  .item-name {
    font-size: 1.15rem;
  }
  
  .item-description {
    font-size: 0.95rem;
  }
  
  .item-price {
    font-size: 1.15rem;
  }
}

/* ========================= */
/* Legacy classes kept for safety */
/* ========================= */
.carousel-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 15px;
}

.carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.carousel-card { width: 100%; margin: 0; }

.food-card {
  /*background: var(--card-bg);*/
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(255, 0, 0, 0.5);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 240px;
}

@supports (background: color-mix(in srgb, red, transparent)) {
  .food-card {
    box-shadow: 0 4px 8px color-mix(in srgb, var(--primary-red) 50%, transparent);
  }
}

.food-image { width: 100%; height: 150px; object-fit: cover; flex-shrink: 0; }

.food-details { padding: 12px; flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; text-overflow: ellipsis; white-space: normal; word-wrap: break-word; }

.food-title { font-size: 1rem; margin-bottom: 6px; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: normal; }

/* ========================= */
/* Scroll to Top Button */
/* ========================= */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--primary-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: #ff3333;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
}

.scroll-to-top i {
  color: white;
  font-size: 1.2rem;
}

.food-description { font-size: 0.8rem; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: normal; word-wrap: break-word; }

.food-price { font-size: 1rem; color: var(--text-color) }

/* ========================= */
/* Modal Overlay Styles */
/* ========================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /*background: rgba(0, 0, 0, 0.8);*/
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* ========================= */
/* Modal Content Styles */
/* ========================= */
.modal-content {
  background: var(--card-bg);
  width: 90%;
  max-width: 400px;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}

.modal-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

@media (min-width: 768px) {
  .modal-content {
    max-width: 500px;
  }
  
  .modal-image {
    height: 300px;
  }
}

@media (min-width: 1024px) {
  .modal-content {
    max-width: 600px;
  }
  
  .modal-image {
    height: 350px;
  }
}

/* ========================= */
/* Modal Details Section */
/* ========================= */
.modal-details {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}

.modal-details .food-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
  white-space: normal;
}

.modal-details .food-description {
  white-space: normal;
  margin-bottom: 15px;
}

.modal-details .food-price {
  font-size: 1.3rem;
}

/* ========================= */
/* Group Nav Styles */
/* ========================= */
.group-icons {
  display: flex;
  overflow-x: auto;
  padding: 10px 15px;
  gap: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: 0; /* under category bar */
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
}
.group-icons::-webkit-scrollbar { display: none; }

.group-item {
  background: var(--card-bg);
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  border: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(255, 0, 0, 0.2);
}

@supports (background: color-mix(in srgb, red, transparent)) {
  .group-item {
    box-shadow: 0 4px 10px color-mix(in srgb, var(--primary-red) 20%, transparent);
  }
}
.group-item.active { border-color: var(--primary-red); transform: translateY(-1px); }

@media (min-width: 768px) {
  .group-icons {
    padding: 12px 20px;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .group-item {
    padding: 10px 16px;
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  .group-icons {
    padding: 14px 24px;
    gap: 16px;
  }
  
  .group-item {
    padding: 12px 20px;
    font-size: 1.05rem;
  }
}

/* WiFi button and Feedback button styles */
.wifi-btn, .top-bar a {
  background: var(--card-bg);
  border: 2px solid transparent;
  color: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(255,0,0,0.2);
  font-size: 0.9rem;
}
.wifi-btn:hover, .top-bar a:hover { border-color: var(--primary-red); }

@media (min-width: 768px) {
  .wifi-btn, .top-bar a {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
}

@media (min-width: 1024px) {
  .wifi-btn, .top-bar a {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}
