/*
 * This code is for navbar
 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  margin-bottom: 1rem;
  background-color: #c9c8c8;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: #333;
}

.navbar-menu {
  margin-left: auto;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.nav-item a {
  text-decoration: none;
  color: #666;
  font-size: 1rem;
  padding: 0.5rem;
  transition: color 0.3s ease;
}

.language-selector {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.flag-button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0.2rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.flag-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.flag-button img {
  width: 25px;
  height: 17px;
  /* Adjust flag size for better fit */
}

.nav-item a:hover {
  color: #333;
  cursor: pointer;
}

#logout:hover {
  cursor: pointer;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 1rem;
  }

  .navbar-brand {
    margin-bottom: 1rem;
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

/*
 *  Index page 
*/
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  background-color: #ffffff;
}
.container {
  padding: 0 auto;
}
.hero {
  background-color: #f5f7d5;
  padding: 40px;
  border-radius: 8px;
  margin-bottom: 30px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}
.feature-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.metrics {
  background: #e9ecef;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}
.workflow {
  margin: 30px 0;
}
.workflow-step {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-left: 4px solid #007bff;
}

/*
 * This code is for registration form
 *
 * This section of the code handles the user registration form.
 * It includes input fields for user details such as username, email, and password.
 * It also includes validation rules to ensure that the user inputs are correct.
 * Additionally, it may contain styles for the form layout and design.
 */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  padding: 10px;
}

.login-container *,
.login-container *::before,
.login-container *::after {
  box-sizing: border-box;
}

.form-input,
.login-btn,
.social-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.form-group,
.social-login {
  width: 100%;
}

.login-box {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 480px;
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 1.5rem;
}

.success {
  color: green;
  transition: all ease-in 0.5s;
}

.error {
  color: red;
  transition: all ease-in 0.3s;
}

.social-signup {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: background 0.3s ease;
}

.social-btn:hover {
  background: #f5f5f5;
}

.divider {
  text-align: center;
  position: relative;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: #e0e0e0;
}

.divider::before {
  left: 0;
}
.divider::after {
  right: 0;
}

.form-field {
  margin-bottom: 1rem;
}

input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input:focus {
  border-color: #2196f3;
  outline: none;
}

.password-field {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
}

