/* Base styles for the restaurant ordering system */
:root {
  --primary-color: #e63946;
  --secondary-color: #457b9d;
  --background-color: #f8f9fa;
  --text-color: #212529;
  --card-bg: #ffffff;
  --border-color: #dee2e6;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --highlight-color: rgba(230, 57, 70, 0.2);
  --highlight-border: rgba(230, 57, 70, 0.8);
}

/* Dark Mode Variables */
.dark-mode {
  --background-color: #121212;
  --text-color: #f8f9fa;
  --card-bg: #1e1e1e;
  --border-color: #2c2c2c;
  --highlight-color: rgba(230, 57, 70, 0.2);
  --highlight-border: rgba(230, 57, 70, 0.8);
}

/* Add global reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main container */
.garvi-container {
  display: flex;
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Chat panel */
.garvi-chat-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background-color: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  flex: 1;
}

/* Header */
.garvi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: #644afa;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.garvi-header-title {
  display: flex;
  flex-direction: column;
}

.garvi-header-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.garvi-status {
  display: flex;
  align-items: center;
  font-size: 12px;
  margin-top: 4px;
}

.garvi-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #4caf50;
  margin-right: 6px;
}

.garvi-header-actions {
  display: flex;
}

.garvi-toggle-chat {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* Conversation container */
.garvi-conversation-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Input container */
.garvi-input-container {
  padding: 12px 16px;
  background-color: #fff;
  border-top: 1px solid #eaeaea;
}

.garvi-input-wrapper {
  display: flex;
  align-items: center;
  background-color: #f0f2f5;
  border-radius: 24px;
  padding: 0 12px;
  overflow: hidden;
}

.garvi-input {
  flex: 1;
  height: 44px;
  border: none;
  padding: 0 12px;
  background: transparent;
  outline: none;
  font-size: 15px;
}

.garvi-send-button {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #644afa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: background-color 0.2s;
  border-radius: 50%;
}

.garvi-send-button:hover {
  background-color: rgba(100, 74, 250, 0.1);
}

.garvi-send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Order container */
.garvi-order-container {
  width: 280px;
  height: 100%;
  background-color: #fff;
  border-left: 1px solid #eaeaea;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.garvi-order-header {
  padding: 16px;
  background-color: #644afa;
  color: white;
  font-weight: 600;
}

.garvi-order-header h3 {
  margin: 0;
  font-size: 16px;
}

.garvi-order-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.garvi-order-empty {
  color: #999;
  text-align: center;
  padding: 20px 0;
}

.garvi-order-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f5f5f5;
}

.garvi-order-item-info {
  flex: 1;
}

.garvi-order-item-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.garvi-order-item-price {
  color: #666;
  font-size: 14px;
}

.garvi-order-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.garvi-order-item-qty {
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

.garvi-order-item-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background-color: #f0f2f5;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Styling for quantity buttons in the order page */
.quantity-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background-color: #f0f2f5;
  border: 1px solid #ddd;
  color: #333;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.quantity-btn:hover {
  background-color: #e0e0e0;
}

.quantity-btn:active {
  transform: scale(0.95);
}

.order-item-quantity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px;
}

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

.order-item-details {
  flex: 1;
}

.order-item-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.order-item-instructions {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.order-item-price {
  font-weight: 500;
  color: #1a73e8;
  margin-left: 10px;
}

.garvi-order-total {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  background-color: #f9f9f9;
  border-top: 1px solid #eaeaea;
  font-weight: 600;
}

.garvi-order-total-amount {
  color: #644afa;
}

/* Media Queries */
@media (max-width: 768px) {
  .garvi-container {
    flex-direction: column;
  }

  .garvi-chat-panel {
    max-width: 100%;
    height: 70%;
  }

  .garvi-order-container {
    width: 100%;
    height: 30%;
    border-left: none;
    border-top: 1px solid #eaeaea;
  }
}

/* For smaller mobile devices */
@media (max-width: 480px) {
  .garvi-chat-panel {
    height: 60%;
  }

  .garvi-order-container {
    height: 40%;
  }
}

/* Animation for new messages */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utility classes */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* Adjusting conversation area for better mobile integration with push-to-talk */
.conversation-area {
  position: absolute;
  bottom: 90px; /* Adjusted height since robot icon is removed */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 65vh; /* Slightly increased height for better chat experience */
}

/* Mobile adjustments for conversation area */
@media (max-width: 768px) {
  .conversation-area {
    bottom: 80px;
    height: calc(75vh - 60px); /* Adjusted to account for push-to-talk */
    padding: 0 10px;
  }

  /* Ensure the push-to-talk btn is more accessible on mobile */
  .push-to-talk-btn {
    min-height: 44px; /* Apple's minimum tap target size */
    width: 100%;
  }

  /* Make sure ModernChat has proper dimensions */
  .cs-main-container {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Make the message area take available space */
  .cs-message-list {
    flex: 1;
    overflow-y: auto;
  }

  /* Hide the transcript display when empty to save space */
  .transcript-display:empty {
    display: none;
  }
}

/* Mute Button Styles */
.mute-button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  z-index: 1001; /* Ensure it's above other elements */
}

.mute-button:hover {
  transform: scale(1.05);
  background-color: #0d6efd;
}

.mute-button.muted {
  background-color: #dc3545;
}

.mute-button.muted i {
  /* Change icon when muted */
  content: '\F50A';
}

/* Responsive adjustments for mute button */
@media (max-width: 768px) {
  .mute-button {
    width: 70px;
    height: 70px;
    bottom: 20px;
    right: 20px;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

/* Notification styles */
.notification {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: top 0.3s ease-in-out;
}

.notification.show {
  top: 20px;
}

.notification.info {
  background-color: var(--primary-color);
}

.notification.success {
  background-color: #28a745;
}

.notification.warning {
  background-color: #dc3545;
}

/* Mobile adjustments for notification */
@media (max-width: 768px) {
  .notification {
    width: 80%;
    text-align: center;
  }
}

/* Voice dropdown container - now just for mute button */
.voice-dropdown-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1001;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .voice-dropdown-container {
    bottom: 25px;
    right: 25px;
  }
}
