/* ================================================
   style.css  –  Food Ordering App Styles
   ================================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #ff6b35;
  --primary-dark: #e55a2b;
  --secondary: #004e89;
  --accent: #ffc857;
  --bg: #f8f9fa;
  --white: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #dee2e6;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Navbar ---------- */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0 2rem;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar .logo span {
  font-size: 1.8rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links .cart-link {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  opacity: 0.9;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 4rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* ---------- Category Filters ---------- */
.category-filters {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 2rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.category-btn {
  padding: 0.5rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--white);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.category-btn:hover,
.category-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
}

/* ---------- Food Grid ---------- */
.section-title {
  text-align: center;
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
}

.food-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.food-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.food-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.food-card-body {
  padding: 1rem;
}

.food-card-body h3 {
  margin-bottom: 0.3rem;
}

.food-card-body .description {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.food-card-body .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.food-card-body .price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* ---------- Auth Pages ---------- */
.auth-container {
  max-width: 420px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.auth-footer {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-light);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

/* ---------- Cart Page ---------- */
.cart-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.cart-container h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  margin-bottom: 0.2rem;
}

.cart-item-info .price {
  color: var(--primary);
  font-weight: 600;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-controls button {
  width: 30px;
  height: 30px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qty-controls button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cart-summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
}

.cart-summary .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cart-summary .total {
  font-size: 1.3rem;
  font-weight: 700;
  border-top: 2px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.empty-cart {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}

.empty-cart .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ---------- Toast / Notification ---------- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--white);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.info {
  border-left-color: var(--secondary);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ---------- Checkout Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.modal .close-btn {
  float: right;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

/* ---------- Order Confirmation ---------- */
.order-confirmation {
  text-align: center;
  padding: 2rem;
}

.order-confirmation .check-icon {
  font-size: 4rem;
  color: var(--success);
  margin-bottom: 1rem;
}

.order-confirmation h2 {
  color: var(--success);
}

.order-details-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1rem 0;
  text-align: left;
}

/* ================================================
   Admin Panel Styles
   ================================================ */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 250px;
  background: var(--secondary);
  color: var(--white);
  padding: 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar h2 {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

.admin-main {
  flex: 1;
  margin-left: 250px;
  padding: 2rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-size: 1.5rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Admin Table */
.admin-table-wrapper {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--bg);
  font-weight: 600;
  white-space: nowrap;
}

.admin-table tr:hover {
  background: #f1f3f5;
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-pending {
  background: #fff3cd;
  color: #856404;
}

.badge-preparing {
  background: #cce5ff;
  color: #004085;
}

.badge-delivered {
  background: #d4edda;
  color: #155724;
}

.badge-cancelled {
  background: #f8d7da;
  color: #721c24;
}

/* Notification Bell */
.notification-bell {
  position: relative;
  cursor: pointer;
  font-size: 1.5rem;
}

.notification-bell .count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--danger);
  color: var(--white);
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Notification Dropdown */
.notification-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 350px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}

.notification-dropdown.show {
  display: block;
}

.notification-dropdown .note-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.notification-dropdown .note-item:hover {
  background: var(--bg);
}

.notification-dropdown .note-item.unread {
  background: #fff8e1;
}

.notification-dropdown .note-item .note-text {
  font-size: 0.9rem;
}

.notification-dropdown .note-item .note-time {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

/* Admin Section Panels */
.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

/* Order Detail Panel */
.order-detail-panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.order-items-list {
  list-style: none;
}

.order-items-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .navbar-inner {
    padding: 0 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .food-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .cart-item {
    flex-direction: column;
    text-align: center;
  }

  .admin-sidebar {
    width: 200px;
  }

  .admin-main {
    margin-left: 200px;
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
  }

  .admin-sidebar h2 {
    width: 100%;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .admin-sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .admin-main {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  margin-top: auto;
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 1rem;
}
