@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Playfair+Display:wght@700&display=swap');

:root {
  --primary-gold: #D4AF37;
  --primary-dark: #1a1a2e;
  --secondary-dark: #16213e;
  --accent-red: #e94560;
  --success: #2a9d8f;
  --warning: #f4a261;
  --text-light: #f1f1f1;
  --text-muted: #a8a8a8;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #FFD700 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: var(--text-light);
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(103, 126, 234, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Header */
.header,
.admin-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 25px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.logo,
.admin-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 2px;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 15px;
  border: 1px solid var(--card-border);
}

.tab-btn {
  flex: 1;
  padding: 15px 25px;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.tab-btn:hover {
  border-color: var(--primary-gold);
  background: rgba(212, 175, 55, 0.1);
}

.tab-btn.active {
  background: var(--gradient-gold);
  color: var(--primary-dark);
  border-color: var(--primary-gold);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Portion Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: var(--secondary-dark);
  padding: 40px;
  border-radius: 25px;
  border: 2px solid var(--primary-gold);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 90%;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--primary-gold);
  text-align: center;
}

.modal-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 1.1rem;
}

.portion-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.portion-btn {
  padding: 20px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 15px;
  color: var(--text-light);
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.portion-btn:hover {
  border-color: var(--primary-gold);
  background: rgba(212, 175, 55, 0.1);
  transform: scale(1.05);
}

.portion-btn.selected {
  background: var(--gradient-gold);
  color: var(--primary-dark);
  border-color: var(--primary-gold);
  box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

.modal-actions {
  display: flex;
  gap: 15px;
}

.modal-actions .btn {
  flex: 1;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--text-light);
}

/* Button sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Button color variants */
.btn-success {
  background: linear-gradient(135deg, #2a9d8f 0%, #38ef7d 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #268c7f 0%, #2dd46b 100%);
}

.btn-success:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #d42d40 0%, #e04d37 100%);
}

.btn-warning {
  background: linear-gradient(135deg, #f4a261 0%, #e9c46a 100%);
  color: var(--primary-dark);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #e89451 0%, #dab65a 100%);
}

.btn-table-pay {
  width: 100%;
  margin-top: 10px;
  font-weight: 600;
}

/* Statistics Dashboard */
.statistics-container {
  animation: fadeIn 0.5s ease;
}

.period-selector {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  justify-content: center;
}

.period-btn {
  padding: 12px 30px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.period-btn:hover {
  border-color: var(--primary-gold);
  background: rgba(212, 175, 55, 0.1);
}

.period-btn.active {
  background: var(--gradient-gold);
  color: var(--primary-dark);
  border-color: var(--primary-gold);
  font-weight: 600;
}

.stats-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 15px;
  border: 1px solid var(--card-border);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-gold);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.stat-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.stats-table-section,
.stats-status-section {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 15px;
  border: 1px solid var(--card-border);
  margin-bottom: 30px;
}

.stats-table-section h3,
.stats-status-section h3 {
  color: var(--primary-gold);
  margin-bottom: 20px;
  font-size: 1.5rem;
}

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

.stats-table thead tr {
  border-bottom: 2px solid var(--card-border);
}

.stats-table th {
  padding: 15px;
  text-align: left;
  color: var(--primary-gold);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.stats-table td {
  padding: 15px;
  color: var(--text-light);
  border-bottom: 1px solid var(--card-border);
}

.stats-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}

.status-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.status-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.status-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.status-count {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-gold);
}

/* Controls */
.admin-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.control-group {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  border: 1px solid var(--card-border);
}

.control-group label {
  display: block;
  margin-bottom: 10px;
  color: var(--primary-gold);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.control-group select,
.control-group input {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-light);
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}

.control-group select:focus,
.control-group input:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.control-group select option {
  background: var(--secondary-dark);
  color: var(--text-light);
}

/* Buttons */
.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: var(--gradient-gold);
  color: var(--primary-dark);
  box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(56, 239, 125, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(235, 51, 73, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #f4a261 0%, #e76f51 100%);
  color: white;
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(244, 162, 97, 0.3);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-table-pay {
  width: 100%;
  margin-top: 10px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Menu */
.section-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--primary-gold);
  font-weight: 600;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.menu-item {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item:hover {
  transform: translateY(-3px);
  border-color: var(--primary-gold);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2);
}

.item-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-light);
}

.item-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-gold);
}

