/* Interviews feature — shared styles for /interviews and /interviews/{id}.
   The shared style.css already handles the global header, body font,
   button base styles, modal overlay (.modal / .modal-backdrop /
   .modal-panel), etc. — these classes only cover what's specific to
   the interview-questions surface.

   All colors use the design-token CSS vars from style.css so the page
   responds to prefers-color-scheme: dark out of the box. */

.interviews-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.interviews-hero {
  margin-bottom: 1.5rem;
}
.interviews-hero h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  margin: 0 0 .5rem;
  color: var(--text-strong);
}
.interviews-sub {
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 1rem;
  line-height: 1.5;
}
.interviews-hero-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
}

/* Filter bar above the list */
.interviews-filters {
  background: var(--tinted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-bottom: 1.25rem;
}
.filter-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 140px;
  min-width: 140px;
}
.filter-label {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .25rem;
}
.filter-field input,
.filter-field select {
  padding: .45rem .6rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}
.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Primary action button. Soft brand-tinted shadow at rest (gives a
   subtle "glowing edge" feel without an actual gradient border), and
   a stronger glow + diagonal highlight overlay on hover.
   The ::after pseudo-element holds the highlight gradient — animated
   via opacity so it's a single GPU-cheap transition. */
.primary-btn {
  position: relative;
  isolation: isolate;        /* keep the ::after gradient inside the button */
  overflow: hidden;
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: .65rem 1.15rem;
  font-weight: 600;
  font-family: inherit;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: var(--shadow-brand-sm);
  transition: transform 80ms ease, box-shadow 180ms ease;
}
.primary-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand-overlay);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  z-index: -1;
}
.primary-btn:hover  {
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand-md);
}
.primary-btn:hover::after { opacity: 1; }
.primary-btn:active { transform: translateY(0); box-shadow: var(--shadow-brand-sm); }
.primary-btn:disabled {
  opacity: .55; cursor: progress; transform: none;
  box-shadow: none;
}
.primary-btn:disabled::after { opacity: 0; }

/* Secondary button. Quieter — soft surface that lifts toward the brand
   color on hover with a brand-tinted shadow + faint accent border. */
.secondary-btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: .55rem 1.05rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease,
              background 180ms ease, transform 80ms ease;
}
.secondary-btn:disabled { opacity: .5; cursor: not-allowed; }
.secondary-btn:hover:not(:disabled) {
  background: var(--panel-hover);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand-sm);
  transform: translateY(-1px);
}
.secondary-btn:active:not(:disabled) { transform: translateY(0); }

/* Header nav active state — used on /interviews to show the user where
   they are. style.css doesn't ship this yet, so we own it here. */
.header-nav-link-active {
  color: var(--brand);
  font-weight: 600;
}

/* List of question cards */
.interview-list {
  display: grid;
  gap: 1rem;
}
.iv-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease,
              transform 180ms ease;
}
.iv-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-brand-md);
  transform: translateY(-1px);
}
.iv-card-side {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.iv-upvote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  background: var(--tinted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem .55rem;
  color: var(--muted);
  cursor: pointer;
  min-width: 52px;
  font: inherit;
}
.iv-upvote:hover {
  background: var(--brand-soft);
  color: var(--brand-text);
}
.iv-upvote-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-text);
}
.iv-upvote-count {
  font-weight: 600;
  font-size: .9rem;
}

