/* General Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #2d3748;
}

.logo-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Takes available space */
}

.text-danger {
  color: #F8285A
}

.container {
  max-width: 600px; /* Changed from 800px to 600px */
  width: 100%; /* Full width on mobile */
  margin: 20px auto;
  padding: 20px;
  background: rgb(234, 239, 239);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px); /* Full screen height minus header/footer spacing */
  overflow-y: hidden; /* Prevent vertical overflow */
}
.header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 10px; /* Reduced from 20px */
}

.header-content {
  display: flex;
  align-items: center;
}

.logo {
  width: auto; 
  height: 40px;
  object-fit: contain;
  margin-bottom: 6px;
  align-self: flex-start; /* Ensures logo stays left */
}


.header-subtitle {
  font-size: 13px; /* Slightly reduced from 14px */
  font-weight: 500;
  color: #374151;
  text-align: left;
  margin: 0;
}

.get-quote-button {
  background: #86c43f;  
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  margin-top: 0; /* Ensures button stays aligned with logo */
}

.get-quote-button:hover {
  background-color: #6C9F31; /* Hover color */
}

/* Chat Container Styles (updated with fixes) */
.chat-container {
  position: relative;
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden; /* Added to prevent horizontal overflow */
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgb(120, 183, 208);
  background-image: 
    linear-gradient(to bottom, rgba(245, 245, 245, 0.1) 1px, transparent 1px),
    linear-gradient(to right, rgba(245, 245, 245, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  min-height: 200px;
  word-wrap: break-word; /* Added for better text handling */
}

/* Add this to your styles_dev.css file, preferably in the Chat Container Styles section */

/* Modern scrollbar styling */
/* Modern scrollbar styling */
.chat-container::-webkit-scrollbar {
  width: 8px; /* Width of the scrollbar */
}

.chat-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05); /* Light track color */
  border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2); /* Scrollbar handle color */
  border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3); /* Darker on hover */
}

/* For Firefox */
.chat-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

.message {
  margin-bottom: 12px; /* Reduced from 20px */
  word-break: break-word;
}

.user-message {
  text-align: right;
}

.bot-message {
  text-align: left;
}

.message-bubble {
  display: inline-block;
  padding: 1px 18px;
  border-radius: 18px;
  max-width: 80%; /* Increased from 70% to use more of the narrower space */
  word-wrap: break-word;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  line-height: 1.2;
  margin-bottom: 8px;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.message-bubble ol {
  margin: 4px 0;
  padding-left: 20px;
  counter-reset: item;
}

.message-bubble ol li {
  margin: 0;
  padding: 0 0 2px 0;
  line-height: 1.2;
  list-style-type: none;
  counter-increment: item;
}

.message-bubble ol li:before {
  content: counter(item) ".";
  display: inline-block;
  width: 1.5em;
  margin-left: -1.5em;
  font-weight: bold;
}


.message-bubble br {
  content: "";
  display: block;
  margin-top: 1px;
  line-height: 1px;
}

/* For list items specifically */
.message-bubble ul {
  margin-top: 4px; /* Reduced spacing above lists */
  margin-bottom: 4px; /* Reduced spacing below lists */
  padding-left: 18px; /* Keep indentation for lists */
}

.message-bubble li {
  margin-bottom: 2px; /* Reduced from 4px */
  padding-bottom: 0; /* Remove any padding between items */
}

.user-message .message-bubble {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0369a1;
  border: 1px solid rgba(2, 132, 199, 0.1);
  border-bottom-right-radius: 4px;
}

.bot-message .message-bubble {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.1);
  border-bottom-left-radius: 4px;
}

.input-container {
  flex-shrink: 0; /* Prevent shrinking */
  margin-top: 10px;
  overflow: hidden; /* Prevent overflow */
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow: hidden; /* Prevent overflow */
}

#message-input {
  flex: 1;
  padding: 14px;
  font-size: 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  resize: none; /* Disable resizing */
  min-height: 30px;
  width: 100%; /* Full width */
  outline: none;
  background-color: rgb(166, 227, 233);
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#message-input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 1px rgb(127, 140, 170);
}

#message-input::placeholder {
  color: #9ca3af;
}

