/* ==============================
   مطعم الأصيل – Design System
   ============================== */

:root {
  --gold:        #C8860A;
  --gold-light:  #F0C060;
  --gold-dark:   #8B5E04;
  --accent:      #E8522A;
  --bg:          #0C0700;
  --bg-card:     #1A0E03;
  --bg-card2:    #241506;
  --border:      rgba(200,134,10,0.18);
  --text:        #EDE0C8;
  --text-muted:  #9A8A72;
  --radius:      14px;
  --shadow:      0 8px 32px rgba(0,0,0,0.5);
  --trans:       all 0.3s ease;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
[dir="ltr"] body { font-family: 'Inter', 'Cairo', sans-serif; }

a { color: var(--gold-light); text-decoration: none; transition: var(--trans); }
a:hover { color: var(--gold); }
img { max-width: 100%; display: block; }

/* ========== NAVBAR ========== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(12,7,0,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 70px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  font-size: 1.6rem; font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-family: 'Playfair Display', 'Cairo', serif;
  letter-spacing: 1px;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a {
  color: var(--text-muted); font-size: 0.95rem; font-weight: 600;
  padding: 0.4rem 0; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--gold); transform: scaleX(0);
  transition: transform 0.3s; border-radius: 2px;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold-light); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 1rem; }
.btn-cart {
  background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--gold-light); padding: 0.5rem 1rem; border-radius: 50px;
  cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem;
  transition: var(--trans); font-family: inherit;
}
.btn-cart:hover { background: var(--gold); color: #000; }
.cart-badge {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 20px; height: 20px; font-size: 0.7rem;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.btn-lang {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: 0.35rem 0.75rem; border-radius: 50px;
  cursor: pointer; font-size: 0.8rem; transition: var(--trans); font-family: inherit;
}
.btn-lang:hover { border-color: var(--gold); color: var(--gold); }
.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #0C0700 0%, #1A0800 50%, #0C0300 100%);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 6rem 2rem 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(200,134,10,0.12) 0%, transparent 70%);
}
.hero-pattern {
  position: absolute; inset: 0; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23C8860A' fill-opacity='1'%3E%3Cpath d='M30 0l8.66 15H21.34L30 0zm0 60l-8.66-15h17.32L30 60zM0 30l15-8.66V38.66L0 30zm60 0l-15 8.66V21.34L60 30z'/%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; max-width: 800px; }
.hero-badge {
  display: inline-block; background: rgba(200,134,10,0.15);
  border: 1px solid rgba(200,134,10,0.4); color: var(--gold-light);
  padding: 0.4rem 1.2rem; border-radius: 50px; font-size: 0.85rem;
  margin-bottom: 1.5rem; letter-spacing: 2px; text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-family: 'Playfair Display', 'Cairo', serif;
  font-weight: 700; line-height: 1.15;
  background: linear-gradient(135deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.15rem; color: var(--text-muted);
  max-width: 560px; margin: 0 auto 2.5rem; line-height: 1.8;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ========== BUTTONS ========== */
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; font-weight: 700; padding: 0.85rem 2rem;
  border-radius: 50px; border: none; cursor: pointer;
  font-size: 1rem; font-family: inherit; transition: var(--trans);
  display: inline-flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(200,134,10,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(200,134,10,0.5);
  color: #000;
}
.btn-outline {
  background: transparent; color: var(--gold-light);
  border: 1.5px solid var(--gold); padding: 0.85rem 2rem;
  border-radius: 50px; cursor: pointer; font-size: 1rem;
  font-family: inherit; transition: var(--trans);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-outline:hover { background: rgba(200,134,10,0.1); transform: translateY(-2px); }
.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #e74c3c; }

/* ========== SECTION ========== */
.section { padding: 5rem 2rem; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag {
  display: inline-block; color: var(--gold); font-size: 0.8rem;
  letter-spacing: 3px; text-transform: uppercase; margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-family: 'Playfair Display', 'Cairo', serif; font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}
.section-subtitle { color: var(--text-muted); font-size: 1rem; max-width: 500px; margin: 0 auto; }
.container { max-width: 1200px; margin: 0 auto; }

/* ========== DISH CARDS ========== */
.dishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.dish-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--trans);
  position: relative;
}
.dish-card:hover {
  transform: translateY(-6px);
  border-color: rgba(200,134,10,0.4);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.dish-img-wrap { position: relative; height: 200px; overflow: hidden; }
.dish-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.dish-card:hover .dish-img-wrap img { transform: scale(1.08); }
.dish-badge {
  position: absolute; top: 10px;
  background: var(--accent); color: #fff;
  padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.7rem; font-weight: 700;
}
[dir="rtl"] .dish-badge { right: 10px; }
[dir="ltr"] .dish-badge { left: 10px; }
.dish-body { padding: 1.2rem; }
.dish-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.dish-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish-footer { display: flex; align-items: center; justify-content: space-between; }
.dish-price { font-size: 1.1rem; font-weight: 800; color: var(--gold-light); }
.dish-rating { font-size: 0.8rem; color: #f1c40f; }
.btn-add {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; border: none; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--trans); box-shadow: 0 2px 10px rgba(200,134,10,0.4);
}
.btn-add:hover { transform: scale(1.15); box-shadow: 0 4px 16px rgba(200,134,10,0.6); }

/* ========== CATEGORIES TABS ========== */
.categories-tabs { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2rem; }
.cat-tab {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); padding: 0.6rem 1.5rem; border-radius: 50px;
  cursor: pointer; font-size: 0.9rem; font-family: inherit;
  transition: var(--trans); text-decoration: none;
}
.cat-tab:hover, .cat-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #000; border-color: transparent; font-weight: 700;
}

