/* ChatInterface.css */
.page-container {
  max-width: 1280px; /* Increased from 1024px to 1280px */
  margin: 0 auto;
  padding: 0 15px;
}

/* Chat Title Container - glass morphism effect */
.chat-title-container {
  height: 81px;
  max-width: 1280px; /* Increased from 1024px to 1280px */
  margin-top: 50px;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

/* New Plan Button - styled with light green */
.new-plan-btn {
  padding: 8px 16px;
  background-color: #8BBF9F;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(139, 191, 159, 0.4);
}

.new-plan-btn:hover {
  background-color: #74A987;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 191, 159, 0.5);
}

/* Travel Form Container - glass morphism effect with stronger padding rule */
.travel-form-container {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 35px 45px !important; /* Important flag to override any conflicting styles */
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  box-sizing: border-box; /* Ensure padding is included in the width calculation */
}

.travel-form-container h2 {
  margin-top: 0;
  margin-bottom: 25px;
  color: #495858;
  font-size: 1.5rem;
  font-weight: 600;
}

/* Ensure form groups also respect padding */
.travel-form-container .form-group {
  margin-bottom: 20px;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Form Groups - enhanced styling */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495858;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(255, 255, 255, 1);
}

/* Submit Button - light green gradient style */
.submit-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #8BBF9F, #74A987);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 25px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(139, 191, 159, 0.4);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(139, 191, 159, 0.5);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(139, 191, 159, 0.4);
}

.submit-btn:disabled {
  background: linear-gradient(135deg, #B0D8BC, #9ECBAD);
  cursor: not-allowed;
  transform: none;
}

/* Chat Container - glass morphism effect */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 85vh;
  max-width: 1280px; /* Updated from 1024px to 1280px to match title container */
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.chat-history {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: transparent;
}

.chat-message {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 12px;
  max-width: 90%; /* Limit width to create more chat-like appearance */
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-message.user {
  background: rgba(50, 115, 220, 0.15); /* Darker blue background for better contrast */
  margin-left: auto;  /* Auto margin will help center or align right */
  margin-right: auto; /* Right margin for alignment */
  border-left: 4px solid #0066CC; /* Darker blue accent for higher contrast */
  border-radius: 12px; /* Consistent border radius */
  box-shadow: 0 3px 10px rgba(0, 102, 204, 0.15);
  position: relative; /* Add position for potential pattern */
}

.chat-message.bot {
  background: rgba(76, 154, 86, 0.2); /* Darker green background for better contrast */
  margin-left: auto;  /* Left margin for alignment */
  margin-right: auto; /* Auto margin will help center or align left */
  border-right: 4px solid #41843D; /* Darker green border for higher contrast */
  border-radius: 12px; /* Consistent border radius */
  box-shadow: 0 3px 10px rgba(65, 132, 61, 0.15);
  position: relative; /* Add position for potential pattern */
}

/* Markdown styling - enhanced for better readability */
.chat-message p {
  margin: 8px 0;
  line-height: 1.5;
}

.chat-message h1, 
.chat-message h2, 
.chat-message h3 {
  margin-top: 16px;
  margin-bottom: 12px;
  color: #1e40af;
  font-weight: 600;
}

.chat-message h1 {
  font-size: 1.5rem;
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  padding-bottom: 6px;
}

.chat-message h2 {
  font-size: 1.3rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  padding-bottom: 4px;
}

.chat-message h3 {
  font-size: 1.15rem;
}

.chat-message ul {
  padding-left: 20px;
  margin: 10px 0;
}

.chat-message li {
  margin-bottom: 5px;
}

.chat-message pre {
  background-color: rgba(30, 41, 59, 0.05);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid rgba(30, 41, 59, 0.1);
  margin: 12px 0;
}

.chat-message code {
  background-color: rgba(30, 41, 59, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #1e40af;
}

.chat-input {
  display: flex;
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-input input {
  flex: 1;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  margin-right: 10px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.chat-input button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #8BBF9F, #74A987);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-input button:hover {
  background: linear-gradient(135deg, #74A987, #5D9270);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 191, 159, 0.4);
}

.loading-spinner {
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
  margin: 25px auto;
}

.loading-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  margin: 20px auto; /* Changed from 20px 0 to 20px auto for horizontal centering */
  border-radius: 12px;
  background-color: rgba(139, 191, 159, 0.1);
  border: 1px solid rgba(139, 191, 159, 0.3);
  box-shadow: 0 4px 15px rgba(139, 191, 159, 0.15);
  min-height: 200px; /* Add minimum height to ensure vertical centering */
  width: 90%; /* Match the max-width of chat messages */
}

.loading-container .loading-spinner {
  width: 60px;
  height: 60px;
  border-width: 6px;
  border: 6px solid rgba(139, 191, 159, 0.2);
  border-left-color: #74A987;
}

.loading-message {
  margin-top: 20px;
  font-size: 1.2rem;
  color: #495858;
  text-align: center;
  font-weight: 600;
  max-width: 80%;
  line-height: 1.6;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

h1 {
  color: #495858;
  margin: 0;
  font-weight: 600;
}

/* Approval Section */
.approve-section {
  padding: 25px;
  background-color: rgba(240, 249, 243, 0.95);
  text-align: center;
  border-top: 2px solid rgba(139, 191, 159, 0.4);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.approve-section h3 {
  color: #2d3748;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.approve-section p {
  color: #4a5568;
  margin-bottom: 20px;
}

.approval-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.approve-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, #8BBF9F, #74A987);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(139, 191, 159, 0.4);
}

.approve-btn:hover {
  background: linear-gradient(135deg, #74A987, #5D9270);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 191, 159, 0.5);
}

.approve-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(139, 191, 159, 0.4);
}

.reject-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
  color: #4a5568;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(203, 213, 224, 0.4);
}

.reject-btn:hover {
  background: linear-gradient(135deg, #cbd5e0, #a0aec0);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(203, 213, 224, 0.5);
}

.reject-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(203, 213, 224, 0.4);
}

/* New button styling for full width button */
.full-width {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

/* Processing state styling */
.approve-btn:disabled, 
.reject-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Status indicators */
.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  font-size: 0.9rem;
  color: #4a5568;
}

.status-indicator.processing:before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.5);
  border-top-color: #3b82f6;
  animation: spin 1s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chat-title-container {
    height: auto;
    padding: 15px;
    flex-direction: column;
    gap: 10px;
  }
  
  h1 {
    font-size: 1.4rem;
    text-align: center;
  }
  
  .chat-container {
    height: 60vh;
  }
  
  .new-plan-btn {
    width: 100%;
  }
  
  .chat-message.user,
  .chat-message.bot {
    margin-left: 10px;
    margin-right: 10px;
  }
}