/* These styles are generated from project.scss. */

/* ──────────────────────────────────────────────────────────────────────
   FoxPop 1.0 brand
   ────────────────────────────────────────────────────────────────────── */

:root {
  --foxpop-green: #4f785a;
  --foxpop-green-dark: #3d5d46;
  --stage-pending: #e5e7eb;
  --stage-pending-text: #6b7280;
  --stage-current: #fbbf24;
  --stage-done: var(--foxpop-green);
  --stage-skipped: #d1d5db;
  --stage-rejected: #dc2626;
}

/* ──────────────────────────────────────────────────────────────────────
   Per-recording 5-step stage progress bar (issue #321)
   Used on the recordings page, on every recording card.
   ────────────────────────────────────────────────────────────────────── */

.stage-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 12px 0 4px;
  padding: 0;
  font-size: 0.78rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.stage-step {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  text-align: center;
  position: relative;
  font-weight: 500;
  color: var(--stage-pending-text);
  background: transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-right: 1px solid #e5e7eb;
  white-space: nowrap;
}

.stage-step:last-child {
  border-right: none;
}

.stage-step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1;
}

.stage-step--done {
  background: var(--stage-done);
  color: #fff;
}
.stage-step--done .stage-step__icon {
  background: rgba(255, 255, 255, 0.25);
}

.stage-step--current {
  background: repeating-linear-gradient(
    45deg,
    var(--stage-current),
    var(--stage-current) 8px,
    #fde68a 8px,
    #fde68a 16px
  );
  background-size: 22px 22px;
  color: #78350f;
  animation: stage-current-stripe 1.2s linear infinite;
}
.stage-step--current .stage-step__icon {
  background: rgba(120, 53, 15, 0.18);
}

@keyframes stage-current-stripe {
  0%   { background-position: 0 0; }
  100% { background-position: 22px 0; }
}

.stage-step--pending {
  background: transparent;
  color: var(--stage-pending-text);
}

.stage-step--skipped {
  background: var(--stage-skipped);
  color: #6b7280;
  opacity: 0.7;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.stage-step--rejected {
  background: var(--stage-rejected);
  color: #fff;
  font-weight: 600;
}
.stage-step--rejected .stage-step__icon {
  background: rgba(255, 255, 255, 0.28);
}

.stage-progress__reject-reason {
  font-size: 0.78rem;
  color: var(--stage-rejected);
  margin: 4px 0 8px 4px;
  font-style: italic;
}

/* Mobile: stack vertically when the cards get narrow */
@media (max-width: 576px) {
  .stage-step__label {
    display: none;
  }
  .stage-step {
    padding: 8px 4px;
  }
}

/* ──────────────────────────────────────────────────────────────────────
   Poll-level aggregate pipeline progress bar (issue #321)
   Sits at the top of the recordings page. 5 stacked horizontal rows,
   one per pipeline stage.
   ────────────────────────────────────────────────────────────────────── */

.poll-pipeline {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.poll-pipeline__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.poll-pipeline__title {
  font-weight: 600;
  color: #111827;
}

.poll-pipeline__total {
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

.poll-pipeline__row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.poll-pipeline__row-label {
  color: #374151;
  font-weight: 500;
}

.poll-pipeline__row-bar {
  position: relative;
  height: 18px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.poll-pipeline__row-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  transition: width 0.6s ease;
  border-radius: 999px;
}

.poll-pipeline__row-rejected {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    var(--stage-rejected),
    var(--stage-rejected) 4px,
    #fca5a5 4px,
    #fca5a5 8px
  );
  opacity: 0.85;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.poll-pipeline__row-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #111827;
  font-weight: 500;
}

.poll-pipeline__footer {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
}

.poll-pipeline__pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--foxpop-green);
  box-shadow: 0 0 0 0 rgba(79, 120, 90, 0.6);
  animation: pipeline-pulse 1.5s infinite;
}

@keyframes pipeline-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(79, 120, 90, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(79, 120, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 120, 90, 0); }
}

@media (max-width: 768px) {
  .poll-pipeline__row {
    grid-template-columns: 90px 1fr 70px;
    font-size: 0.78rem;
  }
}

