/* DMS Custom Styles */

/* Document tiles */
.document-tile {
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
  position: relative;
}

.document-tile:hover {
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.tile-page-count {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 1;
}

.tile-thumbnail {
  height: 180px;
  overflow: hidden;
  background: #f8f8f8;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4px;
}

.tile-thumbnail img {
  width: auto;
  height: 100%;
  object-fit: contain;
  border: 1px solid #e0e0e0;
}

.tile-placeholder {
  color: #ccc;
  font-size: 3rem;
}

.tile-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-badge {
  font-size: 0.65rem;
}

.tile-age {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .row-cols-xl-5 > * {
    flex: 0 0 auto;
    width: 185px;
  }
}

.document-card {
  transition: box-shadow 0.2s;
}

.document-card:hover {
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.stage-badge-inbox {
  background-color: #0d6efd;
}

.stage-badge-sendbox {
  background-color: #ffc107;
  color: #000;
}

.stage-badge-archive {
  background-color: #198754;
}

.ocr-pending {
  opacity: 0.7;
}

.message-bubble {
  background-color: #f8f9fa;
  border-left: 3px solid #0d6efd;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 0 0.25rem 0.25rem 0;
}

.message-bubble .author {
  font-weight: 600;
  font-size: 0.875rem;
}

.message-bubble .timestamp {
  font-size: 0.75rem;
  color: #6c757d;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.category-filter .btn {
  font-size: 0.875rem;
}

.import-channel-badge {
  font-size: 0.7rem;
}

/* Detail page metadata */
.detail-meta dt,
.detail-meta dd {
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.detail-meta dt {
  color: #6c757d;
  font-weight: 600;
}

#search-results {
  position: relative;
}

#search-results .list-group {
  position: absolute;
  top: 0;
  right: 0;
  width: 400px;
  z-index: 1050;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
