/* Syfe header for Code Review app — header dark; code area IntelliJ light */

body.code-review-embedded .syfe-header {
  display: none !important;
}

body.code-review-embedded .view {
  height: 100vh;
}

/* Match login page (.auth-gate-hr .auth-hr-bg) — navy + primary glow */
.syfe-header {
  display: flex;
  /* Bottom-align brand + account with each other; centering them in 60px made “Code Review”
   * and the name use different vertical references vs. the full-height tab strip. */
  align-items: flex-end;
  gap: 20px;
  padding: 0 22px;
  min-height: var(--md-app-bar-h, 60px);
  box-sizing: border-box;
  flex-shrink: 0;
  font-family: var(--syfe-font-sans, "Proxima Nova", Arial, sans-serif);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(47, 81, 201, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 90%, rgba(38, 49, 89, 0.35) 0%, transparent 55%),
    linear-gradient(165deg, #0e1428 0%, #0a0e1a 45%, #06080f 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.syfe-header-left {
  display: flex;
  align-items: flex-end;
  align-self: flex-end;
  min-width: 0;
  padding: 8px 0;
}

.syfe-header-brand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}

.syfe-header-logo-img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 128px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Shared with .syfe-header-interviewer so name lines up with “Code Review” */
.syfe-header-product {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-block;
  color: rgba(226, 232, 240, 0.92);
  padding: 0;
  /*
   * Logo SVG viewBox includes space below the “Syfe” word; flex-end aligns to
   * image bottom. Nudge up so “Code Review” baselines with the Syfe word, not the PNG edge.
   */
  transform: translateY(-7px);
}

/* Same rules as .syfe-header-product so the name shares one vertical rhythm with that label */
.syfe-header-interviewer {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-block;
  color: rgba(226, 232, 240, 0.92);
  padding: 16px 12px 0;
  transform: translateY(-7px);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.syfe-header-tabs {
  display: flex;
  gap: 0;
  align-self: stretch;
  height: var(--md-app-bar-h, 60px);
  min-height: var(--md-app-bar-h, 60px);
}

.syfe-header-account {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  align-self: flex-end;
  gap: 12px;
  padding: 8px 0;
}

/* Same visual language as login `.auth-submit` (Continue) — Syfe primary + box */
/* Teal accent — darker base (not bright); label stays very light for contrast */
.syfe-snapshot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #f7fffe;
  cursor: pointer;
  border: 1px solid rgba(15, 118, 110, 0.65);
  border-radius: 3px;
  background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: background 0.15s, border-color 0.15s, filter 0.1s;
}

.syfe-snapshot-btn[hidden] {
  display: none !important;
}

.syfe-snapshot-btn:hover {
  background: linear-gradient(180deg, #0f766e 0%, #115e59 100%);
  border-color: rgba(17, 94, 89, 0.85);
}

.syfe-snapshot-btn:active {
  filter: brightness(0.92);
}

.syfe-snapshot-btn:focus {
  outline: none;
}

.syfe-snapshot-btn:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.45);
  outline-offset: 2px;
}

.syfe-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--syfe-on-primary);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  background: var(--syfe-primary);
  box-shadow: none;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, filter 0.1s;
}

.syfe-logout-btn-icon {
  flex-shrink: 0;
}

.syfe-logout-btn:hover {
  background: var(--syfe-primary-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.syfe-logout-btn:active {
  filter: brightness(0.94);
}

.syfe-logout-btn:focus {
  outline: none;
}

.syfe-logout-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.syfe-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  /* Nudge label + icon down to align with “Code Review” / logo row */
  padding: 16px 14px 0;
  height: 100%;
  text-decoration: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.syfe-tab:hover {
  color: #e2e8f0;
}

.syfe-tab.active {
  color: #f8fafc;
  border-bottom-color: #38bdf8;
  font-weight: 600;
}

.syfe-tab-icon {
  flex-shrink: 0;
}

/* Code view area: IntelliJ-style light */
.view#view-browse .browse-layout {
  background: #f5f5f5;
}

.view#view-browse .file-tree {
  background: #ebebeb;
  border-right: 1px solid #d4d4d4;
}

