@import '../../shared-tokens.css';

/* ── Tool-specific overrides for landing/css/styles.css inherited styles ── */
.hero-eyebrow { color: var(--oe-primary) !important; }
.nav-cta { color: var(--oe-primary) !important; }

/* ── Primary button (overrides landing/css/styles.css) ── */
.btn-primary {
  background: var(--oe-primary);
  color: #fff;
  border-radius: var(--oe-radius-md);
  padding: var(--oe-btn-padding);
  transform: none;
}
.btn-primary:hover {
  background: var(--oe-primary-hover);
  transform: none;
}

/* ── Secondary / back button ── */
.btn-secondary {
  background: #fff;
  color: var(--text-secondary);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--oe-radius-md);
  padding: var(--oe-btn-padding);
  font-size: 14px;
  font-weight: 500;
  opacity: 1;
  transform: none;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover {
  background: #f5f5f7;
  color: var(--text-primary);
  opacity: 1;
}

/* ── Inner cards ── */
.section-card,
.form-card,
.auth-card,
.session-card,
.candidate-pick-card,
.score-row,
.choice-card {
  padding: var(--oe-card-padding);
  border-radius: var(--oe-radius-lg);
  border: 0.5px solid rgba(0,0,0,0.08);
  background: #fff;
  box-shadow: none;
}

/* ── Nav stepper ── */
.is-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f5f5f7;
  font-size: 18px;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.nav-close-btn:hover {
  background: #e5e5e7;
}

/* ── Modal overlay (shared) ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f5f5f7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: background 0.2s ease;
}

.modal-close:hover { background: #e5e5e7; }

.modal-body { padding: 28px; }

/* ── Criteria tags (matching Decision Matrix style) ── */
.criteria-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.criteria-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f5f5f7;
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.criteria-tag:hover {
  background: var(--oe-primary);
  color: #fff;
}

.criteria-tag.selected {
  background: var(--oe-primary);
  color: #fff;
}

.criteria-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.criteria-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--oe-primary);
  border-radius: 100px;
  font-size: 13px;
  color: #fff;
}

.criteria-item button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.8;
}

.criteria-item button:hover { opacity: 1; }

.custom-criteria-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-start;
}

/* ── List-item row (used for candidates, options, etc.) ── */
.decision-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f5f7;
  border-radius: var(--oe-radius-md, 10px);
  margin-bottom: 8px;
}

.decision-option-remove {
  background: none;
  border: none;
  color: #6e6e73;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.decision-option-remove:hover { color: var(--oe-danger, #ff3b30); }

.add-option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: none;
  border: 1.5px dashed rgba(0,0,0,0.12);
  border-radius: var(--oe-radius-md, 10px);
  font-size: 13px;
  color: #6e6e73;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 4px;
}

.add-option-btn:hover {
  border-color: var(--oe-primary, #c8a96a);
  color: var(--oe-primary, #c8a96a);
}

/* ── Base layout ── */
.app-main {
  padding-top: 64px;
  min-height: 100vh;
}

.view {
  padding: 48px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.view.hidden {
  display: none;
}

.app-center {
  max-width: 480px;
  text-align: center;
}

.view-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.view-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 32px;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.view-header .view-title {
  margin-bottom: 4px;
}

/* ── Landing choice cards ── */
.choice-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}

.choice-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  text-align: left;
}

.choice-card:hover {
  transform: translateY(-2px);
  border-color: var(--oe-primary);
}

.choice-icon {
  font-size: 32px;
  margin-bottom: 14px;
}

.choice-label {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.choice-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Auth ── */
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  border: 0.5px solid rgba(0,0,0,0.08);
  text-align: left;
}

/* Form inputs - matching Decision Matrix style */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f5f5f7;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--oe-primary);
  box-shadow: 0 0 0 4px rgba(200,169,106,0.15);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: #f5f5f7;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}

.auth-error {
  font-size: 13px;
  color: #ff3b30;
  padding: 10px 14px;
  background: rgba(255, 59, 48, 0.08);
  border-radius: 8px;
  margin-bottom: 14px;
  display: none;
}

.auth-error:not(:empty) {
  display: block;
}

.forgot-password-wrap {
  text-align: right;
  margin-top: 8px;
}

.forgot-password-link {
  font-size: 13px;
  color: var(--oe-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.forgot-password-link:hover {
  opacity: 0.75;
}

.back-link {
  display: block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-primary);
}

/* ── Form card (create session) ── */
.form-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  border: 0.5px solid rgba(0,0,0,0.08);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Sessions list (dashboard) ── */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.session-card:hover {
  transform: translateY(-1px);
  border-color: var(--oe-primary);
}

.session-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.session-card-role {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.session-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
  font-size: 15px;
  background: #f5f5f7;
  border-radius: 16px;
}

/* ── Status badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: var(--oe-primary-light);
  color: var(--oe-primary);
}

.status-closed {
  background: rgba(52, 199, 89, 0.12);
  color: #1a7f37;
}

.status-done {
  background: rgba(52, 199, 89, 0.12);
  color: #1a7f37;
}

.status-not-rated {
  background: #f5f5f7;
  color: var(--text-secondary);
}

.status-in-progress {
  background: rgba(255, 149, 0, 0.12);
  color: #c65f00;
}

/* ── Session detail ── */
.session-code-card {
  background: linear-gradient(135deg, #c8a96a, #d4b87c);
  border-radius: 16px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.session-code-left {
  flex: 1;
}

.session-code-label {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}

.session-code-display {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  font-family: "SF Mono", "Fira Code", monospace;
  margin-bottom: 16px;
}

.session-code-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.session-code-actions .qr-action-btn {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

.session-code-actions .qr-action-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
}

.session-qr-wrap {
  flex-shrink: 0;
}

.session-qr-wrap .qr-code {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: none;
  margin-bottom: 0;
}

/* ── Progress overview ── */
.progress-overview {
  margin-bottom: 24px;
}

.progress-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.progress-stat {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 0.5px solid rgba(0,0,0,0.08);
}

.progress-stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--oe-primary);
}

.progress-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Section card ── */
.section-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  border: 0.5px solid rgba(0,0,0,0.08);
}