.iv-card-main { min-width: 0; }
.iv-card-meta {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: .3rem;
}
.iv-company {
  color: var(--text-strong);
  font-weight: 600;
  text-decoration: none;
}
.iv-company:hover { color: var(--brand); }
.iv-diff {
  padding: .1rem .45rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.iv-diff-easy   { background: var(--good-soft);   color: var(--good); }
.iv-diff-medium { background: rgba(217, 119, 6, 0.12); color: var(--warn); }
.iv-diff-hard   { background: var(--danger-soft); color: var(--danger); }
.iv-role {
  background: var(--chip-bg);
  color: var(--muted);
  padding: .1rem .45rem;
  border-radius: 4px;
  font-size: .72rem;
  border: 1px solid var(--chip-border);
}
.iv-time { color: var(--muted-2); }

.iv-title {
  margin: 0 0 .35rem;
  font-size: 1.05rem;
}
.iv-title a {
  color: var(--text-strong);
  text-decoration: none;
}
.iv-title a:hover { color: var(--brand); }

.iv-snippet {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
  margin: 0 0 .5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.iv-tags {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
.iv-tag {
  background: var(--chip-bg);
  color: var(--muted);
  padding: .15rem .55rem;
  border-radius: 4px;
  font-size: .72rem;
  border: 1px solid var(--chip-border);
}

/* Pager */
.iv-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
#iv-pageinfo { color: var(--muted); font-size: .9rem; }

/* "Share a question" modal.  Uses the shared .modal / .modal-backdrop /
   .modal-panel chrome from style.css.  The default panel is sized for a
   single email field; we widen it here so the multi-field question form
   doesn't overflow on desktop. */
.modal-panel-wide {
  width: min(94vw, 620px) !important;
  max-height: 88vh;
  overflow-y: auto;
}

.ask-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ask-field {
  display: flex;
  flex-direction: column;
}
.ask-label {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .3rem;
  font-weight: 500;
}
.ask-field input,
.ask-field select,
.ask-field textarea {
  padding: .6rem .75rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
}
.ask-field input:focus,
.ask-field select:focus,
.ask-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.ask-field textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.5;
}
.ask-row {
  display: flex;
  gap: .75rem;
}
.ask-field-half { flex: 1; min-width: 0; }
.ask-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: .25rem;
}

/* Detail page (/interviews/{id}) */
.iv-detail {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.5rem;
}
.iv-detail-meta {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: .6rem;
}
.iv-detail-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-strong);
}
.iv-body {
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
}
.iv-body p { margin: 0 0 .9rem; }
.iv-body p:last-child { margin: 0; }
.iv-pre {
  background: var(--tinted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .9rem;
  margin: 0 0 .9rem;
  color: var(--text-strong);
}
.iv-code {
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  padding: .08rem .35rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: .9em;
}

.iv-actions {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
  align-items: center;
}
.iv-flag {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: .45rem .8rem;
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
}
.iv-flag:hover { color: var(--danger); border-color: var(--danger); }
.iv-flag-active { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

.iv-solutions h3 {
  margin: 1.5rem 0 .75rem;
  font-size: 1.1rem;
  color: var(--text-strong);
}
.iv-solution {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: .9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: .75rem;
}
.iv-solution .iv-body { font-size: .95rem; }

.iv-write-solution {
  margin-top: 1.5rem;
  background: var(--tinted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.iv-write-solution h4 {
  margin: 0 0 .5rem;
  font-size: .95rem;
  color: var(--text-strong);
}
.iv-write-solution textarea {
  width: 100%;
  min-height: 130px;
  padding: .7rem .8rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.iv-write-solution textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.iv-write-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: .5rem;
}
.iv-signin-hint {
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 1rem;
}
.iv-signin-hint a { color: var(--brand); }

/* Attribution footer rendered under the body of imported questions and
   solutions. CC BY-SA requires the source link + author + author profile
   to be visible (not hidden behind tooltips) and not rel=nofollow. */
.iv-attribution {
  margin: 1rem 0 0;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
  font-style: italic;
}
.iv-attribution a {
  color: var(--brand);
  text-decoration: none;
}
.iv-attribution a:hover { text-decoration: underline; }
.iv-attribution-license {
  font-style: normal;
  font-size: .72rem;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  padding: .05rem .4rem;
  border-radius: 4px;
  color: var(--muted);
}

/* Provenance badge — pinned to the card's top-right corner so it
   doesn't crowd the meta row (company / difficulty / role / time).
   Uses absolute positioning relative to .iv-card. */
.iv-badge {
  position: absolute;
  top: .7rem;
  right: .9rem;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .15rem .5rem;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  pointer-events: auto;
}

/* Synthetic AI-generated: solid purple pill — visually loud so a
   reader can't miss that this question isn't from a real interview. */
.iv-badge-synth {
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand);
}

/* Stack Exchange CC BY-SA: muted link — present for attribution
   compliance but not visually demanding. */
.iv-badge-se {
  color: var(--muted-2);
  background: transparent;
  border: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: .7rem;
}
.iv-badge-se:hover {
  color: var(--brand);
  border-color: var(--brand);
}

/* Reserve space on the right side of the meta row AND title so the
   absolute-positioned badge doesn't overlap them. The badge sits in
   the corner regardless of card height; reserve enough horizontal
   space so wrapped meta-row chips never slide underneath. */
.iv-card:has(.iv-badge) .iv-title,
.iv-card:has(.iv-badge) .iv-card-meta {
  padding-right: 9rem;
}

/* Mobile (≤640px / iPhone portrait): the meta row wraps to multiple
   lines because of company + difficulty + role + time — and the
   wrapped lines slide UNDER the badge despite the desktop padding-right.
   Two-pronged fix: shrink the badge and reserve a narrower-but-still-
   sufficient gutter so meta chips stop before the badge. */
@media (max-width: 640px) {
  .iv-badge {
    top: .5rem;
    right: .55rem;
    font-size: .6rem;
    padding: .1rem .4rem;
    letter-spacing: .03em;
  }
  .iv-badge-se {
    font-size: .62rem;
  }
  .iv-card:has(.iv-badge) .iv-title,
  .iv-card:has(.iv-badge) .iv-card-meta {
    padding-right: 6.5rem;
  }
}

/* Very narrow (≤380px / older iPhone SE): drop the badge to a new
   line below the upvote+meta so it never overlaps anything. */
@media (max-width: 380px) {
  .iv-badge {
    position: static;
    display: inline-block;
    margin: 0 0 .4rem;
    grid-column: 2;
    justify-self: end;
  }
  .iv-card:has(.iv-badge) .iv-title,
  .iv-card:has(.iv-badge) .iv-card-meta {
    padding-right: 0;
  }
}

.iv-attribution-synthetic {
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  font-style: normal;
  color: var(--text);
}
.iv-attribution-synthetic .iv-attribution-license {
  background: var(--brand);
  color: #fff;
  border: none;
  font-weight: 600;
  margin-right: .5rem;
}

/* Compact interview cards on the company profile page */
.co-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .75rem;
}
.co-section-link {
  color: var(--brand);
  text-decoration: none;
  font-size: .9rem;
}
.co-section-link:hover { text-decoration: underline; }

.co-interviews-list {
  display: grid;
  gap: .5rem;
}
.co-iv-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem .85rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease,
              transform 180ms ease;
}
.co-iv-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-brand-sm);
  transform: translateY(-1px);
}
.co-iv-meta {
  display: flex;
  gap: .4rem;
  align-items: center;
  margin-bottom: .25rem;
  font-size: .78rem;
  color: var(--muted);
}
.co-iv-upvotes {
  margin-left: auto;
  color: var(--brand);
  font-weight: 600;
}
.co-iv-title {
  color: var(--text-strong);
  font-weight: 500;
  font-size: .95rem;
}
.co-interviews-empty {
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 1rem;
}
.co-interviews-empty a { color: var(--brand); }
