/* Persona Manager Modal Styles */

.persona-modal .modal-content {
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
}

.persona-tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.persona-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.persona-tab:hover {
  color: #374151;
}

.persona-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.persona-tab-content {
  display: none;
}

.persona-tab-content.active {
  display: block;
}

/* Search and Filter */
.persona-search {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.persona-search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.persona-filter-category {
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

/* Persona Grid */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

.persona-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.persona-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  transform: translateY(-2px);
}

.persona-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.persona-avatar {
  font-size: 36px;
  display: inline-block;
}

.persona-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.persona-badge.sales {
  background: #dbeafe;
  color: #1e40af;
}

.persona-badge.marketing {
  background: #fce7f3;
  color: #9f1239;
}

.persona-badge.operations {
  background: #fef3c7;
  color: #92400e;
}

.persona-badge.finance {
  background: #d1fae5;
  color: #065f46;
}

.persona-badge.hr {
  background: #e0e7ff;
  color: #3730a3;
}

.persona-badge.creative {
  background: #fae8ff;
  color: #701a75;
}

.persona-name {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0 4px;
  color: #111827;
}

.persona-role {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 8px;
}

.persona-tagline {
  font-size: 13px;
  color: #374151;
  margin: 0 0 12px;
  line-height: 1.5;
  min-height: 40px;
}

.persona-expertise {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  min-height: 30px;
}

.expertise-tag {
  padding: 4px 8px;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 11px;
  color: #4b5563;
}

.persona-card-footer {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.persona-card-footer button {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #2563eb;
  color: white;
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: none;
}

.btn-secondary:hover:not(:disabled) {
  background: #e5e7eb;
}

.btn-link {
  background: none;
  color: #2563eb;
  border: none;
}

.btn-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Installed Personas List */
.installed-personas-list {
  max-height: 500px;
  overflow-y: auto;
}

.installed-persona-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
}

.installed-persona-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.installed-persona-info h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.installed-persona-info p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

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

.installed-persona-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
}

.btn-danger:hover {
  background: #fecaca;
}

/* Empty and Loading States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state p:first-child {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #374151;
}

.empty-state-hint {
  font-size: 14px;
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.error-state {
  text-align: center;
  padding: 60px 20px;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 8px;
}

/* Persona Details Overlay */
.persona-details-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: 100001; /* Higher than workspace settings modal (100000) */
}

.persona-details-modal {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.persona-details-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.persona-avatar-large {
  font-size: 64px;
}

.persona-details-header h2 {
  margin: 0 0 4px;
  font-size: 24px;
  color: #111827;
}

.persona-role-large {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

.persona-details-body {
  padding: 24px;
}

.persona-tagline-large {
  font-size: 16px;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 24px;
}

.persona-details-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 24px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.expertise-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.expertise-tag-large {
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 13px;
  color: #4b5563;
}

.persona-details-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

.persona-details-footer button {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

/* Memory Manager Styles - Now using Bootstrap modal structure */
.memory-manager-modal .modal-body {
  overflow-y: auto;
  padding: 24px;
}

.memory-modal-content {
  display: flex;
  flex-direction: column;
}

.memory-modal-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.memory-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: normal;
}

.memory-tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.memory-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.memory-tab:hover {
  color: #374151;
}

.memory-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.memory-tab-content {
  display: none;
}

.memory-tab-content.active {
  display: block;
}

/* Memory Filters */
.memory-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.memory-filter-category,
.memory-filter-importance {
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

/* Memory List */
.memory-list {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 8px;
}

.memory-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.memory-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.memory-meta {
  display: flex;
  gap: 8px;
}

.memory-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Category badges */
.memory-category-user_info {
  background: #dbeafe;
  color: #1e40af;
}

.memory-category-project {
  background: #fce7f3;
  color: #9f1239;
}

.memory-category-decision {
  background: #fef3c7;
  color: #92400e;
}

.memory-category-pattern {
  background: #d1fae5;
  color: #065f46;
}

.memory-category-preference {
  background: #e0e7ff;
  color: #3730a3;
}

.memory-category-context {
  background: #fae8ff;
  color: #701a75;
}

/* Importance badges */
.memory-importance-critical {
  background: #fee2e2;
  color: #991b1b;
}

.memory-importance-high {
  background: #fed7aa;
  color: #9a3412;
}

.memory-importance-medium {
  background: #fef3c7;
  color: #92400e;
}

.memory-importance-low {
  background: #e5e7eb;
  color: #374151;
}

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

.btn-icon {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 1;
}

.memory-content {
  font-size: 14px;
  color: #111827;
  line-height: 1.6;
  margin-bottom: 12px;
}

.memory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.memory-tag {
  padding: 4px 8px;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 11px;
  color: #4b5563;
}

.memory-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.memory-timestamp,
.memory-access {
  font-size: 12px;
}

/* Memory Create/Edit Forms */
.memory-create-form,
.memory-edit-form {
  max-width: 700px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: #2563eb;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

/* Memory Search */
.memory-search-form {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.memory-search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.memory-search-results {
  max-height: 500px;
  overflow-y: auto;
}

.search-results-header {
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.search-results-header p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

/* Memory Statistics */
.memory-stats-container {
  max-width: 700px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.stats-section {
  margin-bottom: 24px;
}

.stats-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-breakdown {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
}

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

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

.stat-count {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}
