/* TableGrid Component Styles */

/* Search Container */
.table-search-container {
  margin-bottom: 1rem;
}

.table-search-container .field {
  margin-bottom: 0;
}

/* Header Controls */
.table-header-controls {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: var(--tablegrid-bg-secondary, var(--bulma-body-background-color, #fafafa));
  border-radius: 6px;
  border: 1px solid var(--tablegrid-border, var(--bulma-border, #dbdbdb));
}

.table-header-controls .level {
  margin-bottom: 0;
}

.table-header-controls .level-left .field {
  margin-bottom: 0;
}

/* Copy to Clipboard */
.copy-to-clipboard {
  transition: all 0.3s ease;
}

.copy-to-clipboard:hover {
  transform: scale(1.05);
}

/* Table Field Addons */
.table .field.has-addons {
  margin-bottom: 0;
}

.table .field.has-addons .control .input {
  border-radius: 4px 0 0 4px;
}

.table .field.has-addons .control:last-child .button {
  border-radius: 0 4px 4px 0;
}

/* Sortable Columns */
.table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 2rem;
}

.table th.sortable:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.table th.sortable .sort-indicator {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 0.8rem;
}

.table th.sortable.sorted-asc .sort-indicator::before {
  content: "▲";
  opacity: 1;
}

.table th.sortable.sorted-desc .sort-indicator::before {
  content: "▼";
  opacity: 1;
}

.table th.sortable:not(.sorted-asc):not(.sorted-desc) .sort-indicator::before {
  content: "⇅";
}

/* Pagination */
.pagination-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.pagination-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme-aware Tag Styles */
.tag.is-light {
    background-color: var(--tablegrid-bg-secondary, #f5f5f5) !important;
    color: var(--tablegrid-text, #363636) !important;
}

[data-theme=dark] .tag.is-light,
.theme-dark .tag.is-light {
    background-color: var(--tablegrid-bg-secondary, #2a2a2a) !important;
    color: var(--tablegrid-text, #e0e0e0) !important;
}

@media (prefers-color-scheme: dark) {
    .tag.is-light {
        background-color: var(--tablegrid-bg-secondary, #2a2a2a) !important;
        color: var(--tablegrid-text, #e0e0e0) !important;
    }
}

/* Table Images */
.table-img {
  width: 80px !important;
  height: auto !important;
}

/* Currency Column Formatting */
.column-currency {
  font-size: x-small;
  font-weight: 700;
}

.column-currency-amount {
    text-align: right;
    display: inline-block;
    width: 60px !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .table-header-controls .level {
    display: block;
  }
  
  .table-header-controls .level-left,
  .table-header-controls .level-right {
    margin-bottom: 0.75rem;
  }
  
  .table-header-controls .level-right {
    justify-content: center;
  }
  
  .pagination-info {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .pagination-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
}