.submit-btn {
  width: 100%;
  padding: 0.75rem;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.submit-btn:hover {
  background: #1976d2;
}

.terms,
.login-link {
  text-align: center;
  font-size: 0.875rem;
  color: #666;
  margin-top: 1rem;
}

.error-message {
  color: #f44336;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

h1 {
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.social-btn:hover {
  background: #f8f8f8;
  transform: translateY(-1px);
}

.social-btn.dragados {
  color: #f8dc0b;
  background-color: #2196f3;
}

.divider {
  text-align: center;
  position: relative;
  margin: 1.5rem 0;
}

.divider::before,
.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: #e0e0e0;
}

.divider::before {
  left: 0;
}
.divider::after {
  right: 0;
}

.divider span {
  background: white;
  padding: 0 10px;
  color: #666;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.form-input {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
  outline: none;
}

.error-message {
  color: #f44336;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
}

.forgot-password {
  color: #2196f3;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #1976d2;
}

.login-btn {
  width: 100%;
  padding: 0.75rem;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.login-btn:hover {
  background: #1976d2;
  transform: translateY(-1px);
}

.signup-link {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: #666;
}

.signup-link a {
  color: #2196f3;
  text-decoration: none;
  font-weight: 500;
}

.signup-link a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .login-box {
    padding: 1.5rem;
  }

  .social-btn {
    font-size: 0.9rem;
  }
}

/*
* Buscador
*/
.search-container {
  width: "100%";
  padding: 2rem;
}

.form-grid {
  display: flex;
  flex-direction: column;
}

.button-container {
  margin-top: 1rem;
  display: flex;
  flex: 1;
  flex-direction: row;
}

.button-container.search {
  justify-content: space-between;
  gap: 2rem;
}

textarea,
select {
  width: 100%;
  padding: 0.5rem;
  margin: 0.25rem 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  resize: none;
}

textarea:focus {
  border-color: #2196f3;
  outline: none;
}

.similarity-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.form-range {
  height: 8px;
  background: #d3d3d3;
  border-radius: 4px;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #4caf50;
  border-radius: 50%;
  cursor: pointer;
}

#similarityValue {
  min-width: 3rem;
}

button {
  background: #007bff;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
  width: 40%;
}

button:hover {
  opacity: 0.9;
}

.clear-btn:hover {
  background: #ff5a6a;
}

.results {
  margin-top: 2rem;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.partida-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.similarity-score {
  float: right;
  color: #666;
  font-size: 0.9em;
}

/* Spinner */
.spinner {
  border: 16px solid #f3f3f3; /* Light grey */
  border-top: 16px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Hide button text during request */
.htmx-request .button-text {
  display: none;
}

/* Ensure spinner is visible */
.htmx-request .spinner {
  display: inline-block;
}

.htmx-indicator {
  opacity: 0;
  transition: opacity 500ms ease-in;
}

.htmx-request .htmx-indicator {
  opacity: 1;
}

/* Toggle switch styles */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #2196f3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* POPUP DE VALIDACION EXITOSA */
.popup-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 10000 !important;
}

.popup-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.popup-content button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Add row */

.delete-btn {
  background: #ff5a6a;
  color: white;
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.delete-btn:hover {
  opacity: 0.9;
}

.add-row-btn {
  background: #007bff;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 1rem;
}

.add-row-btn:hover {
  opacity: 0.9;
}

.validation-question {
  font-size: medium;
  color: #333;
  font-weight: bold;
}

.button-container.validar {
  display: none;
  padding: 1rem;
  border-radius: 8px;
  background: #f5f5f5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: center;
  align-items: center;
}

.validar-btn:hover {
  background: rgb(107, 236, 107);
}

.star-rating {
  direction: rtl;
  display: inline-flex;
}

.star-rating input[type="radio"] {
  display: none;
}

.star-rating label {
  font-size: 2em;
  color: #ddd;
  cursor: pointer;
  padding: 2px; /* Adding some padding for better visual appearance of background */
}

/* Change star color when checked */
.star-rating input[type="radio"]:checked ~ label {
  color: #8f6900;
}

/* Add black background to checked star and all stars to its right */
.star-rating input[type="radio"]:checked + label,
.star-rating input[type="radio"]:checked + label ~ label {
  background-color: rgb(107, 236, 107);
}

/* Hover effects */
.star-rating label:hover,
.star-rating label:hover ~ label {
  background-color: #414141;
}

/* Focused workspace */
.workspace-header {
  margin-bottom: 1.5rem;
  max-width: 70rem;
}

.workspace-header h1,
.working-selection h2,
.review-breakdown h3 {
  margin: 0.25rem 0 0.5rem;
}

.eyebrow {
  color: #666;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field label,
.form-field small {
  display: block;
}

.form-field small {
  color: #666;
  margin-top: 0.25rem;
}

.range-row {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.range-row .form-range {
  flex: 1;
}

.working-selection {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  margin-top: 2rem;
  padding: 1rem;
}

.selection-header,
.selection-actions,
.selection-metrics {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.selection-header {
  justify-content: space-between;
}

.selection-metrics {
  color: #666;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.selection-metrics strong {
  color: #1a1a1a;
}

.selection-empty {
  background: #f8f9fa;
  border: 1px dashed #bbb;
  margin: 1rem 0;
  padding: 1rem;
}

.selection-group {
  border-top: 1px solid #e0e0e0;
  padding: 0.75rem 0;
}

.selection-group h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.selection-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.selection-group li {
  align-items: center;
  border-bottom: 1px solid #eee;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(10rem, 1fr) 4rem 6rem;
  padding: 0.5rem 0;
}

.selection-resource-description {
  min-width: 0;
  overflow-wrap: anywhere;
}

.selection-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

.selection-actions button {
  width: auto;
}

.secondary-action {
  background: #1976d2;
}

.review-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.review-table th,
.review-table td {
  border: 1px solid #ddd;
  overflow-wrap: anywhere;
  padding: 0.5rem;
  text-align: left;
  vertical-align: top;
}

.review-table th {
  background: #f5f5f5;
}

.review-table th:first-child {
  width: 34%;
}

.review-modal {
  align-items: center;
  background: rgba(26, 26, 26, 0.56);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 10000;
}

.review-dialog {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(26, 26, 26, 0.22);
  max-height: calc(100vh - 2rem);
  max-width: 68rem;
  overflow-y: auto;
  padding: 1.5rem;
  width: 100%;
}

.review-dialog-header {
  align-items: start;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.review-dialog-header h2 {
  margin: 0.25rem 0 0;
}

.review-close {
  background: #ffffff;
  border: 1px solid #007bff;
  color: #0b7dda;
  flex: 0 0 auto;
  width: auto;
}

.review-dialog-actions {
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
}

.review-dialog-actions button {
  width: auto;
}

.review-table-frame {
  max-width: 100%;
}

body.modal-open {
  overflow: hidden;
}

.export-status {
  margin-top: 1rem;
  min-height: 1.5rem;
}

.export-status.success {
  color: #166534;
}

.export-status.error {
  color: #b91c1c;
}

.export-status.pending {
  color: #555;
}

.selected-resource {
  background-color: #e3f2fd !important;
}

.popup-container[hidden] {
  display: none;
}

.popup-container:not([hidden]) {
  display: flex;
}

.popup-content {
  max-height: calc(100vh - 2rem);
  max-width: 56rem;
  overflow-y: auto;
  padding: 0;
  text-align: left;
  width: calc(100% - 2rem);
}

.popup-content > p,
.popup-content > ol,
.popup-content > div,
.popup-content > details,
.popup-content > footer {
  margin-left: 2rem;
  margin-right: 2rem;
}

.spe-popup-header {
  align-items: center;
  border-top: 0.5rem solid #4caf50;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  padding: 1.5rem 2rem 1rem;
}

.spe-popup-header h2 {
  margin: 0;
}

.spe-success-icon {
  align-items: center;
  background: #f8f9fa;
  border-radius: 50%;
  color: #4caf50;
  display: inline-flex;
  font-size: 1.5rem;
  height: 3rem;
  justify-content: center;
  width: 3rem;
}

.popup-content .spe-icon-close {
  background: transparent;
  color: #007bff;
  margin: 0;
  padding: 0.5rem;
}

.spe-next-steps {
  counter-reset: spe-step;
  list-style: none;
  padding: 0;
}

.spe-next-steps li {
  counter-increment: spe-step;
  margin: 1rem 0;
  padding-left: 3.5rem;
  position: relative;
}

.spe-next-steps li::before {
  align-items: center;
  background: #007bff;
  border-radius: 50%;
  color: #ffffff;
  content: counter(spe-step);
  display: flex;
  font-weight: 700;
  height: 2rem;
  justify-content: center;
  left: 0;
  position: absolute;
  top: -0.2rem;
  width: 2rem;
}

.spe-copy-summary {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
}

.spe-copy-summary > span {
  color: #666666;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.spe-technical-data {
  margin-top: 1rem;
}

.spe-technical-data summary {
  color: #007bff;
  cursor: pointer;
  font-weight: 700;
}

.spe-technical-data pre {
  background: #f5f5f5;
  max-height: 12rem;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.spe-recovery-note {
  color: #666666;
  font-style: italic;
}

.spe-recopy-status {
  min-height: 1.5rem;
}

.spe-recopy-status.success {
  color: #4caf50;
}

.spe-recopy-status.error {
  color: #f44336;
}

.spe-popup-actions {
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 0 1.5rem;
}

.popup-content .spe-popup-actions button {
  margin-top: 0;
  width: auto;
}

.popup-content .spe-popup-actions .review-close {
  background: #ffffff;
  border: 1px solid #007bff;
  color: #0b7dda;
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .selection-header,
  .selection-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-metrics {
    justify-content: flex-start;
  }

  .selection-actions button {
    width: 100%;
  }

  .selection-group li {
    grid-template-columns: minmax(0, 1fr) 3.5rem 5.5rem;
  }

  .review-dialog {
    padding: 1rem;
  }

  .review-dialog-actions {
    flex-direction: column;
  }

  .review-dialog-actions button {
    width: 100%;
  }

  .spe-popup-header {
    gap: 0.75rem;
    grid-template-columns: auto 1fr;
    padding: 1rem;
  }

  .spe-popup-header h2 {
    font-size: 1.25rem;
  }

  .spe-icon-close {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .popup-content > p,
  .popup-content > ol,
  .popup-content > div,
  .popup-content > details,
  .popup-content > footer {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .spe-popup-actions {
    flex-direction: column;
  }

  .popup-content .spe-popup-actions button {
    width: 100%;
  }

  .review-table th,
  .review-table td {
    font-size: 0.9rem;
    padding: 0.35rem;
  }
}

@media (max-width: 480px) {
  .review-table thead tr,
  .review-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  }

  .review-table th:first-child {
    width: auto;
  }
}

/* Task 35: adapted Option C focused workspace */
:root {
  --capei-ink: #333333;
  --capei-muted: #666666;
  --capei-paper: #ffffff;
  --capei-canvas: #f5f5f5;
  --capei-line: #e0e0e0;
  --capei-action: #007bff;
  --capei-action-deep: #0b7dda;
  --capei-brand: #f8dc0b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color: var(--capei-ink);
}

body {
  background: var(--capei-canvas);
  color: var(--capei-ink);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--capei-action);
  outline-offset: 3px;
}

.navbar {
  background: var(--capei-paper);
  border: 1px solid var(--capei-line);
  border-radius: 0;
  box-shadow: none;
  gap: 0.75rem;
  margin: 0 auto 1.5rem;
  max-width: 90rem;
}

.navbar-brand {
  color: var(--capei-action-deep);
}

.work-context-badge {
  margin-left: 1rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid #333;
  border-radius: 999px;
  color: #333;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-endorsement {
  align-items: center;
  border-left: 1px solid var(--capei-line);
  display: inline-flex;
  min-height: 2.75rem;
  padding-left: 0.75rem;
}

.brand-logo {
  display: block;
  height: auto;
  max-height: 2.5rem;
  max-width: 6.25rem;
  width: auto;
}

.nav-list {
  align-items: center;
  gap: 0.75rem;
}

.language-selector select {
  background: var(--capei-paper);
  border: 1px solid var(--capei-line);
  border-radius: 4px;
  color: var(--capei-ink);
  min-height: 2.75rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
}

.search-container {
  margin: 0 auto;
  max-width: 90rem;
  width: 100%;
}

.button-container.search {
  gap: 0.75rem;
  justify-content: flex-start;
}

.button-container.search button {
  flex: 0 1 auto;
  min-width: 12rem;
  width: auto;
}

.button-container.search .clear-btn {
  background: var(--capei-paper);
  border: 1px solid var(--capei-action);
  color: var(--capei-action-deep);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.workspace-header > p:last-child {
  max-width: 70ch;
}

.journey-progress {
  margin: 1.5rem 0;
}

.journey-progress ol {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
}

.journey-step {
  align-items: center;
  background: var(--capei-paper);
  border: 1px solid var(--capei-line);
  color: var(--capei-muted);
  display: flex;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
}

.journey-step span {
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: inline-flex;
  height: 1.6rem;
  justify-content: center;
  width: 1.6rem;
}

.journey-step.is-current {
  background: var(--capei-action-deep);
  border-color: var(--capei-action-deep);
  color: var(--capei-paper);
}

.active-search-criteria {
  align-items: start;
  background: var(--capei-paper);
  border: 1px solid var(--capei-line);
  display: grid;
  gap: 1rem 2rem;
  grid-template-columns: auto 1fr;
  margin: 1.25rem 0;
  padding: 1rem;
}

.active-search-criteria h2,
.active-search-criteria p {
  margin: 0;
}

.active-search-criteria dl {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(5, minmax(7rem, 1fr));
  margin: 0;
}

.active-search-criteria dt {
  color: var(--capei-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.active-search-criteria dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.workspace-grid {
  align-items: start;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem);
  margin-top: 1.25rem;
}

.results-column {
  min-width: 0;
}

.selection-column {
  min-width: 0;
  position: sticky;
  top: 1rem;
}

.selection-disclosure {
  background: var(--capei-paper);
  border: 1px solid var(--capei-line);
}

.selection-disclosure > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 700;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0.75rem 1rem;
}

.selection-disclosure > summary::marker {
  color: var(--capei-action);
}

.working-selection {
  border: 0;
  box-shadow: none;
  margin: 0;
}

#results .partida-card {
  background: var(--capei-paper);
  cursor: default;
}

#results .partida-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--capei-action-deep);
  display: inline-flex;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.4rem;
  text-align: left;
}

#results .partida-toggle[aria-expanded="true"] > span[aria-hidden="true"] {
  transform: rotate(180deg);
}

#results .resources-container[hidden] {
  display: none !important;
}

#results .resources-container:not([hidden]) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

#results .resources-table {
  min-width: 46rem;
}

#results .evolution-container,
#results .snapshot-resources {
  max-width: 100%;
}

#results .snapshot-resources {
  overflow-x: auto;
}

#results .timeline-table {
  table-layout: fixed;
  width: 100%;
}

#results .timeline-actions {
  flex-wrap: wrap;
}

