@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  src: url("/fonts/Poppins-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  src: url("/fonts/Poppins-Bold.ttf") format("truetype");
}

:root {
  color-scheme: light;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(180deg, rgba(19, 27, 99, 0.12) 0%, #ffffff 100%);
  color: #0c1038;
  --brand-50: #eef0ff;
  --brand-100: #d9defa;
  --brand-200: #b5bff1;
  --brand-500: #3b4cc1;
  --brand-600: #131b63;
  --brand-700: #111855;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: inherit;
}

.app {
  max-width: 980px;
  margin: 40px auto;
  padding: 28px;
}

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

header img {
  width: 48px;
  height: 48px;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

header p {
  margin: 6px 0 0 0;
  color: var(--gray-500);
}

.header-content {
  flex: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-100);
  color: var(--brand-700);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.card {
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 12px 30px rgba(15, 20, 70, 0.08);
}

.jobs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: 20px 0;
}

.jobs-header h2 {
  margin: 0 0 6px 0;
  font-size: 1.4rem;
}

.helper {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.empty-state {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.jobs-list {
  display: grid;
  gap: 18px;
}

.video-card {
  margin-bottom: 0;
}

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

.video-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.video-subtitle {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-top: 4px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-500);
  white-space: nowrap;
}

.status-uploading,
.status-transcribing,
.status-auditing,
.status-queued,
.status-uploaded {
  background: var(--brand-100);
  color: var(--brand-700);
}

.status-completed {
  background: #dcfce7;
  color: #166534;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

.progress-grid {
  margin: 12px 0 4px;
}

.video-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.video-details {
  margin-top: 12px;
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
}

.video-details.hidden {
  display: none;
}

.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.85rem;
  padding: 6px 0;
  color: var(--gray-500);
}

.detail-value {
  color: var(--brand-700);
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-section {
  margin-top: 12px;
}

.detail-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.auth-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
  min-width: 220px;
}

.auth-status {
  font-weight: 600;
  color: var(--brand-700);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.auth-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px dashed var(--brand-200);
  border-radius: 12px;
  cursor: pointer;
  background: var(--gray-50);
  color: var(--brand-700);
  font-weight: 600;
}

.file-picker.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.file-picker input {
  display: none;
}

button {
  background: var(--brand-600);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(19, 27, 99, 0.25);
}

button.button-secondary {
  background: #ffffff;
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  box-shadow: none;
}

button.button-ghost {
  background: transparent;
  color: var(--brand-700);
  border: 1px solid transparent;
  box-shadow: none;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.progress-row {
  display: grid;
  grid-template-columns: 110px 1fr 60px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--gray-500);
}

progress {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
}

progress::-webkit-progress-bar {
  background-color: var(--gray-100);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
  border-radius: 999px;
}

pre {
  white-space: pre-wrap;
  background: var(--gray-50);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  max-height: 320px;
  overflow: auto;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-box {
    align-items: flex-start;
    text-align: left;
  }

  .jobs-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .progress-row {
    grid-template-columns: 90px 1fr 50px;
  }
}