/* ──────────────────────────────────────────────────────────────────────
   Text content flash — used by the JS poller when a card's
   transcription or translation field receives fresh content.
   Issue #321.
   ────────────────────────────────────────────────────────────────────── */
.text-content--just-updated {
  animation: text-flash 1.6s ease-out;
}

@keyframes text-flash {
  0%   { background-color: rgba(79, 120, 90, 0.25); }
  100% { background-color: transparent; }
}

/* ──────────────────────────────────────────────────────────────────────
   Pipeline-complete toast — light notification that shows after the
   pipeline finishes. Bottom-right of screen, dismissable.
   ────────────────────────────────────────────────────────────────────── */
.pipeline-complete-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--foxpop-green);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  max-width: 420px;
  animation: toast-slide-in 0.3s ease-out;
}

@keyframes toast-slide-in {
  0%   { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.pipeline-complete-toast__icon {
  font-weight: 700;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.18);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pipeline-complete-toast__msg {
  flex: 1;
  line-height: 1.4;
}

.pipeline-complete-toast__close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  opacity: 0.8;
}
.pipeline-complete-toast__close:hover {
  opacity: 1;
}

/* ──────────────────────────────────────────────────────────────────────
   Completion toast — shown when pipeline transitions active → idle.
   Soft-prompts a page reload so new transcriptions appear in cards.
   ────────────────────────────────────────────────────────────────────── */

.pipeline-complete-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--foxpop-green);
  border-left: 4px solid var(--foxpop-green);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  max-width: 480px;
  animation: toast-slide-in 0.4s ease-out;
}

.pipeline-complete-toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--foxpop-green);
  color: #fff;
  font-weight: 700;
}

.pipeline-complete-toast__msg {
  color: #111827;
  flex: 1;
}

.pipeline-complete-toast__cancel {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #6b7280;
}

.pipeline-complete-toast__cancel:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar.bg-light {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.navbar-brand img {
  height: 56px !important;
}

.navbar .nav-link {
  color: var(--foxpop-green) !important;
  font-weight: 600;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--foxpop-green-dark) !important;
}

/* ──────────────────────────────────────────────────────────────────── */

.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

/* Audio Recordings Styles */
.recording-card {
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Only apply hover effect when no modal is open */
body:not(.modal-open) .recording-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 16px 20px;
}

.session-id {
  font-size: 0.9rem;
  color: #6c757d;
  font-family: monospace;
}

.badge-option {
  background-color: #6c757d;
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-left: 10px;
}

.card-body {
  padding: 20px;
}

.text-section {
  margin-bottom: 15px;
  border-left: 3px solid #dee2e6;
  padding-left: 15px;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.text-content {
  color: #212529;
  line-height: 1.5;
}

.audio-player {
  margin: 15px 0;
  width: 100%;
}

.action-section {
  display: flex;
  justify-content: space-between;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.comment-section, .rating-section {
  flex: 1;
  padding: 0 10px;
}

.btn-action {
  border-radius: 20px;
  padding: 5px 15px;
  font-size: 0.9rem;
}

.star-rating {
  display: flex;
  flex-direction: row-reverse;
  font-size: 1.5rem;
  justify-content: flex-end;
  padding: 0 0.2em;
  text-align: center;
}

.star-rating input {
  display: none;
}

.star-rating label {
  color: #ccc;
  cursor: pointer;
  padding: 0 0.1em;
  transition: color 0.3s;
}

.star-rating input:checked~label {
  color: #f90;
}

.star-rating label:hover,
.star-rating label:hover~label {
  color: #fc0;
}

.star-display {
  font-size: 1.2rem;
  color: #ffc107;
}

.comment-text {
  font-style: italic;
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
  margin-top: 5px;
}

.page-header {
  margin-bottom: 30px;
}

.header-title {
  font-weight: 600;
  margin-bottom: 15px;
}

.header-actions {
  margin-bottom: 20px;
}

.btn-main {
  border-radius: 20px;
  padding: 8px 20px;
  font-weight: 500;
  margin-right: 10px;
}

/* Modal customizations */
.modal-content {
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.modal-title {
  font-weight: 600;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
}

/* Fix for modal blinking issue */
.modal {
  z-index: 1050;
}

.modal-backdrop {
  z-index: 1040;
}

.modal-open .recording-card {
  transform: none !important;
  transition: none !important;
}
