/* ============================================
   LANDLORD ASSISTANT - GLOBAL STYLES
   ============================================ */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  height: 64px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.navbar-user {
  font-size: 14px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
  font-size: 32px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-top: 40px;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.alert-card {
  padding: 20px;
}

.alert-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.alert-subtitle {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 12px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  background: #6b8f71;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn:hover {
  background: #5a7960;
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* ============================================
   TABS
   ============================================ */
.tabs-container {
  background: #ffffff;
  border-radius: 12px 12px 0 0;
}

.tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  gap: 0;
}

.tab {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 15px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  transition: all 0.2s ease;
  color: #6b7280;
  font-family: Arial, sans-serif;
}

.tab:hover {
  border-bottom-color: #6b8f71;
}

.tab.active {
  border-bottom-color: #6b8f71;
  font-weight: bold;
  color: #1f2937;
}

.tab-dropdown {
  position: relative;
}

.dropdown-arrow {
  font-size: 10px;
  margin-left: 4px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  width: 280px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  z-index: 50;
  overflow: hidden;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-header {
  padding: 8px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: #f3f4f6;
}

.dropdown-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.dropdown-item-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* ============================================
   FORMS
   ============================================ */
.chat-textarea {
  width: 100%;
  height: 140px;
  padding: 12px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  resize: none;
  font-family: Arial, sans-serif;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: Arial, sans-serif;
}

.select-input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  background: white;
  cursor: pointer;
}

.search-filter-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: #6b8f71;
}

.filter-btn.active {
  background: #6b8f71;
  color: white;
  border-color: #6b8f71;
}

/* ============================================
   PROPERTY CARDS
   ============================================ */
.property-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
  cursor: default;
}

.property-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.property-image {
  width: 100%;
  height: 200px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #9ca3af;
}

.property-content {
  padding: 20px;
}

.property-name {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.property-address {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 12px;
}

.property-address-header {
  font-size: 16px;
  color: #6b7280;
  margin: 8px 0 24px 0;
}

.property-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 14px;
}

.property-meta-item {
  display: flex;
  flex-direction: column;
}

.property-meta-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.property-meta-value {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.property-actions {
  display: flex;
  gap: 8px;
}

.property-actions .btn,
.property-actions .btn-secondary {
  flex: 1;
  text-align: center;
}

/* Property delete icon in corner */
.property-delete-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: none;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #111827; /* black */
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: none;
  opacity: 0.65;
}

.property-delete-icon:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  opacity: 1;
  transform: translateY(-1px);
}

.property-delete-icon-list {
  background: none;
  border: none;
  cursor: pointer;
  color: #111827; /* black */
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.65;
}

.property-delete-icon-list:hover {
  background: #f3f4f6;
  color: #111827;
  opacity: 1;
}

/* Ensure the image area can anchor the delete icon (we now render it inside .property-image) */
.property-image {
  position: relative;
}

.property-card {
  position: relative;
}

/* ============================================
   KPI CARDS & GRIDS
   ============================================ */
.kpi-card {
  margin: 32px 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.kpi-item {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
}

.kpi-summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-summary-content {
  display: flex;
  flex-direction: column;
}

.kpi-summary-value {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

.kpi-summary-label {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

/* ============================================
   PHOTO BANNER
   ============================================ */
.photo-banner {
  width: 100%;
  height: 250px;
  background: #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #9ca3af;
  margin-top: 24px;
}

/* ============================================
   DETAIL GRID
   ============================================ */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 14px;
  color: #6b7280;
}

.detail-value {
  font-size: 14px;
  color: #1f2937;
  text-align: right;
}

/* ============================================
   TABLES
   ============================================ */
.table-card {
  padding: 24px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
}

.data-table .tenant-name {
  font-weight: 600;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-active {
  background: #dcfce7;
  color: #166534;
}

.status-expiring {
  background: #fef3c7;
  color: #92400e;
}

.status-expired,
.status-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.status-vacant {
  background: #fee2e2;
  color: #991b1b;
}

.status-month-to-month {
  background: #e0e7ff;
  color: #3730a3;
}

/* ============================================
   RENT STEPS
   ============================================ */
.view-steps-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  color: #374151;
  transition: all 0.2s ease;
}

.view-steps-btn:hover {
  background: #e5e7eb;
  border-color: #6b8f71;
}

.no-steps {
  color: #9ca3af;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.expanded-row td {
  padding: 0 !important;
  background: transparent;
}

.rent-steps-container {
  background: #f3f4f6;
  border-radius: 12px;
  padding: 16px 24px;
  margin: 8px 16px 16px 16px;
}

.rent-steps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.rent-steps-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e5e7eb;
}

.rent-steps-table td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

.add-step-btn {
  margin-top: 12px;
  font-size: 13px;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
  position: relative;
  padding-left: 8px;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #6b8f71;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
  background: #dcfce7;
}

.timeline-content {
  flex: 1;
  padding-top: 4px;
}

.timeline-date {
  font-size: 14px;
  font-weight: 600;
  color: #6b8f71;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.timeline-meta {
  font-size: 13px;
  color: #6b7280;
}

/* ============================================
   STORAGE OPTIONS
   ============================================ */
.storage-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.storage-option {
  padding: 20px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.storage-option:hover {
  border-color: #6b8f71;
}

.storage-option.active {
  border-color: #6b8f71;
  background: #f9fafb;
}

.storage-option-header {
  display: flex;
  align-items: flex-start;
}

.radio-button {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.radio-button.active {
  border-color: #6b8f71;
}

.radio-button-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b8f71;
}

/* ============================================
   DOCUMENT CARDS
   ============================================ */
.document-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.document-icon {
  width: 48px;
  height: 48px;
  background: #f3f4f6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.document-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.document-meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.document-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 90%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  margin: auto;
}

.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  margin-bottom: 16px;
  background: #f9fafb;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============================================
   BACK LINK
   ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #6b8f71;
  margin-bottom: 16px;
  font-weight: 500;
}

.back-link:hover {
  color: #5a7960;
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  h1 {
    font-size: 24px;
  }
}

/* Chat History Styles */
.chat-message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  max-width: 85%;
  word-wrap: break-word;
}