.icon-button {
  white-space: nowrap;
  cursor: pointer;
  color: #fff;
  background: #00ADB5; /* Teal */
  border: none;
  border-radius: 16px;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  display: flex;
  margin-bottom: 4px;
  transition: background-color 0.3s ease;
}

.icon-button:hover {
  background-color: #0088CC;
}

/* Modal Styles (restore original styling) */
.modal {
  display: none;
  position: fixed;
  top: 50%; /* Changed from 50% to move it higher */
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 25px;
  border: none;
  border-radius: 12px;
  width: 90%; /* Increased from 80% to use more of the narrower space */
  max-width: 500px; /* Reduced from 600px to match new container scale */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-content h2 {
  color: #2d3748;
  margin-bottom: 15px;
}

.modal-content h3 {
  color: #4a5568;
  margin-bottom: 20px;
  font-weight: 500;
}

.modal-content label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-weight: 500;
}

.close {
  color: #6b7280;
  float: right;
  font-size: 28px;
  font-weight: bold;
  transition: color 0.2s ease;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: white;
}

.modal-content button[type="submit"] {
  background-color: #00ADB5;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

.close:hover,
.close:focus {
  color: #111827;
  text-decoration: none;
  cursor: pointer;
}
  
.modal-content input,
.modal-content select {
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-content input:focus,
.modal-content select:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
  outline: none;
}

.modal-content button {
  padding: 10px 20px;
  background-color: #00ADB5;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.modal-content button:hover {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  box-shadow: 0 4px 8px rgba(13, 148, 136, 0.3);
}

.thinking-animation {
  display: inline-block;
  margin-left: 5px;
}

.thinking-animation span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #9ca3af;
  margin: 0 2px;
  animation: bounce 1.4s infinite ease-in-out both;
}

.thinking-animation span:nth-child(1) {
  animation-delay: -0.32s;
}

.thinking-animation span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1.0);
  }
}

/* Update modal z-index values */
  #session-timeout-modal {
      z-index: 2000; /* Higher than quote modal */
  }
  
  #quote-modal {
      display: none;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 1000;
      width: 100%;
      height: 100%;
      overflow: auto;
      background-color: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(4px);
  }

  #quote-modal .modal-content {
      background-color: #fefefe;
      margin: 10% auto;
      padding: 25px;
      border: none;
      border-radius: 12px;
      width: 90%;
      max-width: 500px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  }

#quote-modal .close-modal {
  color: #6b7280;
  float: right;
  font-size: 28px;
  font-weight: bold;
  transition: color 0.2s ease;
}

#quote-modal .close-modal:hover,
#quote-modal .close-modal:focus {
  color: #111827;
  text-decoration: none;
  cursor: pointer;
}

#quote-modal h2 {
  color: #2d3748;
  margin-bottom: 15px;
  font-size: 24px;
}

#quote-modal p {
  color: #4a5568;
  margin-bottom: 25px;
  font-size: 16px;
  line-height: 1.5;
}

#quote-modal .modal-button {
  background: linear-gradient(135deg, #86c43f 0%, #6C9F31 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  margin-top: 10px;
}

#quote-modal .modal-button:hover {
  background: linear-gradient(135deg, #6C9F31 0%, #5a8a2a 100%);
  box-shadow: 0 4px 8px rgba(134, 196, 63, 0.3);
}

#quote-form button[type="submit"]:hover {
  background: linear-gradient(135deg, #6C9F31 0%, #5a8a2a 100%);
  box-shadow: 0 4px 8px rgba(134, 196, 63, 0.3);
}

#quote-confirmation {
  text-align: center;
}

/* Success state */
#quote-modal.success h2 {
  color: #166534;
}

/* Error state */
#quote-modal.error h2 {
  color: #991b1b;
}

#quote-modal-title {
  text-align: left;
  margin-bottom: 20px;
  color: #2d3748;
}

#quote-confirmation p {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.5;
  color: #4a5568;
  text-align: left;
}

.modal-title-primary {
  margin-bottom: 8px;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2d3748;
}

.modal-title-secondary {
  font-size: 1rem;
  font-weight: 400;
  color: #4a5568;
  line-height: 1.5;
}

#signup-modal .form-group {
  margin-bottom: 16px;
}

#signup-modal .validation-info {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