.section-card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ── Candidate / panelist rows (session detail) ── */
.candidate-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.candidate-row:last-child {
  border-bottom: none;
}

.candidate-row-name {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
  min-width: 100px;
}

.candidate-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.candidate-progress-bar {
  width: 100px;
  height: 6px;
  background: #f5f5f7;
  border-radius: 3px;
  overflow: hidden;
}

.candidate-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--oe-primary), #d4b87c);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.candidate-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.panelist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.panelist-row:last-child {
  border-bottom: none;
}

.panelist-row-name {
  font-size: 15px;
  font-weight: 500;
}

/* ── Final assessment actions ── */
.final-actions {
  margin-top: 8px;
  padding: 24px;
  background: #f5f5f7;
  border-radius: 16px;
  text-align: center;
}

/* ── Panelist: candidate pick cards ── */
.candidate-pick-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.candidate-pick-card:hover {
  transform: translateY(-1px);
  border-color: var(--oe-primary);
}

.candidate-pick-name {
  font-size: 16px;
  font-weight: 500;
}

/* ── Rate candidate ── */
.autosave-indicator {
  font-size: 12px;
  color: var(--oe-primary);
  margin-bottom: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.criteria-scores {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.score-row {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 0.5px solid rgba(0,0,0,0.08);
}

.score-criteria-label {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.score-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.score-slider {
  flex: 1;
  height: 4px;
  accent-color: var(--oe-primary);
  cursor: pointer;
}

.score-number {
  width: 64px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f5f5f7;
  color: var(--text-primary);
}

.score-number:focus {
  outline: none;
  border-color: var(--oe-primary);
}

.score-unit {
  font-size: 13px;
  color: var(--text-secondary);
}

.score-bar-preview {
  height: 6px;
  background: #f5f5f7;
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.15s ease, background 0.3s ease;
}

/* ── Assessment results ── */
.assessment-winner-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 28px;
  background: linear-gradient(135deg, #34c759, #30d158);
  border-radius: 16px;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.assessment-table-wrapper {
  overflow-x: auto;
  border-radius: 16px;
  border: 0.5px solid rgba(0,0,0,0.08);
}

.assessment-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

.assessment-table th {
  padding: 14px 16px;
  background: #f5f5f7;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.assessment-table th:first-child {
  text-align: left;
  color: var(--text-primary);
}

.assessment-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.assessment-table td.criteria-col {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.assessment-table .overall-row td {
  background: #f5f5f7;
  border-bottom: none;
}

.assessment-table .col-winner {
  background: rgba(52, 199, 89, 0.06);
}

.assessment-table th.col-winner {
  background: rgba(52, 199, 89, 0.12);
  color: #1a7f37;
}

.table-score {
  font-size: 15px;
  font-weight: 600;
}

/* ── Misc ── */
.info-banner {
  padding: 14px 18px;
  background: var(--oe-primary-light);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.closed-banner {
  padding: 20px 24px;
  background: rgba(52, 199, 89, 0.1);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #1a7f37;
  text-align: center;
}

.join-code-input {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 22px;
  text-align: center;
  font-weight: 600;
}

/* ── Session delete button ── */
.session-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 8px;
  opacity: 0.5;
  transition: opacity 0.2s ease, background 0.2s ease;
  line-height: 1;
}

.session-delete-btn:hover {
  opacity: 1;
  background: rgba(255, 59, 48, 0.1);
}

/* ── Closed session limit modal rows ── */
.session-limit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.session-limit-row:last-child {
  border-bottom: none;
}

.session-limit-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .choice-cards {
    grid-template-columns: 1fr;
  }

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

  .session-code-card {
    flex-direction: column;
  }

  .session-code-display {
    font-size: 36px;
  }

  .assessment-table {
    font-size: 12px;
  }

  .view-header {
    flex-direction: column;
  }
}

@media print {
  nav, .view-header button, .form-actions, .session-code-actions, .final-actions { display: none; }
  .app-main { padding-top: 0; }
}

/* ── Download dropdown ── */
.is-dl-wrap { position: relative; }
.is-dl-trigger { display: flex; align-items: center; justify-content: center; gap: 6px; }
.is-dl-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  z-index: 100;
}
.is-dl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #1d1d1f;
  background: none;
  border: none;
  border-top: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.is-dl-item:first-child { border-top: none; }
.is-dl-item:hover { background: #f5f5f7; }
.is-dl-icon { font-size: 16px; flex-shrink: 0; }
.is-dl-label { flex: 1; }
.is-dl-check { font-size: 12px; font-weight: 600; color: #16a34a; margin-left: auto; }
