/*
 * 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.
 */

.p4-screen {
  width: 100%;
  min-height: calc(100vh - 7rem);
}

.compare-wrap,
.favorites-wrap,
.preset-wrap,
.search-wrap {
  color: var(--text-primary);
}

.compare-wrap,
.favorites-wrap {
  width: 100%;
  padding: 24px 28px;
  background: var(--bg-secondary);
}

.compare-head,
.favorites-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.compare-h1,
.preset-h1,
.search-h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
  margin: 0 0 4px;
}

.compare-head .sub,
.favorites-head .sub,
.preset-sub,
.search-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.compare-actions,
.preset-save-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.icon-btn.primary,
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.secondary {
  background: var(--bg-secondary);
}

.compare-table,
.weight-grid {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cmp-grid {
  display: grid;
  grid-template-columns: 200px repeat(3, minmax(180px, 1fr));
}

.cmp-cell {
  min-height: 64px;
  padding: 14px 16px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.cmp-cell:nth-child(4n) {
  border-right: 0;
}

.cmp-cell.row-label {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.cmp-cell.row-label small {
  display: block;
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 400;
}

.cmp-cell.col-head {
  position: relative;
}

.cmp-cell.col-head .nm {
  padding-right: 28px;
  font-size: 15px;
  font-weight: 700;
}

.cmp-cell.col-head .ad {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.cmp-cell.col-head .total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}

.cmp-cell.col-head .total .n {
  font-size: 30px;
  font-weight: 700;
  line-height: 32px;
}

.cmp-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: pointer;
}

.cmp-val {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmp-val .n {
  min-width: 38px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.cmp-val .n.best {
  color: var(--accent);
}

.cmp-val .n.muted {
  color: var(--text-tertiary);
  font-weight: 400;
}

.cmp-val .b {
  height: 5px;
  flex: 1;
  border-radius: 3px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.cmp-val .b > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.cmp-cell.is-best {
  background: #F0FAFB;
}

.cmp-add {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  text-decoration: none;
}

.folder-form,
.folder-rename {
  align-items: center;
  display: flex;
  gap: 8px;
}

.folder-form input,
.folder-rename input,
.favorite-actions select {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: inherit;
  height: 34px;
  padding: 0 10px;
}

.favorite-folders {
  display: grid;
  gap: 16px;
}

.favorite-folder {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.favorite-folder-head {
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.favorite-folder-head span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.folder-rename input {
  border-color: transparent;
  font-weight: 700;
}

.folder-rename input:focus {
  border-color: var(--accent);
}

.folder-rename button {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.favorite-list {
  display: grid;
}

.favorite-card {
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 14px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.favorite-card:first-child {
  border-top: 0;
}

.favorite-card-body {
  min-width: 0;
}

.favorite-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.favorite-actions form {
  margin: 0;
}

.text-danger {
  color: var(--error);
  font-size: 12px;
}

.empty-state.compact {
  padding: 22px;
}

.preset-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  width: 100%;
  background: var(--bg-secondary);
}

.preset-main {
  padding: 28px 32px;
}

.preset-aside {
  padding: 24px;
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0 24px;
}

.preset-pill {
  min-width: 170px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.preset-pill.active {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: -2px;
}

.preset-pill.custom {
  border-style: dashed;
}

.preset-pill .nm {
  font-size: 14px;
  font-weight: 700;
}

.preset-pill .desc,
.muted,
.save-state {
  color: var(--text-tertiary);
  font-size: 12px;
}

.aside-h {
  margin: 0 0 12px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.weight-row {
  display: grid;
  grid-template-columns: 140px minmax(180px, 1fr) 52px 24px;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-top: 1px solid var(--border-subtle);
}

.weight-row:first-child {
  border-top: 0;
}

.weight-name {
  font-size: 13px;
  font-weight: 600;
}

.weight-name small {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 400;
}

.weight-slider {
  width: 100%;
  accent-color: var(--accent);
}

.weight-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.weight-pct {
  color: var(--text-tertiary);
  font-size: 11px;
}

.weight-sum {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.total-num {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
}

.preset-save-row {
  margin-top: 14px;
}

.preset-save-row.hidden {
  display: none;
}

.preset-section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.preset-apply-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.preset-preview-row {
  display: grid;
  grid-template-columns: 76px 1fr 32px;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 12px;
}

.preset-preview-row span:nth-child(2) {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--accent);
}

.aside-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.search-wrap {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 36px 24px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  box-shadow: var(--shadow-card);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
}

.search-icon {
  color: var(--text-tertiary);
  font-size: 18px;
}

.search-box .clear {
  padding: 2px 6px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}

.search-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.search-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.search-result {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.search-result:hover {
  background: var(--bg-secondary);
}

.score-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
}

.search-result .nm {
  font-size: 14px;
  font-weight: 700;
}

.search-result .nm em {
  padding: 0 2px;
  border-radius: 2px;
  background: #FEF9C3;
  font-style: normal;
}

.search-result .ad {
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.search-result .stats {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.search-result .lbl {
  margin-right: 3px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.search-section {
  margin-top: 24px;
}

.search-section-h {
  margin: 0 0 8px;
  padding: 0 4px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.recent-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
}

.empty-state {
  padding: 40px;
  color: var(--text-tertiary);
  text-align: center;
}

.panel-empty {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.5;
}

.panel-empty strong {
  color: var(--text-primary);
  font-size: 14px;
}

.panel-empty span {
  max-width: 260px;
  font-size: 12px;
}
