/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
  --primary: #ffb36b;
  --primary-hover: #ff9d41;
  --accent: #ff6b6b;
  --text: #444;
  --text-dark: #333;
  --text-light: #666;
  --bg: #faf7f2;
  --white: #fff;
  --border: #f0f0f0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  max-width: 1100px;
  margin: auto;
  padding: 24px;
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  color: var(--text-dark);
  margin: 0 0 1rem 0;
}

/* ===========================
   LAYOUT & CONTAINERS
   =========================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ===========================
   TYPOGRAPHY & LINKS
   =========================== */
.logo {
  font-weight: 700;
  font-size: 22px;
  text-decoration: none;
  color: var(--text-dark);
}

.nav-link {
  margin-left: 18px;
  text-decoration: none;
  font-weight: 600;
  color: var(--text-light);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text-dark);
}

.nav-user {
  margin-right: 12px;
  font-weight: 600;
  color: var(--text);
}

/* ===========================
   BUTTONS & INTERACTIVE
   =========================== */
.btn, button {
  background: var(--primary);
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: bold;
  transition: all 0.25s ease;
  text-decoration: none;
  display: inline-block;
  color: inherit;
}

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

.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
}

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

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

/* ===========================
   CARDS & GRIDS
   =========================== */
.menu-grid, .track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.menu-card, .music-track-card, .order-card,
.order-summary, .order-section, .order-total-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.menu-card:hover, .music-track-card:hover, .order-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ===========================
   SPECIFIC COMPONENTS
   =========================== */
/* Cart Badge */
.cart-badge, .item-qty-badge {
  background: var(--accent);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.cart-badge {
  margin-left: 4px;
  display: inline-flex;
}

.item-qty-badge {
  position: absolute;
  top: 8px;
  right: 12px;
}

/* Menu Images */
.menu-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 12px;
}

.music-cover-img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  background: #f7f4ef;
  margin: 0 auto 12px;
  display: block;
  transition: transform 0.2s ease;
}

.music-cover-img:hover {
  transform: scale(1.05);
}

/* Quantity Controls */
.qty-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.qty-btn {
  padding: 6px 12px;
  font-size: 18px;
  min-width: 36px;
}

.qty-display {
  font-weight: bold;
  min-width: 28px;
  text-align: center;
}

/* Status Badges */
.status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  border: 1px solid;
}

.status.pending {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.status.confirmed {
  background: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

.status.completed {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.status.cancelled {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* ===========================
   ORDER SPECIFIC STYLES
   =========================== */
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.order-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-item strong {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
}

.order-id {
  font-family: monospace;
  color: var(--text-dark);
  font-weight: 500;
}

/* Order Items */
.order-items {
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

.items-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px 20px;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
}

.items-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.order-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  align-items: center;
}

.order-item:last-child {
  border-bottom: none;
}

.item-col {
  padding: 4px 0;
}

.item-name-header, .item-quantity-header,
.item-price-header, .item-total-header {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.item-name {
  font-weight: 500;
  color: var(--text-dark);
}

.item-quantity, .item-price {
  text-align: center;
  color: var(--text-light);
}

.item-total {
  text-align: center;
  font-weight: 600;
  color: var(--text-dark);
}

/* Simple Order Items (for list page) */
.order-items-simple ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.order-item-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f8f8f8;
}

.order-item-simple:last-child {
  border-bottom: none;
}

.item-name-simple {
  flex: 1;
  font-weight: 500;
  color: var(--text-dark);
}

.item-quantity-simple {
  margin: 0 16px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.item-price-simple {
  font-weight: 500;
  color: var(--text-dark);
  min-width: 80px;
  text-align: right;
}

/* Order Actions & Footer */
.order-footer {
  margin-top: 20px;
  text-align: right;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.order-actions {
  text-align: center;
  margin-top: 32px;
}

.total-display h3 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.5rem;
}

/* ===========================
   MODALS & OVERLAYS
   =========================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  width: 320px;
  text-align: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-content input {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
}

/* ===========================
   CHAT WIDGET
   =========================== */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  transition: all 0.25s ease;
}

.chat-toggle:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.chat-box {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 340px;
  height: 460px;
  background: #fffdf9;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  border: 1px solid #f3e8dd;
}

.chat-header {
  background: var(--primary);
  padding: 12px 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #3b2d1f;
  font-size: 15px;
}

.close-chat {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  transition: background 0.2s;
}

.close-chat:hover {
  background: rgba(0, 0, 0, 0.08);
}

.chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.4;
  background: #fffaf4;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 6px;
}

.msg-user {
  text-align: right;
  margin: 6px 0;
}

.msg-user span {
  background: #ffe2b5;
  padding: 8px 12px;
  border-radius: 14px 14px 0 14px;
  display: inline-block;
  max-width: 80%;
}

.msg-bot {
  text-align: left;
  margin: 6px 0;
}

.msg-bot span {
  background: #eee;
  padding: 8px 12px;
  border-radius: 14px 14px 14px 0;
  display: inline-block;
  max-width: 80%;
}

.chat-input {
  display: flex;
  border-top: 1px solid #f3e8dd;
  background: #fff9f3;
  padding: 8px;
  gap: 8px;
}

.chat-input input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
}

.chat-input input:focus {
  border-color: var(--primary);
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 40px 0;
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.price, .total-amount {
  font-weight: bold;
  color: var(--text-dark);
}

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

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .container {
    padding: 0 16px;
  }

  .nav-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .nav-link {
    margin: 0 8px;
  }

  .menu-grid, .track-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Order List Responsive */
  .order-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .order-meta {
    align-items: flex-start;
    gap: 6px;
  }

  .order-item-simple {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .item-quantity-simple, .item-price-simple {
    margin-left: 0;
    text-align: left;
  }

  /* Order Detail Responsive */
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .items-header {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }

  .order-item {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
    padding: 12px 16px;
  }

  .item-quantity, .item-price, .item-total {
    text-align: center;
  }

  .menu-card, .music-track-card, .order-card,
  .order-summary, .order-section, .order-total-section {
    padding: 16px;
  }

  .chat-box {
    width: calc(100vw - 32px);
    right: 16px;
  }
}

@media (max-width: 480px) {
  .order-header h3 {
    font-size: 1.1rem;
  }

  .order-section h2 {
    font-size: 1.2rem;
  }

  .total-display h3 {
    font-size: 1.3rem;
  }

  .music-cover-img {
    width: 120px;
    height: 120px;
  }
}

/* Reset Password Styles */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
}

.auth-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #ffb36b;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #ffb36b;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #ffa04b;
}

.error-message {
    background: #ffe6e6;
    color: #d63031;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #ffcccc;
}

.success-message {
    background: #e6ffe6;
    color: #27ae60;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #ccffcc;
}

.success-message a {
    color: #27ae60;
    text-decoration: underline;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #666;
    text-decoration: none;
}

.back-link a:hover {
    color: #333;
    text-decoration: underline;
}