:root {
  --primary: #DC1C1C;
  --primary-dark: #B01515;
  --navy: #1A2342;
  --pink-light: #F5E0E0;
  --pink-lighter: #FCF0F0;
  --green: #22c55e;
  --green-light: #dcfce7;
  --ink: #1f2937;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --bg: linear-gradient(135deg, #FFFFFF 0%, #FCF0F0 100%);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

header {
  background: #FFFFFF;
  color: var(--ink);
  padding: 1rem 2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: var(--shadow-lg);
  border-bottom: 3px solid var(--primary);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.herfy-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.call-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-left: auto;
}

.btn-icon {
  margin-right: 0.4rem;
  vertical-align: middle;
}

.call-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.call-btn:hover {
  transform: translateY(-2px);
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(220, 28, 28, 0.4);
}

.call-btn.active {
  background: var(--primary-dark);
  animation: pulse-red 1.5s infinite;
}

.call-btn.connecting {
  background: var(--primary);
  pointer-events: none;
  opacity: 0.8;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 28, 28, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(220, 28, 28, 0); }
}

.mute-btn,
.end-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  white-space: nowrap;
  gap: 0.4rem;
}

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

.mute-btn.muted {
  background: var(--primary);
  opacity: 0.7;
}

.mute-btn.muted:hover {
  background: var(--primary-dark);
  opacity: 0.9;
}

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

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

.hidden {
  display: none !important;
}