#results .search-banner {
  display: grid;
  gap: 0.5rem;
}

#results .banner-fallback {
  color: var(--capei-ink);
}

@media (min-width: 1181px) {
  .selection-disclosure > summary {
    display: none;
  }

  .selection-disclosure:not([open]) > .working-selection {
    display: block !important;
  }
}

@media (max-width: 1180px) {
  .workspace-grid {
    display: flex;
    flex-direction: column;
  }

  .results-column,
  .selection-column {
    width: 100%;
  }

  .selection-column {
    order: -1;
    position: static;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0.75rem;
  }

  .navbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 0.75rem;
  }

  .navbar-brand {
    margin-bottom: 0;
  }

  .brand-endorsement {
    min-height: 2.25rem;
    padding-left: 0.5rem;
  }

  .brand-logo {
    max-height: 1.75rem;
    max-width: 4rem;
  }

  .navbar-menu {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .nav-list {
    justify-content: flex-end;
  }

  .nav-list {
    flex-direction: row;
    gap: 0.5rem;
  }

  .journey-progress ol {
    grid-template-columns: 1fr;
  }

  .journey-step:not(.is-current) {
    display: none;
  }

  .active-search-criteria {
    grid-template-columns: 1fr;
  }

  .active-search-criteria dl {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-grid {
    display: flex;
    flex-direction: column;
  }

  .button-container.search {
    align-items: stretch;
    flex-direction: column;
  }

  .button-container.search button {
    width: 100%;
  }

  .results-column,
  .selection-column {
    width: 100%;
  }

  .selection-column {
    order: -1;
    position: static;
  }

  .selection-group li {
    grid-template-columns: minmax(0, 1fr) 3.5rem 5.5rem;
  }

  #results .partida-header,
  #results .partida-details {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