#signup-modal .character-count {
  font-size: 12px;
  color: #6b7280;
}

#signup-modal .error-message {
  color: #dc2626;
  font-size: 12px;
  display: none;
}

#signup-modal input:invalid {
  border-color: #fca5a5;
}

#signup-modal input:valid {
  border-color: #d1d5db;
}

/* Error message styling */
.error-message {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
  display: none; /* Initially hidden */
}

.invalid-input {
  border-color: #fca5a5 !important;
}

/* Validation info container */
.validation-info {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  min-height: 16px; /* Ensure space for error message */
}

.character-count {
  font-size: 12px;
  color: #6b7280;
}

/* Mobile Responsive Styles */
@media (max-width: 600px) {
  .message-bubble {
      line-height: 1.15; /* Even tighter on mobile */
      margin-bottom: 6px;
      max-width: 85%; /* Keep your mobile-specific width */
    }
    
    .message-bubble ul {
      margin-top: 3px;
      margin-bottom: 3px;
    }
    
    .message-bubble li {
      margin-bottom: 1px;
    }
    
    .message {
      margin-bottom: 10px;
    }

  .modal-content {
      margin: 20% auto; /* More top margin on mobile */
      width: 95%; /* Even wider on small screens */
      padding: 20px 15px; /* Adjusted padding */
    }
  .container {
      max-width: 100%; /* Full width on mobile */
      padding: 10px; /* Reduced padding */
    }
  .header {
      flex-wrap: nowrap; /* Prevents wrapping */
      gap: 10px;
  }    
  .logo-container {
      flex-direction: column;
  }
  .get-quote-button {
      padding: 6px 12px;
      font-size: 12px;
      margin-top: 0; /* Maintains alignment with logo */
  }
  .header-content {
      flex-direction: column;
      align-items: center;
  }  
  .logo {
      height: 35px;
      margin-bottom: 4px;
  }
  .header-subtitle {
      font-size: 15px;
      white-space: normal;
  }
  .header-title {
    margin-top: 5px;
  }  
  .chat-container {
      min-height: 200px; /* Smaller minimum height */
      max-height: 50vh; /* Limit to 50% of viewport height */
    }
  .input-container {
    margin-top: 10px;
  }
  .input-wrapper {
      flex-direction: column-reverse; /* Input above button on mobile */
      overflow: hidden; /* Prevent overflow */
    }
  .header-subtitle {
    font-size: 16px; /* Larger font size for mobile */
  }

  #message-input {
      min-height: 60px; /* Compact height */
      width: 90%; /* Slightly reduced width to avoid overflow */
      margin: 0 auto; /* Center the input box */
      max-width: calc(100% - 40px); /* Account for padding/margins */
    }

    .icon-button {
      width: 28px;
      height: 28px;
    }

    .message-bubble {
      max-width: 85%; /* Adjust bubble width */
    }

    #quote-modal .modal-content {
      margin: 25% auto;
      padding: 20px;
      width: 85%;
    }
    
    #quote-modal h2 {
      font-size: 20px;
    }
    
    #quote-modal p {
      font-size: 15px;
      margin-bottom: 20px;
    }
    
    #quote-modal .modal-button {
      padding: 10px 20px;
      font-size: 15px;
    }

/* Update the quote form styles to match signup form alignment */
#quote-form {
  text-align: left; /* Ensure all content is left-aligned */
  width: 100%;
}      

    /* Add these styles to your existing CSS */
    #quote-form input {
      width: 100%;
      padding: 10px;
      margin-bottom: 16px;
      border: 1px solid #d1d5db;
      border-radius: 8px;
      background-color: white;
      box-sizing: border-box; /* Include padding in width calculation */
    }

#quote-form input:read-only {
  background-color: #f3f4f6;
  border-color: #e5e7eb;
}

#quote-form label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-weight: 500;
  text-align: left; /* Explicit left alignment for labels */
}

#quote-form button[type="submit"] {
  background: linear-gradient(135deg, #86c43f 0%, #6C9F31 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%;
}


#quote-confirmation p {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.5;
  color: #4a5568;
}

#signup-modal .validation-info {
  flex-direction: column;
}

#signup-modal .character-count,
#signup-modal .error-message {
  font-size: 11px;
}

}