.status-pill {
  background: var(--pink-light);
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.dot {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.status-pill.active .dot {
  background: var(--green);
}

.status-pill.pushed .dot {
  background: var(--green);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

.cart-panel {
  background: #fff;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed var(--gray-200);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cart-header h2 {
  font-size: 1.25rem;
}

.order-id {
  background: var(--pink-light);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.875rem;
  border: 2px solid var(--primary);
}

.cart-items {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}

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

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

.empty-cart p {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hint {
  font-size: 0.875rem;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  margin: 0.5rem 0;
  background: var(--pink-lighter);
  border-radius: 16px;
  border: 2px solid var(--pink-light);
  animation: slideIn 0.3s ease-out;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cart-item .item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.cart-item .qty {
  background: var(--primary);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.cart-item .name {
  font-weight: 600;
  word-break: break-word;
}

.cart-item .price {
  font-weight: 700;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.cart-item .confidence {
  font-size: 0.75rem;
  color: var(--gray-600);
  background: var(--green-light);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.cart-item .confidence.low {
  background: #fef3c7;
  color: #b45309;
}

.item-modifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: 2.25rem;
  margin-top: 0.25rem;
}

.item-modifiers .modifier {
  font-size: 0.75rem;
  background: var(--pink-light);
  color: var(--primary-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.cart-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px dashed var(--gray-200);
}

.subtotal-row,
.tax-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.subtotal-row span:first-child,
.tax-row span:first-child {
  font-weight: 500;
  color: var(--gray-600);
  font-size: 0.95rem;
}

.subtotal-amount,
.tax-amount {
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--pink-lighter);
  border-radius: 16px;
  border: 2px solid var(--primary);
  margin-top: 0.5rem;
}

.total-row span:first-child {
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.item-count {
  text-align: center;
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

button {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear {
  background: var(--gray-100);
  color: var(--gray-600);
}

.btn-clear:hover {
  background: var(--gray-200);
}

.btn-confirm {
  background: var(--primary);
  color: #fff;
}

.btn-confirm:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--primary-dark);
  box-shadow: var(--shadow-lg);
}

.btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.activity-panel {
  background: #fff;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

.activity-header h3 {
  font-size: 1rem;
  margin: 0;
}

.powered-by {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.powered-text {
  color: var(--gray-600);
  font-weight: 500;
}

.heykoala-text {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.activity-list {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}

.activity-time {
  color: var(--gray-400);
  font-size: 0.75rem;
  display: block;
  margin-bottom: 0.25rem;
}

.activity-msg {
  color: var(--ink);
  word-break: break-word;
}

.activity-item.success .activity-msg {
  color: var(--green);
}

.activity-item.error .activity-msg {
  color: var(--primary);
}

@media (max-width: 768px) {
  header {
    padding: 1rem;
    gap: 1rem;
  }

  .brand {
    width: 100%;
    text-align: center;
  }

  .brand h1 {
    font-size: 1.25rem;
  }

  .call-btn {
    padding: 0.5rem 0.625rem;
    min-width: 40px;
    min-height: 40px;
  }

  .status-pill {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }

  .container {
    grid-template-columns: 1fr;
    margin: 1rem auto;
    gap: 1rem;
  }

  .cart-panel {
    padding: 1rem;
    border-radius: 16px;
  }

  .cart-header h2 {
    font-size: 1.1rem;
  }

  .cart-items {
    min-height: 150px;
    max-height: 300px;
  }

  .empty-cart {
    padding: 2rem 1rem;
  }

  .empty-icon {
    font-size: 2.5rem;
  }

  .cart-item {
    padding: 0.75rem;
  }

  .cart-item .item-info {
    gap: 0.5rem;
  }

  .total-amount {
    font-size: 1.25rem;
  }

  .actions {
    flex-direction: column;
  }

  button {
    padding: 0.875rem;
  }

  .activity-panel {
    padding: 1rem;
    border-radius: 16px;
  }

  .activity-list {
    max-height: 250px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .brand h1 {
    font-size: 1.1rem;
  }

  .call-btn {
    padding: 0.4rem 0.5rem;
    min-width: 36px;
    min-height: 36px;
  }

  .call-icon {
    font-size: 1rem;
  }

  .status-pill {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }

  .dot {
    width: 8px;
    height: 8px;
  }

  .container {
    padding: 0 0.5rem;
    margin: 0.5rem auto;
    gap: 0.75rem;
  }

  .cart-panel,
  .activity-panel {
    padding: 0.75rem;
    border-radius: 12px;
  }

  .cart-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .cart-header h2 {
    font-size: 1rem;
  }

  .order-id {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .cart-items {
    min-height: 120px;
    max-height: 250px;
  }

  .empty-cart {
    padding: 1.5rem 0.75rem;
  }

  .empty-icon {
    font-size: 2rem;
  }

  .empty-cart p {
    font-size: 0.9rem;
  }

  .hint {
    font-size: 0.75rem;
  }

  .cart-item {
    padding: 0.625rem;
    border-radius: 12px;
  }

  .cart-item .qty {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .cart-item .name {
    font-size: 0.9rem;
  }

  .cart-item .price {
    font-size: 0.9rem;
  }

  .cart-item .confidence {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }

  .cart-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }

  .total-row {
    padding: 0.75rem;
    border-radius: 12px;
  }

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

  .item-count {
    font-size: 0.75rem;
  }

  button {
    padding: 0.75rem;
    font-size: 0.8rem;
    border-radius: 12px;
  }

  .activity-panel h3 {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .activity-list {
    max-height: 200px;
  }

  .activity-item {
    padding: 0.5rem 0;
    font-size: 0.8rem;
  }

  .activity-time {
    font-size: 0.65rem;
  }
}

@media (max-width: 360px) {
  header {
    padding: 0.5rem;
  }

  .brand h1 {
    font-size: 1rem;
  }

  .call-btn {
    padding: 0.35rem 0.4rem;
    min-width: 32px;
    min-height: 32px;
  }

  .status-pill {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
  }

  .container {
    padding: 0 0.375rem;
  }

  .cart-panel,
  .activity-panel {
    padding: 0.625rem;
  }

  .cart-header h2 {
    font-size: 0.9rem;
  }

  .total-amount {
    font-size: 1rem;
  }
}

/* Transcription Styles */
.transcription-panel {
  border-top: 2px solid var(--gray-200);
  padding-top: 1rem;
}

.transcription-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.transcription-item {
  padding: 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.4;
  animation: slideIn 0.2s ease-out;
}

.transcription-item.agent {
  background: var(--pink-lighter);
  border-left: 4px solid var(--primary);
}

.transcription-item.user {
  background: var(--gray-100);
  border-left: 4px solid var(--gray-400);
  text-align: right;
}

.transcription-speaker {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.transcription-text {
  word-wrap: break-word;
  word-break: break-word;
}

.transcription-placeholder {
  text-align: center;
  color: var(--gray-400);
  font-size: 0.875rem;
  padding: 2rem 0;
}