.chat-message.user {
  background: #6b8f71;
  color: white;
  margin-left: auto;
  text-align: right;
}

.chat-message.assistant {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  margin-right: auto;
}

.chat-message.assistant .message-header {
  font-weight: 600;
  color: #6b8f71;
  margin-bottom: 8px;
  font-size: 14px;
}

.chat-message.assistant .message-content {
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: normal;
  word-break: break-word;
}

/* Rich formatting for assistant answers (lists/paragraphs/code) */
.chat-message.assistant .message-content .chat-paragraph {
  margin: 0 0 10px 0;
}

.chat-message.assistant .message-content .chat-paragraph:last-child {
  margin-bottom: 0;
}

.chat-message.assistant .message-content .chat-heading {
  font-weight: 700;
  color: #111827;
  margin: 6px 0 10px 0;
}

.chat-message.assistant .message-content .chat-heading-1 {
  font-size: 16px;
}
.chat-message.assistant .message-content .chat-heading-2,
.chat-message.assistant .message-content .chat-heading-3 {
  font-size: 15px;
}

.chat-message.assistant .message-content .chat-list {
  margin: 6px 0 12px 0;
  padding-left: 18px;
}

.chat-message.assistant .message-content .chat-list li {
  margin: 4px 0;
}

.chat-message.assistant .message-content .chat-code {
  margin: 10px 0;
  padding: 12px;
  background: #0b1220;
  color: #e5e7eb;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
}

.chat-message.assistant .message-content .chat-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre;
}

.chat-message.assistant .message-sources {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #6b7280;
}

.chat-message.loading {
  background: #f3f4f6;
  color: #6b7280;
  font-style: italic;
  margin-right: auto;
}

.chat-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  margin-right: auto;
}

.chat-sources-link {
  color: #6b8f71;
  text-decoration: none;
  font-size: 12px;
}

.chat-sources-link:hover {
  text-decoration: underline;
}

/* ============================================
   CHAT WIDGET (FLOATING)
   ============================================ */
.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900; /* keep below modal-overlay (1000) */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.chat-widget-hint {
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
  animation: chat-widget-bounce 2s ease-in-out infinite;
  position: relative;
}

.chat-widget-hint-text {
  font-size: 13px;
  color: #111827;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-widget-hint-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-widget-hint-glow {
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: #f59e0b;
  opacity: 0.7;
  filter: blur(18px);
  animation: chat-widget-pulse 2s ease-in-out infinite;
}

.chat-widget-hint-svg {
  position: relative;
  z-index: 1;
}

.chat-widget-hint-close {
  position: absolute;
  top: 4px;
  right: 4px;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  z-index: 2;
}

.chat-widget-hint-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.chat-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #6b8f71;
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(107, 143, 113, 0.35);
  transition: all 0.25s ease;
}

.chat-toggle-btn:hover {
  background: #5a7960;
  box-shadow: 0 14px 26px rgba(107, 143, 113, 0.45);
  transform: translateY(-2px);
}

.chat-icon {
  font-size: 20px;
  line-height: 1;
}

.chat-text {
  font-family: Arial, sans-serif;
}

.chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 100px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel.open {
  display: flex;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #6b8f71;
  color: white;
}

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

.chat-icon-header {
  font-size: 20px;
}

.chat-close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

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

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f9fafb;
}

.chat-welcome {
  background: white;
  padding: 16px;
  border-radius: 12px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Override old inline-chat styles with widget-friendly bubbles */
.chat-message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  max-width: unset;
}

.chat-message.user {
  background: #6b8f71;
  color: white;
  margin-left: 40px;
  margin-right: 0;
  text-align: left;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant {
  background: white;
  color: #1f2937;
  margin-right: 40px;
  margin-left: 0;
  border-bottom-left-radius: 4px;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-input-container {
  padding: 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  resize: none;
  min-height: 60px;
}

.chat-input:focus {
  outline: none;
  border-color: #6b8f71;
}

.chat-send-btn {
  align-self: flex-end;
  background: #6b8f71;
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.chat-send-btn:hover {
  background: #5a7960;
}

.chat-send-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

@keyframes chat-widget-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes chat-widget-pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

@media (max-width: 640px) {
  .chat-panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 80px);
    bottom: 16px;
    right: 16px;
  }
  .chat-widget {
    bottom: 16px;
    right: 16px;
  }
  .chat-widget-hint-text {
    white-space: normal;
    max-width: calc(100vw - 160px);
  }
}