/* Orders Section */
.orders-section {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  margin-bottom: 30px;
}

.orders-grid {
  display: grid;
  gap: 20px;
}

.order-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
}

.order-card:hover {
  transform: translateX(5px);
  border-color: var(--primary-gold);
}

/* Order status styles */
.order-status-pending {
  border-left: 4px solid #ffc107;
}

.order-status-preparing {
  border-left: 4px solid #03a9f4;
}

.order-status-ready {
  background: rgba(56, 239, 125, 0.2);
  border-left: 5px solid #38ef7d;
  box-shadow: 0 0 20px rgba(56, 239, 125, 0.3);
}

.order-status-delivered {
  background: rgba(42, 157, 143, 0.1);
  border-left: 4px solid #2a9d8f;
}

.order-status-cancelled {
  opacity: 0.6;
  background: rgba(231, 111, 81, 0.1);
  border-left: 4px solid #e76f51;
}

.order-status-paid {
  opacity: 0.7;
  background: rgba(38, 70, 83, 0.2);
  border-left: 4px solid #264653;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--card-border);
}

.table-badge {
  background: var(--gradient-gold);
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
}

.status-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.order-items {
  margin-bottom: 15px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  color: var(--text-light);
}

.item-quantity {
  color: var(--primary-gold);
  font-weight: 600;
  margin-right: 8px;
}

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 2px solid var(--card-border);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.total-label {
  color: var(--text-muted);
}

.total-amount {
  color: var(--primary-gold);
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    max-width: 100%;
  }

  .admin-header {
    padding: 15px;
  }

  .admin-title {
    font-size: 1.5rem;
  }

  .tab-navigation {
    flex-direction: column;
    gap: 8px;
  }

  .tab-btn {
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  .stats-summary-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .stat-card {
    padding: 20px;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .portion-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .portion-btn {
    padding: 18px;
    font-size: 1.3rem;
  }

  .modal-content {
    padding: 25px;
    width: 95%;
  }

  .modal-content h3 {
    font-size: 1.4rem;
  }

  .menu-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .menu-item {
    padding: 15px;
  }

  .order-actions {
    flex-direction: column;
  }

  .order-actions .btn {
    width: 100%;
    padding: 12px;
  }

  .admin-controls {
    grid-template-columns: 1fr;
  }

  .orders-section {
    padding: 15px;
  }

  .order-card {
    padding: 15px;
  }

  .stats-table {
    font-size: 0.9rem;
  }

  .stats-table th,
  .stats-table td {
    padding: 10px 8px;
  }

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

  /* Make buttons more touch-friendly */
  .btn {
    min-height: 44px;
    padding: 12px 20px;
  }

  .control-group select,
  .control-group input {
    min-height: 44px;
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  /* Improve table scrolling on mobile */
  .stats-table-section {
    overflow-x: auto;
  }
}

/* Tablet specific (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .stats-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portion-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Small mobile (max 480px) */
@media (max-width: 480px) {
  .table-badge {
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  .order-item {
    font-size: 0.9rem;
  }

  .order-total {
    font-size: 1.1rem;
  }
}

/* Prevent text selection on buttons (better UX on touch) */
.btn,
.tab-btn,
.portion-btn,
.menu-item,
.period-btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Improve touch feedback */
.btn:active,
.tab-btn:active,
.portion-btn:active,
.menu-item:active {
  transform: scale(0.98);
}


/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-item,
.order-card,
.stat-card {
  animation: fadeInUp 0.5s ease forwards;
}