/* ========== REVIEWS ========== */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.review-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: var(--trans);
}
.review-card:hover { border-color: rgba(200,134,10,0.3); transform: translateY(-3px); }
.review-stars { color: #f1c40f; font-size: 1rem; margin-bottom: 0.75rem; }
.review-text { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; margin-bottom: 1rem; }
.review-author { display: flex; align-items: center; gap: 0.75rem; }
.review-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 700; font-size: 1rem;
}
.review-name { font-weight: 600; font-size: 0.9rem; }
.review-date { color: var(--text-muted); font-size: 0.75rem; }

/* ========== CART SIDEBAR ========== */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 1999; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }
.cart-sidebar {
  position: fixed; top: 0; z-index: 2000;
  width: 400px; max-width: 90vw; height: 100vh;
  background: var(--bg-card); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
[dir="rtl"] .cart-sidebar { right: 0; transform: translateX(100%); border-left: none; border-right: 1px solid var(--border); }
[dir="ltr"] .cart-sidebar { right: 0; transform: translateX(100%); }
.cart-sidebar.open { transform: translateX(0); }
.cart-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--gold-light); }
.btn-close-cart { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-item { display: flex; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item-img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.9rem; font-weight: 600; }
.cart-item-price { font-size: 0.85rem; color: var(--gold-light); }
.qty-controls { display: flex; align-items: center; gap: 0.5rem; }
.btn-qty { background: var(--bg-card2); border: 1px solid var(--border); color: var(--text); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: var(--trans); }
.btn-qty:hover { background: var(--gold); color: #000; border-color: var(--gold); }
.cart-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 1rem; }
.cart-total-amount { color: var(--gold-light); font-size: 1.1rem; }

/* ========== ORDER TRACK ========== */
.track-timeline { display: flex; flex-direction: column; gap: 0; }
.track-step {
  display: flex; gap: 1.5rem; position: relative; padding-bottom: 2rem;
}
.track-step::before {
  content: ''; position: absolute;
  top: 40px; width: 2px; height: calc(100% - 10px);
  background: var(--border);
}
[dir="rtl"] .track-step::before { right: 19px; }
[dir="ltr"] .track-step::before { left: 19px; }
.track-step:last-child::before { display: none; }
.track-icon {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg-card2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0; transition: var(--trans); z-index: 1;
}
.track-step.done .track-icon { background: var(--gold); border-color: var(--gold); color: #000; }
.track-step.active .track-icon { background: var(--accent); border-color: var(--accent); color: #fff; animation: pulse 2s infinite; }
.track-info h4 { font-weight: 700; margin-bottom: 0.25rem; }
.track-info p { font-size: 0.85rem; color: var(--text-muted); }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(232,82,42,0.4)} 50%{box-shadow:0 0 0 10px rgba(232,82,42,0)} }

/* ========== ADMIN ========== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 260px; background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 1.5rem 0; position: fixed; top: 0; left: 0; right: auto; height: 100vh;
  display: flex; flex-direction: column; z-index: 100;
}
[dir="rtl"] .admin-sidebar { border-right: none; border-left: 1px solid var(--border); left: auto; right: 0; }
.admin-main { flex: 1; padding: 2rem; margin-left: 260px; }
[dir="rtl"] .admin-main { margin-left: 0; margin-right: 260px; }
.admin-brand { padding: 0 1.5rem 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.admin-nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.5rem; color: var(--text-muted);
  font-size: 0.9rem; font-weight: 600; transition: var(--trans);
  border-left: 3px solid transparent; margin-bottom: 0.25rem;
}
[dir="rtl"] .admin-nav-link { border-left: none; border-right: 3px solid transparent; }
.admin-nav-link:hover, .admin-nav-link.active {
  color: var(--gold-light); background: rgba(200,134,10,0.08);
  border-color: var(--gold);
}

/* ========== STAT CARDS ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.gold { background: rgba(200,134,10,0.15); color: var(--gold); }
.stat-icon.green { background: rgba(39,174,96,0.15); color: #27ae60; }
.stat-icon.blue  { background: rgba(52,152,219,0.15); color: #3498db; }
.stat-icon.red   { background: rgba(231,76,60,0.15);  color: #e74c3c; }
.stat-value { font-size: 1.6rem; font-weight: 900; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* ========== TABLES ========== */
.table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--bg-card2); padding: 1rem 1.25rem; text-align: start; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
tbody td { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(200,134,10,0.04); }

