/* Long-Term Memory & User Preferences Styling */

.profile {
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  border-radius: 12px;
  padding: 4px 6px;
}
.profile:hover {
  background: rgba(41, 77, 57, 0.08);
}
.profile:active {
  transform: scale(0.98);
}

#memory-dialog.memory-modal {
  width: min(920px, calc(100vw - 32px));
  max-width: 920px;
  padding: 0;
  max-height: 90vh;
  border: 1px solid #dce5d8;
  border-radius: 20px;
  background: #fbfcf7;
  color: #173e35;
  box-shadow: 0 20px 50px rgba(23, 62, 53, 0.18);
  overflow: hidden;
}

#memory-dialog[open] {
  display: flex;
  flex-direction: column;
}

.memory-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
  min-height: 0;
}

.memory-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid #dce5d8;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-shrink: 0;
  background: #f7f9f2;
}

.memory-header h2 {
  margin: 4px 0 6px;
  font-size: 22px;
  color: #173e35;
}

.memory-header p {
  margin: 0;
  font-size: 13px;
  color: #556c5c;
  line-height: 1.6;
}

.memory-body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.memory-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: #f1f5ec;
  border-radius: 12px;
  border: 1px solid #e1e9dc;
}

.memory-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.memory-stat-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #e3ebd9;
  color: #355341;
  font-weight: 500;
}

.memory-stat-pill.active {
  background: #2b563d;
  color: #ffffff;
}

.memory-toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Add Form */
.memory-add-card {
  border: 1px solid #dce5d8;
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.memory-add-card h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #2b563d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.memory-add-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.memory-input-content {
  flex: 2 1 240px;
  padding: 10px 14px;
  border: 1px solid #cdd9c9;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fdfdfc;
}

.memory-input-content:focus {
  outline: 2px solid #2b563d;
  outline-offset: 1px;
}

.memory-select {
  flex: 1 1 110px;
  padding: 10px 12px;
  border: 1px solid #cdd9c9;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  background: #fdfdfc;
  cursor: pointer;
}

.memory-add-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #234c38;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.memory-add-btn:hover {
  background: #1b3d2c;
}

/* Filter Tabs */
.memory-filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.memory-filter-tabs button {
  padding: 6px 14px;
  border: 1px solid #dce5d8;
  border-radius: 20px;
  background: #f6f8f2;
  color: #4c6655;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.memory-filter-tabs button:hover {
  background: #e9f0e3;
  color: #173e35;
}

.memory-filter-tabs button.active {
  background: #2b563d;
  color: #ffffff;
  border-color: #2b563d;
  font-weight: 600;
}

/* Memory Cards List */
.memory-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memory-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid #e1e9dc;
  border-radius: 12px;
  background: #ffffff;
  transition: all 0.15s ease;
}

.memory-card.inactive {
  background: #f5f7f2;
  border-color: #e5ebe0;
  opacity: 0.65;
}

.memory-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.memory-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.memory-badge.cat-dining { background: #fbeee0; color: #8a4816; }
.memory-badge.cat-pace { background: #e3f2fd; color: #1565c0; }
.memory-badge.cat-culture { background: #e8f5e9; color: #2e7d32; }
.memory-badge.cat-nature { background: #f1f8e9; color: #558b2f; }
.memory-badge.cat-lodging { background: #ede7f6; color: #512da8; }
.memory-badge.cat-transport { background: #e0f2f1; color: #00695c; }
.memory-badge.cat-taboo { background: #fde8e8; color: #c53030; }
.memory-badge.cat-other { background: #f0f0f0; color: #555555; }

.memory-type-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #f0f4ec;
  color: #556c5c;
  white-space: nowrap;
}

.memory-content-text {
  font-size: 14px;
  color: #173e35;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.memory-source-pill {
  font-size: 11px;
  color: #839789;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.memory-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.memory-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #506857;
  cursor: pointer;
}

.memory-delete-btn {
  background: transparent;
  border: none;
  color: #a46161;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.memory-delete-btn:hover {
  background: #fbeaea;
  color: #b91c1c;
}

.memory-empty {
  text-align: center;
  padding: 36px 20px;
  color: #728779;
  background: #f8fbf5;
  border-radius: 12px;
  border: 1px dashed #dce5d8;
}

.memory-empty p {
  margin: 6px 0;
  font-size: 14px;
}

/* Footer */
.memory-footer {
  padding: 14px 28px;
  border-top: 1px solid #dce5d8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: #f7f9f2;
  flex-shrink: 0;
}

/* Suggestion Chips in New Trip Modal */
.memory-suggestions {
  margin: 8px 0 14px;
  padding: 10px 14px;
  background: #f2f7ec;
  border: 1px solid #d8e5d2;
  border-radius: 10px;
}

.memory-suggestions-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #385945;
  font-weight: 600;
  margin-bottom: 6px;
}

.memory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memory-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #c8d8c2;
  color: #274b37;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.memory-chip:hover {
  background: #2b563d;
  color: #ffffff;
  border-color: #2b563d;
}

.memory-chip span.chip-cat {
  font-size: 10px;
  opacity: 0.75;
}

@media (max-width: 640px) {
  #memory-dialog.memory-modal {
    width: calc(100vw - 16px);
    max-height: 94dvh;
  }
  .memory-header {
    padding: 16px;
  }
  .memory-body {
    padding: 14px 16px;
  }
  .memory-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .memory-card-actions {
    width: 100%;
    justify-content: space-between;
  }
  .memory-footer {
    padding: 12px 16px;
  }
}
