/* ==========================================================================
   Cuccu Café - Design Tokens & Common Styles
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&display=swap');

:root {
  /* Brand Palette: Warm luxury coffee & caramel */
  --color-primary: #8B4513;
  --color-primary-dark: #5c2d0c;
  --color-primary-light: #c8834a;
  --color-caramel: #D97706;
  --color-amber: #F59E0B;
  --color-amber-light: #FEF3C7;
  
  /* Dark espresso background tones */
  --bg-deep: #160e0a;
  --bg-card: #231710;
  --bg-card-hover: #2f1f16;
  --bg-glass: rgba(35, 23, 16, 0.85);
  
  /* Light theme variants for customer / clean views */
  --bg-body-light: #FBF8F5;
  --bg-card-light: #FFFFFF;
  --bg-card-subtle: #F5ECE5;
  --border-light: #E7DDD4;
  
  /* Status Colors */
  --status-pending: #F59E0B;
  --status-pending-bg: rgba(245, 158, 11, 0.15);
  --status-preparing: #3B82F6;
  --status-preparing-bg: rgba(59, 130, 246, 0.15);
  --status-served: #10B981;
  --status-served-bg: rgba(16, 185, 129, 0.15);
  --status-paid: #059669;
  --status-paid-bg: rgba(5, 150, 105, 0.15);
  --status-cancelled: #EF4444;
  --status-cancelled-bg: rgba(239, 68, 68, 0.15);

  /* Unified Single Font Family */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-title: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Shadows & Radius */
  --shadow-sm: 0 2px 8px rgba(35, 23, 16, 0.06);
  --shadow-md: 0 4px 20px rgba(35, 23, 16, 0.12);
  --shadow-lg: 0 10px 30px rgba(35, 23, 16, 0.2);
  --shadow-glow: 0 0 25px rgba(217, 119, 6, 0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s ease;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body-light);
  color: #2B170B;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
button, input, select, textarea,
.brand-name, .brand-text h1, .nav-link, .modal-title {
  font-family: var(--font-main) !important;
}

/* ==========================================================================
   Header & Navigation Bar
   ========================================================================== */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.app-nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #2B170B;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #8B4513, #D97706);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 10px rgba(139, 69, 19, 0.25);
}

.brand-text h1 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: #2B170B;
}

.brand-text span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-caramel);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #634d3d;
  text-decoration: none;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background-color: var(--bg-card-subtle);
  color: var(--color-primary-dark);
}

.nav-link.active {
  background: linear-gradient(135deg, #8B4513, #A75D27);
  color: white;
  box-shadow: 0 3px 10px rgba(139, 69, 19, 0.25);
}

.nav-link .badge-counter {
  background-color: #EF4444;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  line-height: 1;
  min-width: 18px;
  text-align: center;
}

/* ==========================================================================
   Badges, Status Tags & Buttons
   ========================================================================== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-status.pending {
  background-color: var(--status-pending-bg);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status.preparing {
  background-color: var(--status-preparing-bg);
  color: #1D4ED8;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-status.served {
  background-color: var(--status-served-bg);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.paid {
  background-color: var(--status-paid-bg);
  color: #065F46;
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.badge-status.cancelled {
  background-color: var(--status-cancelled-bg);
  color: #B91C1C;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  outline: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #8B4513, #D97706);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #74370c, #b45309);
  box-shadow: 0 6px 16px rgba(139, 69, 19, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10B981);
  color: white;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-success:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
  background: var(--bg-card-subtle);
  color: #4A3324;
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: #ede0d4;
  color: #2B170B;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-light);
  color: #634d3d;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(22, 14, 10, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: all var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #FFFFFF;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: #2B170B;
}

.btn-close,
.modal-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: #F5ECE5;
  border: 1px solid #E8DDD4;
  color: #7D6B5E;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(43, 23, 11, 0.05);
  outline: none;
}

.btn-close:hover,
.modal-close:hover {
  background: #EFE4DC;
  color: #2B170B;
  border-color: #DBCBBF;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 3px 10px rgba(43, 23, 11, 0.12);
}

.btn-close:active,
.modal-close:active {
  transform: rotate(90deg) scale(0.94);
  background: #E5D7CE;
}

.modal-body {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  background: #FCFAF8;
  flex-shrink: 0;
}

/* Note input & textareas */
.note-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #FDFBF9;
  border: 1.5px solid #E5D9CE;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #2B170B;
  line-height: 1.45;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.note-input::placeholder {
  color: #A89587;
  font-size: 0.84rem;
}

.note-input:hover {
  border-color: #D4C3B5;
  background: #FFFFFF;
}

.note-input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: #8B4513;
  box-shadow: 0 0 0 3.5px rgba(139, 69, 19, 0.12);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  background: #231710;
  color: #FFFFFF;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.88rem;
  border-left: 4px solid var(--color-caramel);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  border-left-color: #10B981;
}

.toast.toast-error {
  border-left-color: #EF4444;
}

.toast.toast-warning {
  border-left-color: #F59E0B;
}

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

/* Pulse animation for new orders */
@keyframes orderPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.pulse-border {
  animation: orderPulse 2s infinite;
}

/* Utility currency formatter helper */
.price-tag {
  font-weight: 700;
  color: var(--color-primary);
}

/* Responsive navigation */
@media (max-width: 768px) {
  .app-nav-container {
    padding: 0.6rem 0.85rem;
  }
  .nav-links {
    gap: 0.2rem;
  }
  .nav-link {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }
  .nav-link span.link-text {
    display: none;
  }
}