/* ========== STATUS BADGES ========== */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.75rem; font-weight: 700;
}
.status-pending    { background: rgba(241,196,15,0.15);  color: #f1c40f; }
.status-confirmed  { background: rgba(52,152,219,0.15);  color: #3498db; }
.status-preparing  { background: rgba(230,126,34,0.15);  color: #e67e22; }
.status-on_the_way { background: rgba(155,89,182,0.15);  color: #9b59b6; }
.status-delivered  { background: rgba(39,174,96,0.15);   color: #27ae60; }
.status-cancelled  { background: rgba(231,76,60,0.15);   color: #e74c3c; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; }
.form-control {
  width: 100%; background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text); padding: 0.75rem 1rem; border-radius: 10px;
  font-size: 0.95rem; font-family: inherit; transition: var(--trans);
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,134,10,0.15); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 120px; resize: vertical; }

/* Auth Pages Specific Fixes */
.auth-input-group { position: relative; margin-bottom: 1.5rem; display: flex; align-items: center; }
.auth-input-group .form-control {
    background: var(--bg-card2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    width: 100%;
}
.auth-input-group i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 1rem;
    z-index: 10;
    pointer-events: none;
}

/* RTL Icons Position */
[dir="rtl"] .auth-input-group i { 
    right: 1.25rem !important; 
    left: auto !important; 
}
/* LTR Icons Position */
[dir="ltr"] .auth-input-group i { 
    left: 1.25rem !important; 
    right: auto !important; 
}

/* Input Padding Logic */
[dir="rtl"] .auth-input-group .form-control {
    padding-right: 3rem !important;
    padding-left: 1.25rem !important;
}
[dir="ltr"] .auth-input-group .form-control {
    padding-left: 3rem !important;
    padding-right: 1.25rem !important;
}

/* Force LTR for emails/passwords but keep icon space */
input[type="email"], input[type="password"] {
    direction: ltr !important;
    text-align: left !important;
}

/* Special Case: Email/Password in RTL needs padding-right for icon */
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="password"] {
    padding-right: 3rem !important;
    padding-left: 1.25rem !important;
}

/* Auth Buttons */
.auth-btn-container { text-align: center; margin-top: 2rem; }
.auth-btn-container .btn-primary {
    min-width: 200px;
    justify-content: center;
}

/* ========== FLASH ========== */
.flash-message {
  position: fixed; top: 80px; z-index: 9999;
  padding: 0.9rem 1.5rem; border-radius: 10px;
  font-weight: 600; transition: opacity 0.4s;
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: var(--shadow);
}
[dir="rtl"] .flash-message { right: 1.5rem; }
[dir="ltr"] .flash-message { right: 1.5rem; }
.flash-success { background: rgba(39,174,96,0.9);  color: #fff; border: 1px solid #27ae60; }
.flash-error   { background: rgba(231,76,60,0.9);  color: #fff; border: 1px solid #e74c3c; }

/* ========== FOOTER ========== */
.footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 3rem 2rem 1.5rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-brand { font-size: 1.4rem; font-weight: 900; color: var(--gold-light); font-family: 'Playfair Display', serif; margin-bottom: 0.75rem; }
.footer-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }
.footer-title { font-weight: 700; color: var(--text); margin-bottom: 1rem; font-size: 0.95rem; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--text-muted); font-size: 0.88rem; transition: var(--trans); }
.footer-links a:hover { color: var(--gold-light); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.82rem; }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-title { font-size: 1.3rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: rgba(12,7,0,0.98); padding: 1rem 2rem 2rem; border-bottom: 1px solid var(--border); }
  .dishes-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .admin-sidebar { transform: translateX(-100%); }
  [dir="rtl"] .admin-sidebar { transform: translateX(100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin: 0 !important; padding: 1rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
}
