/* PaperTale - Component Styles */

/* Item Card Component */
.item-card {
  margin-bottom: 1rem;
  transition: transform 0.2s;
}

.item-card:hover {
  transform: translateY(-2px);
}

.item-card .card-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.item-card .item-id {
  color: #6c757d;
  font-size: 0.875rem;
  font-family: monospace;
}

.item-card .item-meta {
  font-size: 0.875rem;
  color: #6c757d;
}

/* Project Card Component */
.project-card {
  height: 100%;
  transition: transform 0.2s;
}

.project-card:hover {
  transform: translateY(-2px);
}

.project-card .project-name {
  font-family: monospace;
  color: #6c757d;
  font-size: 0.875rem;
}

.project-card .badge {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* Metadata Panel Component */
.metadata-panel dt {
  font-weight: 600;
  color: #6c757d;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metadata-panel dd {
  margin-bottom: 1rem;
}

.metadata-panel .badge {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* History Timeline Component */
.history-timeline {
  position: relative;
  padding-left: 2rem;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #dee2e6;
}

.history-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.history-item::before {
  content: '';
  position: absolute;
  left: -1.625rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background-color: #0d6efd;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #dee2e6;
}

.history-item:last-child {
  padding-bottom: 0;
}

.history-item .history-message {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.history-item .history-date {
  font-size: 0.75rem;
  color: #6c757d;
}

.history-item .history-author {
  font-size: 0.75rem;
  color: #6c757d;
}

/* Link List Component */
.link-list {
  list-style: none;
  padding-left: 0;
}

.link-list-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #dee2e6;
}

.link-list-item:last-child {
  border-bottom: none;
}

.link-list-item .link-type {
  font-size: 0.75rem;
  color: #6c757d;
  margin-right: 0.5rem;
  min-width: 80px;
}

.link-list-item a {
  text-decoration: none;
  color: #0d6efd;
}

.link-list-item a:hover {
  text-decoration: underline;
}

/* Filter Sidebar Component */
.filter-sidebar {
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  padding: 1rem;
}

.filter-sidebar .filter-group {
  margin-bottom: 1.5rem;
}

.filter-sidebar .filter-group:last-child {
  margin-bottom: 0;
}

.filter-sidebar .filter-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.filter-sidebar .form-select,
.filter-sidebar .form-control {
  font-size: 0.875rem;
}

.filter-sidebar .btn-clear {
  width: 100%;
  margin-top: 1rem;
}

/* Item Table Component */
.item-table {
  font-size: 0.875rem;
}

.item-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: #6c757d;
}

.item-table .item-id-col {
  font-family: monospace;
  color: #6c757d;
  min-width: 100px;
}

.item-table .item-type-col {
  min-width: 80px;
}

.item-table .item-title-col {
  font-weight: 500;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h5 {
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* Search Box */
.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
}

.search-box input {
  padding-left: 2.5rem;
}

/* Bulk Actions Toolbar */
.bulk-actions-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #0d6efd;
  color: white;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.bulk-actions-toolbar .btn-group {
  gap: 0.5rem;
}

.item-checkbox {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

#select-all-checkbox {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .filter-sidebar {
    margin-bottom: 1rem;
  }

  .history-timeline {
    padding-left: 1.5rem;
  }

  .history-timeline::before {
    left: 0.375rem;
  }

  .history-item::before {
    left: -1.25rem;
  }
}

/* Dark Mode Overrides */
[data-theme="dark"] .item-card .item-id,
[data-theme="dark"] .item-card .item-meta {
  color: var(--text-secondary);
}

[data-theme="dark"] .project-card .project-name {
  color: var(--text-secondary);
}

[data-theme="dark"] .metadata-panel dt {
  color: var(--text-secondary);
}

[data-theme="dark"] .history-timeline::before {
  background-color: var(--border-color);
}

[data-theme="dark"] .history-item::before {
  border-color: var(--bg-primary);
  box-shadow: 0 0 0 2px var(--border-color);
}

[data-theme="dark"] .history-item .history-date,
[data-theme="dark"] .history-item .history-author {
  color: var(--text-secondary);
}

[data-theme="dark"] .link-list-item {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .link-list-item .link-type {
  color: var(--text-secondary);
}

[data-theme="dark"] .link-list-item a {
  color: var(--bs-link-color);
}

[data-theme="dark"] .filter-sidebar {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .filter-sidebar .filter-label {
  color: var(--text-secondary);
}

[data-theme="dark"] .item-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .item-table .item-id-col {
  color: var(--text-secondary);
}

[data-theme="dark"] .empty-state {
  color: var(--text-secondary);
}

[data-theme="dark"] .search-box i {
  color: var(--text-secondary);
}

[data-theme="dark"] .bulk-actions-toolbar {
  background-color: #0a58ca;
  border: 1px solid var(--border-color);
}

/* Keyboard Shortcuts Help */
.keyboard-shortcuts-help {
  max-height: 70vh;
  overflow-y: auto;
}

.keyboard-shortcut-key {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-family: monospace;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .keyboard-shortcut-key {
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.shortcut-category h6 {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}
