/*
 * Atlas-specific design-system overrides.
 * Keep this file small as shared styles move into /shared/css/lp-base.css.
 */

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--border);
}

.login-container {
  max-width: 450px;
  background-color: var(--bg);
  padding: 2rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.toggle-visibility {
  float: right;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 0.875rem;
}

.toggle-visibility:hover {
  background: none;
  border: 0;
  color: var(--primary-hover);
}

.keyword-delete-button {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

.dashboard-job-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
}

.dashboard-job-meta,
.dashboard-job-timestamp {
  color: var(--muted);
  font-size: 0.875rem;
}

.dashboard-job-timestamp {
  margin-top: 0.5rem;
}

.dashboard-job-progress {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

.dashboard-project-link {
  font-weight: 700;
}

.dashboard-card,
.form-section {
  margin-bottom: 2.5rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background-color: var(--surface);
}

.dashboard-card h3,
.form-section h3 {
  margin-top: 0;
  margin-bottom: 1.25rem;
  font-size: 1.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.stat-box {
  padding: 1.5rem 1rem;
  background-color: var(--primary);
  text-align: center;
}

.stat-box .stat-value {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.stat-box .stat-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.job-status {
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-left: 4px solid transparent;
  background-color: var(--surface);
}

.job-status.pending {
  border-color: #555;
  border-left-color: #555;
}

.job-status.running {
  background-color: #FAF6EE;
  border-color: var(--accent);
  border-left-color: var(--accent);
}

.job-status.failed,
.job-status.error {
  background-color: #FDF5F4;
  border-color: var(--danger);
  border-left-color: var(--danger);
  color: #8B3A2F;
}

.job-status.completed,
.job-status.success {
  background-color: #F0F5F2;
  border-color: var(--primary);
  border-left-color: var(--primary);
  color: var(--primary-hover);
}

.job-status mark {
  padding: 0.25rem 0.5rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: none;
}

.job-status.pending mark {
  background-color: #555;
  color: #fff;
}

.job-status.running mark {
  background-color: var(--accent);
  color: #fff;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.action-card {
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  text-align: center;
  background-color: var(--surface);
  transition: all 0.2s ease;
}

.action-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(184, 150, 90, 0.15);
  transform: translateY(-2px);
}

.action-card h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.action-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.rank-check-form {
  margin-bottom: 0;
}

.restore-history-actions {
  margin-top: 1rem;
}

.projects-singleton-field {
  margin-top: 1rem;
}

.client-data-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.file-drop-zone {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 220px;
  padding: 1.5rem;
  border: 2px dashed var(--border);
  background-color: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.file-drop-zone:hover,
.file-drop-zone:focus-visible {
  border-color: var(--accent);
  background-color: #faf6ee;
  outline: none;
  transform: translateY(-1px);
}

.file-drop-zone.is-dragover {
  border-color: var(--accent);
  background-color: #faf6ee;
}

.file-drop-zone.has-file {
  border-color: var(--primary);
  background-color: #f0f5f2;
}

.file-drop-zone__header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.file-drop-zone__icon {
  font-size: 1.75rem;
  color: var(--accent);
}

.file-drop-zone__title,
.file-drop-zone__help,
.file-drop-zone__prompt,
.file-drop-zone__filename {
  margin: 0;
}

.file-drop-zone__title {
  font-weight: 700;
  color: var(--primary);
}

.file-drop-zone__help,
.file-drop-zone__prompt {
  color: var(--muted);
}

.file-drop-zone__prompt {
  font-size: 0.95rem;
}

.file-drop-zone__filename {
  margin-top: auto;
  font-weight: 500;
  color: var(--color);
  word-break: break-word;
}

.file-drop-zone__input {
  margin: 0;
  padding: 0.5rem;
  background-color: var(--surface);
}

.client-data-upload-note {
  color: var(--muted);
}

.projects-singleton-help {
  display: block;
  margin-top: 0.5rem;
}

.project-location-form {
  display: inline;
}

.project-location-select {
  min-width: 140px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.project-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: stretch;
}

.project-actions > * {
  min-width: 0;
}

.project-actions form {
  margin: 0;
}

.project-actions a.button,
.project-actions form .button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.competitor-table {
  table-layout: fixed;
  width: 100%;
}

.competitor-table th:nth-child(1),
.competitor-table td:nth-child(1) {
  width: 35%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.competitor-table th:nth-child(2),
.competitor-table td:nth-child(2) {
  width: 20%;
}

.competitor-table th:nth-child(3),
.competitor-table td:nth-child(3) {
  width: 8%;
  text-align: center;
}

.competitor-table th:nth-child(4),
.competitor-table td:nth-child(4) {
  width: 12%;
  text-align: right;
}

.competitor-table th:nth-child(5),
.competitor-table td:nth-child(5) {
  width: 12%;
  text-align: right;
}

.competitor-table th:nth-child(6),
.competitor-table td:nth-child(6) {
  width: 13%;
  text-align: center;
}

.competitor-table a {
  word-break: break-all;
  display: inline-block;
  max-width: 100%;
}

.competitor-empty-note {
  padding-left: 1rem;
}

@media (max-width: 768px) {
  .competitor-table {
    font-size: 0.9em;
  }

  .competitor-table th:nth-child(1),
  .competitor-table td:nth-child(1) {
    width: 40%;
  }

  .competitor-table th:nth-child(2),
  .competitor-table td:nth-child(2) {
    width: 25%;
  }
}

.opportunity-control-card,
.opportunity-control-card-static {
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background-color: var(--surface);
}

.opportunity-control-card > summary {
  display: flex;
  align-items: flex-start;
}

.opportunity-control-card > summary:hover {
  background-color: var(--surface);
}

.opportunity-control-summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.opportunity-control-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1.2;
}

.opportunity-control-description {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
}

.opportunity-control-card-body {
  padding-bottom: 1.5rem;
}

.opportunity-control-card-body > :last-child,
.opportunity-control-card-body form > :last-child,
.opportunity-control-card-static > :last-child {
  margin-bottom: 0;
}

.opportunity-control-card-static {
  padding: 1.5rem 2rem;
}

.opportunity-control-card-static hgroup {
  margin-bottom: 1rem;
}

.opportunity-control-card-static h2 {
  margin-bottom: 0.35rem;
}

.opportunity-export-actions {
  display: flex;
  justify-content: flex-start;
}

.opportunity-preference-status {
  margin-top: 1rem;
}

.opportunity-section-summary,
.opportunity-total-traffic {
  margin-bottom: 0.75rem;
}

.opportunity-selection-note {
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.opportunity-planning-summary {
  margin-bottom: 1rem;
}

.opportunity-total-traffic {
  font-size: 1.05rem;
}

.opportunity-empty-note {
  color: var(--muted);
}

.opportunity-debug {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
}

.opportunity-debug-grid {
  font-family: monospace;
  font-size: 0.9rem;
}

.opportunity-debug-total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.opportunity-card {
  transition: opacity 0.35s ease;
}

.opportunity-card.is-removing {
  opacity: 0;
}

.opportunity-card-suppressed {
  opacity: 0.75;
}

.opportunity-card-header {
  align-items: center;
}

.opportunity-card-summary {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  width: 100%;
  flex-wrap: nowrap;
}

.opportunity-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 0 1 auto;
  font-size: 1.05rem;
}

.opportunity-card-title-text {
  word-break: break-word;
}

.opportunity-workflow-state,
.competitor-option-flags {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.opportunity-card-indicators,
.competitor-option-indicators {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.opportunity-card-indicators {
  flex: 0 0 1.5rem;
  justify-content: flex-start;
}

.opportunity-card-indicators .icon-inline {
  margin-right: 0;
}

.opportunity-card-indicators-empty {
  min-height: 1rem;
}

.opportunity-card-meta {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  flex: 1 1 auto;
  min-width: 0;
}

.opportunity-card-meta > span {
  white-space: nowrap;
}

.opportunity-card-content h5 {
  margin-top: 1.5rem;
}

.opportunity-type-pill {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  border: 1px solid currentColor;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.opportunity-type-pill.is-new-page {
  color: var(--primary);
  background-color: #F0F5F2;
}

.opportunity-type-pill.is-optimization {
  color: #245f7a;
  background-color: #EEF5F8;
}

.opportunity-traffic-value,
.opportunity-client-traffic {
  font-weight: 700;
}

.competitor-option {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  cursor: pointer;
}

.competitor-option input[type="radio"] {
  margin-top: 0.2rem;
}

.competitor-option-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.competitor-option-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.competitor-option-url {
  font-weight: 700;
  word-break: break-word;
}

.competitor-option-title,
.competitor-option-stats,
.competitor-option-note {
  color: var(--muted);
}

.competitor-option-note {
  line-height: 1.4;
}

.competitor-option.is-selected {
  border-left: 4px solid var(--accent);
}

.competitor-option.is-confirmed {
  border-color: var(--primary);
}

.competitor-option.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.opportunity-content-type-control {
  margin-bottom: 1rem;
}

.opportunity-planning-panel {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  background-color: rgba(42, 74, 58, 0.04);
}

.opportunity-planning-header,
.opportunity-planning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.opportunity-planning-header {
  margin-bottom: 0.6rem;
}

.opportunity-planning-actions {
  margin-top: 0.75rem;
}

.opportunity-phase-plan-panel {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  background-color: rgba(184, 150, 90, 0.08);
}

.opportunity-phase-plan-group + .opportunity-phase-plan-group {
  margin-top: 0.85rem;
}

.opportunity-phase-plan-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.opportunity-phase-plan-list li {
  margin-bottom: 0.35rem;
}

.opportunity-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.opportunity-action-status {
  min-height: 1.5rem;
  font-size: 0.95rem;
}

.opportunity-action-status.is-info {
  color: var(--muted);
}

.opportunity-action-status.is-success {
  color: var(--primary);
  font-weight: 700;
}

.opportunity-action-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.opportunity-math {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.55);
}

.opportunity-preference-details {
  margin-top: 1rem;
}

.opportunity-preference-list {
  margin: 0;
  padding-left: 1.25rem;
}

@media (max-width: 900px) {
  .opportunity-control-card-static {
    padding: 1.25rem 1.5rem;
  }

  .opportunity-card-summary,
  .opportunity-card-title,
  .opportunity-card-meta,
  .opportunity-actions,
  .competitor-option,
  .competitor-option-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .opportunity-card-summary {
    gap: 0.5rem;
  }

  .opportunity-card-indicators {
    flex-basis: auto;
  }

  .opportunity-card-meta {
    flex-wrap: wrap;
  }
}
