/* ───── MUN Specific Overrides ───── */
.mun-wrapper {
  padding-top: 100px;
}

.mun-card {
  max-width: 800px;
}

.selection-status {
  display: inline-block;
  margin-top: 16px;
  background: rgba(139, 26, 26, 0.15);
  border: 1px solid var(--border-color);
  padding: 8px 24px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.selection-status.complete {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

/* ───── Portfolio Search ───── */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.search-wrapper .search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-dimmed);
  pointer-events: none;
  transition: color 0.3s ease;
}

.search-wrapper input:focus ~ .search-icon,
.search-wrapper:focus-within .search-icon {
  color: var(--accent);
}

#portfolio-search {
  width: 100%;
  padding: 14px 80px 14px 44px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  outline: none;
  transition: all 0.3s ease;
}

#portfolio-search::placeholder {
  color: var(--text-dimmed);
  font-weight: 300;
}

#portfolio-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(139, 26, 26, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.search-count {
  position: absolute;
  right: 14px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-dimmed);
  letter-spacing: 0.05em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-count.visible {
  opacity: 1;
}

/* Highlighted match text */
.portfolio-name mark {
  background: rgba(139, 26, 26, 0.35);
  color: #fff;
  border-radius: 2px;
}

/* No results message */
.no-results {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dimmed);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: italic;
}

/* ───── Committees Grid ───── */
.committees-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.committee-group {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.committee-group.has-selection {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(139, 26, 26, 0.1);
}

.committee-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.3s;
}

.committee-header:hover {
  background: rgba(139, 26, 26, 0.05);
}

.committee-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-badge {
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  display: none;
}

.committee-group.has-selection .selected-badge {
  display: inline-block;
}

.search-match-count {
  font-family: var(--font-body);
  font-size: 0.65rem;
  background: rgba(139, 26, 26, 0.25);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.05em;
}

.expand-icon {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.committee-group.expanded .expand-icon {
  transform: rotate(180deg);
}

/* ───── Portfolio List ───── */
.portfolio-list {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.committee-group.expanded .portfolio-list {
  display: grid;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ───── Portfolio Item ───── */
.portfolio-item {
  position: relative;
}

.portfolio-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.portfolio-item label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--input-border);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.portfolio-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portfolio-name {
  font-weight: 500;
  color: #fff;
}

.portfolio-details {
  display: flex;
  flex-direction: column;
  font-size: 0.7rem;
  opacity: 0.8;
}

.portfolio-position {
  color: var(--accent);
  font-style: italic;
}

.portfolio-party {
  color: var(--text-dimmed);
  font-weight: 300;
}

.portfolio-item:not(.taken) label:hover {
  background: rgba(139, 26, 26, 0.1);
  border-color: var(--accent);
  color: #fff;
}

.portfolio-item input:checked + label {
  background: rgba(139, 26, 26, 0.2);
  border-style: solid;
  border-color: var(--accent);
  color: #fff;
}

/* Taken status */
.portfolio-item.taken label {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

.status-indicator {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border-radius: 12px;
}

.status-available {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.status-taken {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ───── Responsive ───── */
@media (max-width: 640px) {
  .portfolio-list {
    grid-template-columns: 1fr;
  }
}
