/* CSS for .glt-exporter itself */
.glt-exporter {
  background-color: var(--grantaura-white);
  padding: var(--grantaura-spacing-md) var(--grantaura-spacing-sm);
  border-radius: var(--grantaura-border-radius-xl);
  border: 1px solid var(--grantaura-gray-200);
  box-shadow: var(--grantaura-box-shadow-xl);
  margin-bottom: var(--grantaura-spacing-lg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.glt-exporter .glt-exporter__title {
  font-size: 2.2rem;
  color: var(--grantaura-primary-dark);
  margin-bottom: var(--grantaura-spacing-sm);
  padding-bottom: var(--grantaura-spacing-sm);
  text-align: center;
  font-weight: 700;
  border-bottom: 1px solid var(--grantaura-gray-300);
  margin-bottom: var(--grantaura-spacing-lg);
}

.glt-exporter .glt-exporter__controls {
  display: flex;
  flex-direction: column;
  gap: var(--grantaura-spacing-md);
  margin-bottom: var(--grantaura-spacing-lg);
  align-items: center;
  padding: var(--grantaura-spacing-md);
  background-color: var(--grantaura-gray-50);
  border-radius: var(--grantaura-border-radius-lg);
}

.glt-exporter .glt-exporter__sort-group {
  display: flex;
  align-items: center;
  gap: var(--grantaura-spacing-sm);
  width: 100%;
  max-width: 400px;
}

.glt-exporter .glt-exporter__sort-label {
  font-size: 0.95rem;
  color: var(--grantaura-text-dark);
  font-weight: 500;
}

.glt-exporter .glt-exporter__sort-select {
  flex-grow: 1;
  padding: var(--grantaura-spacing-sm) !important;
  padding-right: calc(var(--grantaura-spacing-sm) * 2 + 1em) !important;
  border: 1px solid var(--grantaura-gray-300) !important;
  border-radius: var(--grantaura-border-radius) !important;
  background-color: var(--grantaura-white) !important;
  color: var(--grantaura-text-dark) !important;
  font-size: 0.95rem !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%20viewBox%3D%220%200%20292.4%20292.4%22%3E%3Cpath%20fill%3D%22%236B7280%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E') !important;
  background-repeat: no-repeat !important;
  background-position: right var(--grantaura-spacing-sm) center !important;
  background-size: 0.8em auto !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glt-exporter .glt-exporter__sort-select:focus {
  border-color: var(--grantaura-primary) !important;
  box-shadow: 0 0 0 3px hsla(var(--grantaura-primary-hsl), 0.25) !important;
  outline: none !important;
}

.glt-exporter .glt-exporter__copy-btn {
  padding: var(--grantaura-spacing-sm) var(--grantaura-spacing-lg) !important;
  background-color: var(--grantaura-primary) !important;
  color: var(--grantaura-white) !important;
  border: none !important;
  border-radius: var(--grantaura-border-radius) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: var(--grantaura-spacing-sm) !important;
  box-shadow: var(--grantaura-box-shadow-sm);
}

.glt-exporter .glt-exporter__copy-btn:hover {
  background-color: var(--grantaura-primary-dark) !important;
  transform: translateY(-2px);
  box-shadow: var(--grantaura-box-shadow);
}

.glt-exporter .glt-exporter__copy-btn:active {
  transform: translateY(0px);
  box-shadow: var(--grantaura-box-shadow-sm);
}

.glt-exporter .glt-exporter__copy-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--grantaura-white) !important;
}

.glt-exporter .glt-exporter__copy-feedback {
  font-size: 0.9rem;
  color: var(--grantaura-success);
  background-color: hsla(var(--grantaura-success-hsl), 0.1);
  border: 1px solid hsla(var(--grantaura-success-hsl), 0.2);
  padding: var(--grantaura-spacing-xs) var(--grantaura-spacing-sm);
  border-radius: var(--grantaura-border-radius-sm);
  margin-left: var(--grantaura-spacing-sm);
  min-height: 1.5em;
  display: inline-block;
  vertical-align: middle;
}

.glt-exporter .glt-exporter__list-container {
  overflow-x: auto;
}

.glt-exporter .glt-exporter__table {
  width: 100%;
  border-collapse: collapse;
}

.glt-exporter .glt-exporter__table-header {
  display: none;
  background-color: var(--grantaura-primary-dark);
  color: var(--grantaura-white);
  font-weight: 600;
  border-radius: var(--grantaura-border-radius-sm) var(--grantaura-border-radius-sm) 0 0;
}

.glt-exporter .glt-exporter__header-cell {
  padding: var(--grantaura-spacing-sm) var(--grantaura-spacing-md);
  text-align: left;
}

.glt-exporter .glt-exporter__table-row {
  background-color: var(--grantaura-white);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  display: block;
  margin-bottom: var(--grantaura-spacing-md);
  padding: var(--grantaura-spacing-md);
  border: 1px solid var(--grantaura-gray-200);
  border-radius: var(--grantaura-border-radius-lg);
  box-shadow: var(--grantaura-box-shadow);
  border-left-width: 5px;
  border-left-style: solid;
}

.glt-exporter__table-row--status-active { border-left-color: var(--grantaura-success) !important; }
.glt-exporter__table-row--status-ongoing { border-left-color: var(--grantaura-primary-light) !important; }
.glt-exporter__table-row--status-expired,
.glt-exporter__table-row--status-expired_with_notice,
.glt-exporter__table-row--status-expired_no_notice {
  border-left-color: var(--grantaura-danger) !important;
  opacity: 0.8;
}

.glt-exporter .glt-exporter__table-cell {
  display: block;
  margin-bottom: var(--grantaura-spacing-sm);
  padding: var(--grantaura-spacing-xs) 0;
}

.glt-exporter .glt-exporter__table-cell:last-child {
  margin-bottom: 0;
}

.glt-exporter .glt-exporter__mobile-label {
  font-weight: 600;
  color: var(--grantaura-text-light);
  margin-right: var(--grantaura-spacing-xs);
  display: block;
  font-size: 0.85rem;
  margin-bottom: var(--grantaura-spacing-xs);
}

.glt-exporter .glt-exporter__table-cell--title span:not(.glt-exporter__mobile-label) {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--grantaura-text-dark);
}

