/* Pump & Park Feedback Chat Widget Styles */

[x-cloak] { display: none !important; }

/* Hide the feedback bubble while the map is in the iPhone fullscreen/driving
   overlay so it doesn't clutter the map or sit over the HUD Exit button. */
body:has(.parking-map-shell.is-fullscreen-fallback) #feedback-chat-widget {
  display: none !important;
}

/* Floating Button */
.feedback-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.feedback-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Auto-hide during scroll to avoid covering table rows (#20) */
.feedback-chat-button.feedback-hidden-on-scroll {
  opacity: 0;
  pointer-events: none;
}

.feedback-chat-button.pulse {
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(102, 126, 234, 0); }
  100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

/* Chat Panel */
.feedback-chat-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 100px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.feedback-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.feedback-chat-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.feedback-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Progress Indicator */
.feedback-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.progress-dots {
  display: flex;
  gap: 6px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dee2e6;
  transition: all 0.3s;
}

.progress-dot.completed {
  background: #28a745;
}

.progress-dot.current {
  background: #667eea;
  transform: scale(1.2);
}

.progress-text {
  font-size: 12px;
  color: #6c757d;
  margin-left: auto;
}

/* Messages Container */
.feedback-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Message Styles */
.message {
  display: flex;
  gap: 12px;
  animation: message-slide-in 0.3s ease;
}

@keyframes message-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.bot-message {
  flex-direction: row;
}

.message.user-message {
  flex-direction: row-reverse;
}

.message-avatar {
  font-size: 24px;
  flex-shrink: 0;
}

.message-content {
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 80%;
}

.user-message .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.message-content p {
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.message-content p:last-child {
  margin: 0;
}

/* Quick Replies */
.quick-replies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.quick-reply-btn {
  padding: 10px 16px;
  background: white;
  border: 2px solid #667eea;
  color: #667eea;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.quick-reply-btn:hover {
  background: #667eea;
  color: white;
}

.quick-reply-btn.priority-high {
  border-color: #dc3545;
  color: #dc3545;
}

.quick-reply-btn.priority-high:hover {
  background: #dc3545;
  color: white;
}

.quick-reply-btn.priority-medium {
  border-color: #ffc107;
  color: #856404;
}

.quick-reply-btn.priority-medium:hover {
  background: #ffc107;
  color: #000;
}

.quick-reply-btn.priority-low {
  border-color: #28a745;
  color: #28a745;
}

.quick-reply-btn.priority-low:hover {
  background: #28a745;
  color: white;
}

/* Input Fields */
.feedback-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.feedback-input:focus {
  outline: none;
  border-color: #667eea;
}

/* File Previews */
.file-previews {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 13px;
}

.file-preview i {
  color: #667eea;
}

.file-size {
  color: #6c757d;
  margin-left: auto;
}

/* Buttons */
.continue-btn,
.submit-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.continue-btn:hover,
.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.continue-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.edit-btn {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
}

.cancel-btn {
  padding: 10px 20px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
}

.skip-btn {
  padding: 10px 20px;
  background: transparent;
  color: #6c757d;
  border: 2px solid #6c757d;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
}

/* Confirmation Box */
.confirmation-box {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  margin: 12px 0;
}

.confirmation-box p {
  margin: 8px 0;
  font-size: 14px;
}

/* GitHub Link */
.github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #24292e;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 12px;
  transition: all 0.2s;
}

.github-link:hover {
  background: #42454a;
}

/* Error Alert */
.feedback-error {
  padding: 12px 20px;
  background: #f8d7da;
  color: #721c24;
  border-top: 1px solid #f5c6cb;
  font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .feedback-chat-panel {
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .feedback-chat-button {
    /* Bottom-RIGHT on phones: standard FAB convention. Safe area preserved. */
    bottom: calc(15px + env(safe-area-inset-bottom));
    right: calc(15px + env(safe-area-inset-right));
    left: auto;
    padding: 10px 16px;
    font-size: 14px;
  }

  .feedback-chat-button span {
    display: none;
  }
}
