:root {
  --primary-color: #f5a623; /* Gold */
  --secondary-color: #3a2e26; /* Dark Brown */
  --background-color: #fdfaf6; /* Creamy White */
  --text-color: #333;
  --card-bg: #fff;
  --border-color: #eee;
  --success-color: #28a745;
  --error-color: #dc3545;
  --pending-color: #ffc107;
}

.dark-mode {
  --primary-color: #f5a623;
  --secondary-color: #fdfaf6;
  --background-color: #1a1a1a;
  --text-color: #eee;
  --card-bg: #2c2c2c;
  --border-color: #444;
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Tajawal', sans-serif;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
  overscroll-behavior-y: contain;
}

#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 70px; /* Space for nav bar */
}
main {
  flex-grow: 1;
  padding: 1rem;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
.btn:hover {
    transform: translateY(-2px);
}
.btn:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    font-size: 1.5rem;
    font-weight: 500;
}
.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    margin-right: 10px;
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: var(--background-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Navigation --- */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background-color: var(--card-bg);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  border-top: 1px solid var(--border-color);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.8rem;
    transition: color 0.2s, background-color 0.2s;
}
.nav-item.active {
    color: var(--primary-color);
    background-color: rgba(245, 166, 35, 0.1);
}
.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

/* --- Header --- */
.app-header {
  padding: 1rem;
  background: var(--secondary-color);
  color: white;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-header img {
  width: 60px;
  height: 60px;
  margin-left: 1rem;
}
.header-text h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}
.header-text p {
    margin: 0;
    font-size: 1rem;
    color: #fff;
}

/* --- Menu --- */
.menu-item-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.menu-item-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.menu-item-info {
    flex-grow: 1;
}
.menu-item-info h3 {
    margin: 0 0 0.25rem;
}
.menu-item-info p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #777;
}
.menu-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.menu-categories {
    display: flex;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    gap: 0.5rem;
    scrollbar-width: none; /* Firefox */
}
.menu-categories::-webkit-scrollbar { display: none; }
.category-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
}
.category-btn.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    font-weight: 700;
    border-color: var(--primary-color);
}

/* --- Cart --- */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.cart-item-details {
    flex-grow: 1;
}
.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.quantity-control button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
}
.cart-summary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}
.cart-summary h3 {
    margin-top: 0;
}
.cart-total {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}
.place-order-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    font-size: 1.2rem;
}

/* --- Forms & Modals --- */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: 'Tajawal', sans-serif;
}
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-content {
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}
.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* --- Admin/POS --- */
.dashboard-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.order-card {
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.order-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}
.status-pending { background-color: var(--pending-color); color: #333; }
.status-paid { background-color: var(--success-color); color: #fff; }
.status-rejected { background-color: var(--error-color); color: #fff; }
.status-preparing, .status-ready, .status-delivered, .status-completed {
    background-color: #17a2b8; color: #fff;
}
.order-details-toggle {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}
.order-details img {
    max-width: 150px;
    margin-top: 10px;
    cursor: pointer;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.dark-mode-toggle {
    cursor: pointer;
}