/* Enhanced Modal Styles for K-Food Delight */
:root {
  --color-primary: #ff7f50;
  --color-primary-dark: #ff6b6b;
  --color-accent: #ffb75e;
  --color-text: #2d3436;
  --color-text-light: #636e72;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(255, 127, 80, 0.15);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Common Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background-color: #fff;
  margin: 20px auto;
  padding: 0;
  width: 90%;
  max-width: 600px;
  max-height: calc(100vh - 40px);
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background: linear-gradient(
    135deg,
    var(--color-primary-dark),
    var(--color-accent)
  );
  color: white;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h2 i {
  font-size: 1.3rem;
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Cart Specific Styles */
.cart-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 25px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) #f0f0f0;
}

.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
  background-color: var(--color-primary);
  border-radius: 3px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 1px solid #f0f0f0;
  border-radius: 15px;
  margin-bottom: 15px;
  transition: var(--transition-smooth);
}

.cart-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.cart-item-image {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  margin-right: 20px;
}

.cart-item-details h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--color-text);
}

.cart-item-price {
  color: var(--color-primary-dark);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-btn {
  background: #f8f9fa;
  border: 2px solid #eee;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--color-text);
}

.quantity-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.quantity {
  font-weight: 600;
  color: var(--color-text);
  min-width: 30px;
  text-align: center;
}

.cart-summary {
  padding: 20px 25px;
  background: linear-gradient(to bottom, #fff, #f8f9fa);
  border-top: 1px solid #f0f0f0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.summary-row.total {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px dashed #f0f0f0;
}

.checkout-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(
    135deg,
    var(--color-primary-dark),
    var(--color-accent)
  );
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.checkout-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Orders Modal Specific Styles */
.orders-list {
  padding: 20px 25px;
  max-height: 500px;
  overflow-y: auto;
}

.order-item {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 15px;
  transition: var(--transition-smooth);
}

.order-item:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px dashed #f0f0f0;
}

.order-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.order-date {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-top: 5px;
}

.order-amount {
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 1.2rem;
}

.status-badge {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: capitalize;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge i {
  font-size: 0.8rem;
}

.status-pending {
  background-color: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

.status-preparing {
  background-color: #e3f2fd;
  color: #1565c0;
  border: 1px solid #bbdefb;
}

.status-delivering {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.status-completed {
  background-color: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #e1bee7;
}

/* Animations */
@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: 10px auto;
    max-height: calc(100vh - 20px);
  }

  .modal-header {
    padding: 15px 20px;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .cart-items {
    padding: 15px 20px;
  }

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

  .cart-item-image {
    margin: 0 0 15px 0;
  }

  .quantity-controls {
    justify-content: center;
  }

  .cart-summary {
    padding: 15px 20px;
    max-height: 45vh;
  }

  .order-header {
    flex-direction: column;
    gap: 10px;
  }

  .order-amount {
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }

  .cart-summary {
    max-height: 40vh;
  }
}
