/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

html, body {
  margin: 0;
  padding: 0;
}

/* Page: light beige background, hero vertically centered */
.page-background {
  box-sizing: border-box;
  min-height: 100vh;
  background: #f5f5f0;
  padding: 2rem 1rem 4rem;
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
}

.page-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.page-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* Main prompt box: white, rounded, subtle border */
.prompt-box {
  max-width: 48rem;
  width: 100%;
  margin: 0 auto 2rem;
}

.prompt-box-inner {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 1rem 1rem 0.75rem;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

/* URL bar row, then options row beneath */
.prompt-box--url.prompt-box-inner {
  min-height: 0;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.prompt-box-url-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.prompt-box-debug-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #606060;
  cursor: pointer;
  user-select: none;
}

.prompt-box-debug-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: #1a1a1a;
}

.prompt-box-debug-label {
  font-size: 0.875rem;
}

.prompt-box--url .prompt-box-url-row .prompt-input {
  flex: 1;
  min-width: 0;
  min-height: 0;
  margin-bottom: 0;
  padding: 0.5rem 0;
}

.prompt-input {
  flex: 1;
  width: 100%;
  min-height: 3rem;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  border: none;
  background: transparent;
  box-sizing: border-box;
}

.prompt-input::placeholder {
  color: #606060;
}

.prompt-input:focus {
  outline: none;
}

.prompt-input:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

.prompt-box-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
}

.prompt-box-options {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
}

.prompt-box-options .prompt-submit-btn {
  margin-left: auto;
}

@media (max-width: 480px) {
  .prompt-box-options {
    gap: 0.75rem;
  }
  .prompt-box-options .prompt-submit-btn {
    margin-left: 0;
    width: 100%;
  }
}

.prompt-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #555;
  cursor: default;
}

.prompt-option-label {
  white-space: nowrap;
}

.prompt-option-select,
.prompt-option-input {
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prompt-option-select:hover,
.prompt-option-input:hover {
  border-color: #ccc;
}

.prompt-option-select:focus,
.prompt-option-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.1);
}

.prompt-option-select {
  cursor: pointer;
}

.prompt-option-input {
  width: 4rem;
  box-sizing: border-box;
}

.prompt-option-input::-webkit-outer-spin-button,
.prompt-option-input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.prompt-option-input[type="number"] {
  appearance: textfield;
}

.prompt-submit-btn {
  padding: 0.5rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  background: #1a1a1a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.prompt-submit-btn:hover {
  background: #333;
}

.prompt-submit-btn:focus {
  outline: none;
}

.prompt-submit-btn:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a1a1a;
}

/* Sites list below the prompt box */
.run-configs-list-wrapper {
  max-width: 48rem;
  width: 100%;
  margin: 0 auto;
}

.run-configs-list-message {
  margin: 0;
  font-size: 0.9375rem;
  color: #666;
}

.run-configs-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.run-configs-list-item {
  margin-bottom: 0.5rem;
}

.run-configs-list-site-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: inherit;
  text-align: left;
}

.run-configs-list-site-row:hover {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}

.run-configs-list-site-expand {
  flex-shrink: 0;
  font-size: 0.6rem;
  color: #666;
}

.run-configs-list-site-url-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.run-configs-list-site-url {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9375rem;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.run-configs-list-site-url:hover {
  text-decoration: underline;
}

.run-configs-list-use-url-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #666;
  cursor: pointer;
}

.run-configs-list-use-url-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}

.run-configs-list-run-config {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: #666;
  white-space: nowrap;
}

.run-configs-list-run-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #1a1a1a;
  background: #f0f0f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.run-configs-list-run-btn:hover:not(:disabled) {
  background: #e0e0e0;
}

.run-configs-list-run-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.run-configs-list-runs {
  margin: 0.5rem 0 0.75rem 1.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid #e0e0e0;
}

.run-configs-list-runs-loading,
.run-configs-list-runs-empty {
  margin: 0;
  font-size: 0.8125rem;
  color: #666;
}

.run-configs-list-runs-table {
  font-size: 0.8125rem;
  display: grid;
  grid-template-columns: 4.5rem 10rem 10rem 4rem 5.5rem minmax(7rem, auto);
  gap: 0.75rem 0.35rem;
  align-items: center;
  min-width: 0;
}

.run-configs-list-runs-header {
  display: contents;
}

.run-configs-list-runs-header > * {
  font-weight: 600;
  color: #555;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.25rem 0 0 0;
}

.run-configs-list-runs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: contents;
}

.run-configs-list-run {
  display: contents;
}

.run-configs-list-run-status {
  font-weight: 500;
}

.run-configs-list-run-time {
  color: #666;
}

.run-configs-list-run-finished {
  color: #666;
}

.run-configs-list-run-duration {
  color: #666;
  min-width: 0;
  overflow: hidden;
}

.run-configs-list-run-model {
  color: #666;
  min-width: 0;
  overflow: hidden;
}

.run-configs-list-run-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.run-configs-list-run-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #e0e0e0;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: run-configs-list-spin 0.7s linear infinite;
}

.run-configs-list-site-spinner {
  margin-left: 0.35rem;
  vertical-align: middle;
}

@keyframes run-configs-list-spin {
  to {
    transform: rotate(360deg);
  }
}

.run-configs-list-run-view-btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #1a1a1a;
  background: #f0f0f0;
  border-radius: 6px;
  text-decoration: none;
}

.run-configs-list-run-view-btn:hover {
  background: #e0e0e0;
}

.run-configs-list-run-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.run-configs-list-run-debug-btn {
  color: #666;
}

.run-configs-list-run-debug-btn:hover {
  background: #e8e8e8;
  color: #1a1a1a;
}

.hello-react {
  max-width: 40rem;
  margin: 2rem auto;
  padding: 1.5rem;
  font-family: system-ui, sans-serif;
}

.hello-react h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  color: #1a1a1a;
}

.hello-react p {
  margin: 0;
  color: #444;
}

.run-config-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

.run-config-status--pending {
  color: #4b5563;
  background: #f3f4f6;
}

.run-config-status--crawling {
  color: #b45309;
  background: #fef3c7;
}

.run-config-status--generating {
  color: #6d28d9;
  background: #ede9fe;
}

.run-config-status--completed {
  color: #047857;
  background: #d1fae5;
}

.run-config-status--failed {
  color: #dc2626;
  background: #fee2e2;
}