.view#view-browse .tree-item { color: #2b2b2b; }
.view#view-browse .tree-item:hover { background: #e0e0e0; }
.view#view-browse .tree-item.active { background: #d4e6f7; border-left-color: #3c8dd6; }
.view#view-browse .tree-item .icon { color: #6e6e6e; }
.view#view-browse .tree-folder { color: #2b2b2b; }
.view#view-browse .tree-folder .folder-icon { color: #3c8dd6; }

.view#view-browse .file-content {
  background: #fff;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  flex: 1;
}

.view#view-browse .file-content .file-header {
  flex-shrink: 0;
}

.view#view-browse .file-content .monaco-editor-wrap,
.view#view-browse .file-content .code-wrapper-with-comments {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view#view-browse .empty-state {
  color: #6e6e6e;
}

.view#view-browse .file-header {
  background: #f0f0f0;
  border-bottom: 1px solid #d4d4d4;
  color: #2b2b2b;
  border-radius: 0;
}

.view#view-browse .file-header .lang-badge {
  background: #d4e6f7;
  color: #2b7dd6;
}

.view#view-browse .file-header .line-count {
  color: #6e6e6e;
}

.view#view-browse .file-header .code-commit-btn {
  background: #3c8dd6;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.view#view-browse .file-header .code-commit-btn:hover {
  background: #2b7dd6;
}

.view#view-browse .file-header .code-add-comment-btn {
  background: #3c8dd6;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.view#view-browse .file-header .code-add-comment-btn:hover {
  background: #2b7dd6;
}

.view#view-browse .code-wrapper {
  background: #fff;
}

.view#view-browse .line-numbers {
  background: #f5f5f5;
  border-right-color: #d4d4d4;
  color: #6e6e6e;
}

.view#view-browse .code-wrapper pre {
  background: #fff !important;
}

.view#view-browse .code-wrapper pre code {
  color: #2b2b2b !important;
}

/* Read-only code table: ensure text is visible */
.view#view-browse .code-wrapper-with-comments .code-cell,
.view#view-browse .code-wrapper-with-comments .code-cell code {
  color: #1a1a1a !important;
  background: transparent !important;
}

/* Monaco Editor container */
.monaco-editor-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.monaco-editor-wrap .monaco-editor {
  height: 100% !important;
  padding-top: 8px;
}

/* Comment glyph in Monaco margin */
.comment-glyph {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%233c8dd6' d='M1 2.75C1 1.784 1.784 1 2.75 1h10.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 13.25 12H9.06l-2.573 2.573A1.458 1.458 0 0 1 4 13.543V12H2.75A1.75 1.75 0 0 1 1 10.25Z'/%3E%3C/svg%3E") no-repeat center;
}

/* GitHub-style "+" on hover in Monaco gutter – full line-height rectangle so no flicker */
.monaco-line-add-comment {
  position: absolute;
  left: 0;
  width: 36px;
  min-height: 20px;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: #2b7dd6;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.monaco-line-add-comment.visible {
  opacity: 1;
  pointer-events: auto;
  background: rgba(212, 230, 247, 0.6);
}

.monaco-line-add-comment.visible:hover {
  background: #d4e6f7;
  color: #2b7dd6;
}

/* GitHub-style inline comment below the line (view zone) */
.monaco-inline-comment {
  margin-left: 50px;
  padding: 8px 12px 10px 14px;
  border-left: 3px solid #3c8dd6;
  background: #f0f7ff;
  font-size: 13px;
  line-height: 1.45;
  color: #1a1a1a;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-word;
}
.monaco-inline-comment-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #3c8dd6;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.monaco-inline-comment-body {
  font-family: inherit;
}

/* Code table with clickable line numbers and comments */
.code-wrapper-with-comments {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.code-wrapper-with-comments .code-table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 20px;
}

.code-wrapper-with-comments .line-num-cell {
  vertical-align: top;
  padding: 0 12px 0 8px;
  text-align: right;
  min-width: 50px;
  width: 50px;
  user-select: none;
  cursor: pointer;
  color: #6e6e6e;
  border-right: 1px solid #d4d4d4;
  background: #f5f5f5;
  position: relative;
}

