/* Comparable Transactions Panel Styles */

.comp-txn-panel {
  margin-top: 2rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  overflow: hidden;
}

.comp-txn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--charcoal);
  color: var(--white);
  cursor: pointer;
  user-select: none;
}

.comp-txn-header:hover {
  background: #2d2d2d;
}

.comp-txn-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0;
}

.comp-txn-badge {
  background: var(--copper);
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 10px;
}

.comp-txn-toggle {
  font-size: 1.25rem;
  transition: transform .3s;
}

.comp-txn-panel.expanded .comp-txn-toggle {
  transform: rotate(180deg);
}

.comp-txn-body {
  display: none;
  padding: 1.5rem;
}

.comp-txn-panel.expanded .comp-txn-body {
  display: block;
}

/* Filters */
.comp-txn-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--off-white);
  border-radius: 8px;
}

.comp-txn-filter-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.comp-txn-filter-group label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
}

.comp-txn-filter-group select,
.comp-txn-filter-group input {
  padding: .5rem .75rem;
  border: 1px solid var(--light-border);
  border-radius: 6px;
  font-size: .85rem;
  background: var(--white);
}

.comp-txn-filter-group select:focus,
.comp-txn-filter-group input:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 2px rgba(154,98,52,.15);
}

.comp-txn-search {
  grid-column: span 2;
}

/* Statistics */
.comp-txn-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comp-txn-stat {
  background: var(--off-white);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.comp-txn-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--copper);
}

.comp-txn-stat-label {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: .25rem;
}

/* Table */
.comp-txn-table-container {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--light-border);
  border-radius: 8px;
}

.comp-txn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.comp-txn-table thead {
  background: var(--charcoal);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1;
}

.comp-txn-table th {
  padding: .75rem .5rem;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.comp-txn-table th:hover {
  background: #2d2d2d;
}

.comp-txn-table th.sorted-asc::after {
  content: ' \25B2';
  font-size: .65rem;
}

.comp-txn-table th.sorted-desc::after {
  content: ' \25BC';
  font-size: .65rem;
}

.comp-txn-table td {
  padding: .65rem .5rem;
  border-bottom: 1px solid var(--light-border);
}

.comp-txn-table tbody tr:hover {
  background: rgba(154,98,52,.05);
}

.comp-txn-table tbody tr.highlighted {
  background: rgba(154,98,52,.12);
}

.comp-txn-table tbody tr.selected {
  background: rgba(34,197,94,.1);
}

.comp-txn-table tbody tr.selected td:first-child {
  border-left: 3px solid var(--success);
}

.comp-txn-table input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Stage Badges */
.comp-txn-stage {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 500;
}

.comp-txn-stage.exploration {
  background: #FEF3C7;
  color: #92400E;
}

.comp-txn-stage.development {
  background: #DBEAFE;
  color: #1E40AF;
}

.comp-txn-stage.production {
  background: #D1FAE5;
  color: #065F46;
}

.comp-txn-stage.scoping {
  background: #F3E8FF;
  color: #6B21A8;
}

.comp-txn-stage.pfs {
  background: #E0E7FF;
  color: #3730A3;
}

.comp-txn-stage.dfs {
  background: #CFFAFE;
  color: #0E7490;
}

/* Selection Summary */
.comp-txn-selection-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--charcoal);
  color: var(--white);
  border-radius: 8px;
  margin-top: 1rem;
}

.comp-txn-selection-info {
  font-size: .9rem;
}

.comp-txn-selection-actions {
  display: flex;
  gap: .75rem;
}

.comp-txn-selection-btn {
  padding: .5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.3);
}

.comp-txn-selection-btn:hover {
  background: rgba(255,255,255,.1);
}

.comp-txn-selection-btn.primary {
  background: var(--copper);
  border-color: var(--copper);
}

.comp-txn-selection-btn.primary:hover {
  background: var(--copper-dark);
}

/* Used Transactions Display */
.comp-txn-used {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(154,98,52,.05);
  border: 1px solid rgba(154,98,52,.2);
  border-radius: 8px;
}

.comp-txn-used h5 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: .75rem;
}

.comp-txn-used-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.comp-txn-used-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem;
  background: var(--white);
  border-radius: 4px;
  font-size: .8rem;
}

.comp-txn-used-item .project {
  font-weight: 500;
}

.comp-txn-used-item .multiple {
  color: var(--copper);
  font-weight: 600;
}

/* No Results Message */
.comp-txn-no-results {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: .9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .comp-txn-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .comp-txn-search {
    grid-column: span 1;
  }

  .comp-txn-selection-summary {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
