/* Стили для карточек персонажей и элементов мира в темном стиле */

/* Контейнеры и сетки карточек */
.characters-container, .world-container {
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background-color: var(--bg-primary);
  }
  
  .characters-list, .world-items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: 10px;
  }
  
  /* Заголовок раздела и панель управления */
  .characters-header, .world-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 4px;
  }
  
  .characters-title, .world-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
  }
  
  /* Стили поиска */
  .search-container {
    margin-bottom: 16px;
    position: relative;
  }
  
  .search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
  }
  
  .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
  }
  
  /* Карточки */
  .character-card, .world-item-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    width: 100%;
    border: 1px solid rgba(var(--border-color-rgb), 0.2);
  }

  .character-card.list-item-enter,
  .world-item-card.list-item-enter {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
    animation: cardIn 260ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  
  .character-card:hover, .world-item-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
  }
  
  /* Заголовки карточек */
  .character-name, .world-item-name {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* Подзаголовки и описания */
  .character-role, .world-item-type {
    font-size: 13px;
    padding: 3px 8px;
    background-color: var(--accent-secondary);
    color: var(--text-on-accent);
    border-radius: 4px;
    margin-bottom: 10px;
    display: inline-block;
  }
  
  .character-description-preview, .world-item-description-preview {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-grow: 1;
  }
  
  /* Нижняя часть карточки с метаданными */
  .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(var(--border-color-rgb), 0.5);
    font-size: 12px;
    color: var(--text-secondary);
  }
  
  .character-updated, .world-item-updated {
    font-size: 12px;
    color: var(--text-secondary);
  }
  
  .card-actions {
    display: flex;
    gap: 8px;
  }
  
  /* Улучшенные стили для кнопок действий с иконками */
  .card-action-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .card-action-button:hover {
    opacity: 1;
    background-color: var(--bg-primary);
  }
  
  .card-action-button i {
    font-size: 16px;
    color: inherit;
    transition: all 0.2s ease;
  }

.character-card-head,
.world-item-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.character-card-avatar,
.world-item-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(var(--border-color-rgb), 0.5);
  background: var(--bg-primary);
}

.character-card-main,
.world-item-card-main {
  min-width: 0;
  flex: 1;
}
  
  .edit-button:hover {
    color: var(--accent-primary);
  }
  
  .delete-button:hover {
    color: var(--error-color);
  }
  
  /* Карточка добавления */
  .add-card {
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    height: 100%;
    min-height: 110px;
    transition: all 0.2s ease;
  }
  
  .add-card:hover {
    border-color: var(--accent-primary);
    background-color: rgba(var(--accent-primary-rgb), 0.05);
  }

  @keyframes cardIn {
    from {
      opacity: 0;
      transform: translateY(10px) scale(0.99);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  
  .add-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .add-icon {
    font-size: 24px;
    color: var(--accent-primary);
    margin-bottom: 8px;
  }
  
  .add-text {
    font-size: 14px;
    color: var(--accent-primary);
    font-weight: 500;
  }
  
  /* Добавляем CSS переменные для rgba версий цветов */
  :root {
    --accent-primary-rgb: 255, 154, 118;
    --border-color-rgb: 61, 61, 61;
  }
  
  body.dark {
    --accent-primary-rgb: 255, 154, 118;
    --border-color-rgb: 61, 61, 61;  
  }
  
  body.forest-theme {
    --accent-primary-rgb: 201, 177, 126;
    --border-color-rgb: 44, 73, 54;
  }
  
  body.sepia-theme {
    --accent-primary-rgb: 149, 92, 54;
    --border-color-rgb: 203, 184, 151;
  }

/* Увеличенные модалки профилей персонажей/мира */
.profile-modal-content {
  width: min(920px, 94vw);
  max-width: 920px;
  min-height: 560px;
  max-height: 92vh;
  margin: 0 auto;
  border-radius: 14px;
}

.profile-avatar-group {
  margin-bottom: 18px;
}

.profile-avatar-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.profile-avatar-preview-wrap {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-avatar-placeholder {
  font-size: 28px;
  color: var(--text-secondary);
  opacity: 0.75;
}

.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-avatar-input {
  display: none;
}

.profile-sections {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
}

.profile-modal-content .modal-body {
  padding: 14px 16px;
}

.profile-modal-content .form-group {
  margin-bottom: 10px;
}

.profile-modal-content .form-label {
  margin-bottom: 4px;
  font-size: 13px;
}

.profile-modal-content .form-input,
.profile-modal-content .form-textarea {
  font-size: 14px;
  padding: 8px 10px;
}

.profile-modal-content .form-textarea {
  min-height: 84px;
  line-height: 1.35;
}

.profile-sections-nav {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.profile-section-tab {
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.profile-section-tab.active {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border-color: var(--accent-primary);
}

.profile-section-panel {
  display: none;
  padding: 10px 12px;
}

.profile-section-panel.active {
  display: block;
}