.code-wrapper-with-comments .line-num-cell .line-num-add {
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: #2b7dd6;
  background: #d4e6f7;
  border-radius: 3px;
  cursor: pointer;
  vertical-align: middle;
  transition: opacity 0.12s ease;
}

.code-wrapper-with-comments .line-num-cell:hover .line-num-add,
.code-wrapper-with-comments .code-line-row:hover .line-num-add {
  opacity: 1;
}

.code-wrapper-with-comments .line-num-cell .line-num-add:hover {
  background: #3c8dd6;
  color: #fff;
}

.code-wrapper-with-comments .line-num-cell .line-num-num {
  user-select: none;
}

.code-wrapper-with-comments .line-num-cell:hover {
  background: #e8f2fc;
  color: #2b7dd6;
}

.code-wrapper-with-comments .code-cell {
  padding: 0 16px;
  vertical-align: top;
  color: #2b2b2b;
}

.code-wrapper-with-comments .code-cell code {
  background: none !important;
  padding: 0 !important;
}

.code-wrapper-with-comments .comment-cell {
  padding: 0 16px 8px 56px;
  vertical-align: top;
  border-left: 3px solid #3c8dd6;
  background: #f0f7ff;
}

.code-wrapper-with-comments .comment-cell .inline-comment {
  padding: 8px 12px;
  border-radius: 6px;
}

.code-comment-form-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: #f0f0f0;
  border-top: 1px solid #d4d4d4;
  padding: 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

.code-comment-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 10px 20px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.code-comment-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.code-comment-form-context { font-size: 12px; color: #6e6e6e; margin-bottom: 8px; }
.code-comment-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  resize: vertical;
  min-height: 60px;
  background: #fff;
  color: #2b2b2b;
  margin-bottom: 10px;
}

.code-comment-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.code-comment-cancel, .code-comment-submit {
  padding: 6px 14px; font-size: 13px; font-weight: 500; border-radius: 3px; cursor: pointer; font-family: inherit;
}
.code-comment-cancel { background: #fff; border: 1px solid #d4d4d4; color: #2b2b2b; }
.code-comment-submit { background: #3c8dd6; border: none; color: #fff; }

.code-line-comment-widget { margin: 4px 0 8px 40px; }
.code-line-comment-widget .inline-comment {
  border-left: 3px solid #3c8dd6;
  background: #f0f7ff;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
}

/* Client static layout: full-bleed browse + tree header + scroll (highlight.js) */
#view-browse {
  padding: 0;
  background: #f5f5f5;
}

#view-browse .browse-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  height: 100%;
  gap: 0;
  padding: 0;
}

.view#view-browse .file-tree {
  width: 280px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.file-tree-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #d4d4d4;
  background: #e0e0e0;
}

.file-tree-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6e6e6e;
}

.file-tree-badge {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: #d4e6f7;
  color: #2b7dd6;
}

.file-tree-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.view#view-browse .file-content {
  border-radius: 0;
  box-shadow: none;
}

.view#view-browse .file-content .code-table-wrapper {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.view#view-browse .tree-item {
  border-radius: 0;
  margin: 0 4px;
  min-height: 32px;
  border-left: 2px solid transparent;
}

.view#view-browse .code-table tbody tr:hover {
  background: #f5f5f5;
}

.view#view-browse td.code-ln {
  color: #6e6e6e;
  border-right-color: #d4d4d4;
  background: #f5f5f5;
}

.view#view-browse .inline-comment {
  border-left-color: #3c8dd6;
  background: #f0f7ff;
}

.view#view-browse .add-comment-btn {
  background: #3c8dd6;
  border-color: #d4d4d4;
}

.view#view-browse .add-comment-btn:hover {
  background: #2b7dd6;
}

.view#view-browse .comment-badge #comment-count {
  background: #3c8dd6;
}

.view#view-browse .toggle-btn.active {
  background: #3c8dd6;
  color: #fff;
}