.glt-exporter .glt-exporter__table-cell--deadline span:not(.glt-exporter__mobile-label) {
  font-style: normal;
  font-weight: 500;
  color: var(--grantaura-text-light);
}

.glt-exporter .glt-exporter__table-row--status-active .glt-exporter__table-cell--deadline span:not(.glt-exporter__mobile-label) {
  color: var(--grantaura-success) !important;
}

.glt-exporter .glt-exporter__table-row--status-ongoing .glt-exporter__table-cell--deadline span:not(.glt-exporter__mobile-label) {
  color: var(--grantaura-primary-light) !important;
}

.glt-exporter .glt-exporter__table-row--status-expired .glt-exporter__table-cell--deadline span:not(.glt-exporter__mobile-label),
.glt-exporter .glt-exporter__table-row--status-expired_with_notice .glt-exporter__table-cell--deadline span:not(.glt-exporter__mobile-label),
.glt-exporter .glt-exporter__table-row--status-expired_no_notice .glt-exporter__table-cell--deadline span:not(.glt-exporter__mobile-label) {
  color: var(--grantaura-danger) !important;
}

.glt-exporter .glt-exporter__grant-link {
  color: var(--grantaura-primary) !important;
  text-decoration: none !important;
  word-break: break-all;
  font-weight: 500;
}

.glt-exporter .glt-exporter__grant-link:hover {
  text-decoration: underline !important;
  color: var(--grantaura-primary-dark) !important;
}

.glt-exporter .glt-exporter__loading,
.glt-exporter .glt-exporter__no-grants {
  text-align: center;
  padding: var(--grantaura-spacing-lg);
  color: var(--grantaura-text-light);
  font-size: 1.1rem;
  background-color: var(--grantaura-gray-50);
  border-radius: var(--grantaura-border-radius);
  margin-top: var(--grantaura-spacing-md);
}

@media (min-width: 768px) {
  .glt-exporter {
    padding: var(--grantaura-spacing-lg) var(--grantaura-spacing-md);
  }

  .glt-exporter .glt-exporter__controls {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: var(--grantaura-spacing-md) var(--grantaura-spacing-lg);
  }

  .glt-exporter .glt-exporter__sort-group {
    width: auto;
    max-width: none;
  }

  .glt-exporter .glt-exporter__table-header {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 3fr;
    gap: var(--grantaura-spacing-sm);
    padding: 0;
  }

  .glt-exporter .glt-exporter__table-row {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 3fr;
    gap: var(--grantaura-spacing-sm);
    margin-bottom: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--grantaura-gray-200);
    box-shadow: none;
    border-left: none;
    opacity: 1;
  }

  .glt-exporter .glt-exporter__table-row:last-child {
    border-bottom: none;
  }

  .glt-exporter .glt-exporter__table-row:nth-child(even) {
    background-color: var(--grantaura-gray-50);
  }

  .glt-exporter .glt-exporter__table-row:hover {
    background-color: var(--grantaura-gray-100);
    box-shadow: none;
  }

  .glt-exporter .glt-exporter__table-cell {
    display: flex;
    align-items: center;
    padding: var(--grantaura-spacing-sm) var(--grantaura-spacing-md);
    margin-bottom: 0;
    border-bottom: none;
  }

  .glt-exporter .glt-exporter__mobile-label {
    display: none !important;
  }

  .glt-exporter .glt-exporter__table-cell--title span:not(.glt-exporter__mobile-label) {
    font-size: 1rem;
  }
}

@media (max-width: 767px) {
  .glt-exporter .glt-exporter__table-row:hover {
    box-shadow: var(--grantaura-box-shadow-lg);
  }
}
