/* docs/css/resources_poc.css */

/* Suggest Resource Button */
.suggest-resource-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #1976d2;
  color: white !important;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background-color 0.2s ease;
}

.suggest-resource-button:hover {
  background-color: #1565c0;
  text-decoration: none;
}

/* Suggest Resource Section */
.suggest-resource-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e0e0e0;
  text-align: center;
}

.suggest-resource-section h2 {
  margin-bottom: 0.5rem;
}

.suggest-resource-section p {
  color: #616161;
  margin-bottom: 1.5rem;
}

.form-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.form-container iframe {
  max-width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

/* Filter Container */
#resource-filters {
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Filter rows */
.filter-row-badges {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.filter-row-dropdowns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.filter-row-search {
  margin-bottom: 0.875rem;
}

.filter-section {
  flex: 1;
  min-width: 0;
}

.filter-section-search {
  width: 100%;
}

#resource-filters label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #424242;
  margin-bottom: 0.375rem;
}

/* Info tooltip */
.info-tooltip-wrapper {
  position: relative;
  display: inline-block;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background-color: #1976d2;
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: help;
  transition: background-color 0.2s ease;
}

.info-tooltip-wrapper:hover .info-icon {
  background-color: #1565c0;
}

.info-tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: #424242;
  color: white;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.info-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #424242;
}

.info-tooltip-wrapper:hover .info-tooltip-content {
  opacity: 1;
  visibility: visible;
}

.tooltip-link {
  display: inline-block;
  margin-left: 0.5rem;
  color: #64b5f6;
  text-decoration: underline;
  font-weight: 500;
}

.tooltip-link:hover {
  color: #90caf9;
}

#resource-filters select,
#resource-filters input[type="text"] {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  font-size: 0.8125rem;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#resource-filters select:focus,
#resource-filters input[type="text"]:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Filter Summary */
.filter-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #616161;
}

#results-count {
  display: inline-block;
}

#results-count strong {
  color: #212121;
  font-weight: 600;
}

.filter-indicator {
  color: #1976d2;
}

#clear-filters {
  display: none;
  background: none;
  border: none;
  color: #1976d2;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  transition: color 0.2s;
}

#clear-filters:hover {
  color: #1565c0;
  text-decoration: underline;
}

/* Resource Cards Grid */
#resource-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: start;
}

/* Individual Card */
.resource-card {
  display: flex;
  flex-direction: column;
  border-left: 3px solid;
  border-radius: 6px;
  padding: 0.875rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.625rem;
  gap: 0.5rem;
}

.card-header-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.card-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-description {
  color: #424242;
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.resource-card:hover .card-description {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.375rem;
}

.mim-badges-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: flex-start;
  justify-content: flex-end;
  align-content: flex-start;
  flex-shrink: 0;
  max-width: 200px;
}

.mim-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.mim-badge.clickable {
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}

.mim-badge.clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* MIM Filter Checkboxes */
.mim-filter-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.375rem;
}

/* Layer Filter Checkboxes - 2-Column Layout */
.layer-filter-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
}

.layer-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  width: fit-content;
}

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

.layer-checkbox-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s, border 0.2s;
  opacity: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* When any layer is selected, dim unselected ones */
.layer-filter-checkboxes.has-selection .layer-checkbox-badge {
  opacity: 0.4;
}

.layer-filter-checkboxes.has-selection .layer-checkbox-label input:checked + .layer-checkbox-badge {
  opacity: 1;
  border-color: var(--border-color);
}

.layer-checkbox-label:hover .layer-checkbox-badge {
  transform: scale(1.02);
}

.mim-checkbox-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

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

.mim-checkbox-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  opacity: 1;
  border: 2px solid transparent;
}

/* When any MIM is selected, dim unselected ones */
.mim-filter-checkboxes.has-selection .mim-checkbox-badge {
  opacity: 0.4;
}

.mim-filter-checkboxes.has-selection .mim-checkbox-label input:checked + .mim-checkbox-badge {
  opacity: 1;
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* MIM Tooltip */
.mim-tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.mim-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background-color: #2c2c2c;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mim-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2c2c2c;
}

.mim-tooltip-wrapper:hover .mim-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Card Content */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0;
}

.resource-card:hover .card-content {
  max-height: 500px;
  opacity: 1;
  padding-top: 0.625rem;
}


.card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-row {
  display: flex;
  align-items: center;
  font-size: 0.6875rem;
  gap: 0.375rem;
}

.meta-label {
  font-weight: 600;
  color: #616161;
}

.meta-value {
  color: #424242;
}

.type-value {
  text-transform: capitalize;
}

.category-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.625rem;
  border: 1px solid transparent;
}

.category-badge.clickable {
  transition: transform 0.1s, box-shadow 0.2s, border 0.2s;
}

.category-badge.clickable.selected {
  border-color: var(--border-color);
}

.category-badge.clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.grey-badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.625rem;
}

/* Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.resource-tag {
  display: inline-block;
  padding: 0.15rem 0.375rem;
  background-color: #e0e0e0;
  color: #424242;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 500;
}

/* Card Footer */
.card-footer {
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.resource-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.4rem 0.625rem;
  background-color: #1976d2;
  color: white !important;
  text-decoration: none !important;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  transition: background-color 0.2s, transform 0.1s;
  text-align: center;
}

.resource-button:hover {
  background-color: #1565c0;
  transform: scale(1.02);
}

.resource-button:active {
  transform: scale(0.98);
}

.resource-button-secondary {
  background-color: #757575;
  margin-top: 0.375rem;
}

.resource-button-secondary:hover {
  background-color: #616161;
}

.button-icon {
  width: 16px;
  height: 16px;
}

/* No Results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.no-results-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: #bdbdbd;
}

.no-results h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #212121;
}

.no-results p {
  margin: 0 0 1rem;
  color: #616161;
  font-size: 0.875rem;
}

.error-message {
  color: #d32f2f;
  text-align: center;
  padding: 2rem;
  background-color: #ffebee;
  border-radius: 8px;
  border: 1px solid #ffcdd2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #resource-cards {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header-left {
    width: 100%;
  }

  .mim-badges-container {
    align-self: flex-start;
  }
}

/* Print styles */
@media print {
  #resource-filters {
    display: none;
  }

  .resource-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .resource-button {
    display: none;
  }
}