/* ── history.css — İşleme Geçmişi Sayfası ──────────────────────────────────── */

/* ── Page wrapper ────────────────────────────────────────────────────────────── */
.history-main {
  max-width: 1060px;
  margin: 0 auto;
  padding: calc(72px + 3rem) 1.5rem 5rem;
}

/* ── Page header ─────────────────────────────────────────────────────────────── */
.history-page-header {
  margin-bottom: 2.75rem;
}

.history-page-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.history-page-header p {
  color: var(--text-muted, #999);
  font-size: 0.9375rem;
  margin: 0;
  max-width: 520px;
  line-height: 1.6;
}

/* ── Navbar button (Solid Blue) ──────────────────────────────────────────────── */
.btn-primary-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #3b82f6; /* Dropzone mavisi */
  color: #fff !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary-sm:hover { background: #2563eb; transform: translateY(-1px); }

/* ── Active & History Job Cards ──────────────────────────────────────────────── */
.active-job-section { margin-bottom: 3rem; }

.active-job-card {
  background: #0f1115; /* Siyah-Gri arka plan */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  margin-bottom: 1.5rem; /* Geçmiş kartları arasına boşluk */
}

.active-job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.active-job-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.active-filename {
  font-weight: 600;
  font-size: 0.975rem;
  color: var(--text-main, #f0f0f0);
}

.time-ago {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
}

/* Status dot */
.job-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.job-status-dot.processing { background: #f59e0b; animation: blink 1.3s ease-in-out infinite; }
.job-status-dot.completed  { background: #3b82f6; /* Yeşilden maviye */ }
.job-status-dot.failed     { background: #ef4444; }

@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(245,158,11,0.6); }
  50%       { opacity: 0.35; box-shadow: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Badge */
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.badge-processing { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-completed  { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); } /* Tamamlandı badge mavisi */
.badge-failed     { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

/* ── Comparison grid ─────────────────────────────────────────────────────────── */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 680px) {
  .comparison-grid { grid-template-columns: 1fr; }
}

.comp-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.comp-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.comp-video {
  width: 100%;
  border-radius: 12px;
  background: #000;
  max-height: 340px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── Processing state (Gri Temalı) ───────────────────────────────────────────── */
.processing-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  background: #15181c; /* Koyu gri arka plan */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  min-height: 240px;
  padding: 2.25rem 1.75rem;
  position: relative;
  overflow: hidden;
}

.processing-state::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}

.processing-animation {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proc-pulse {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05); /* Gri/Beyaz pulse */
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.75); opacity: 0.9; }
  100% { transform: scale(1.5);  opacity: 0; }
}

.proc-icon {
  width: 48px;
  height: 48px;
  position: relative;
  z-index: 1;
}

.proc-status-text {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main, #f0f0f0);
  text-align: center;
  letter-spacing: -0.01em;
}

.proc-subtext {
  font-size: 0.8125rem;
  color: var(--text-muted, #888);
  text-align: center;
  line-height: 1.5;
}

/* Progress bar (Gri -> Mavi) */
.proc-bar-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.proc-bar-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.proc-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: #3b82f6; /* Sadece mavi */
}

.proc-bar-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  min-width: 2.2rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Action buttons ──────────────────────────────────────────────────────────── */
.active-job-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.75rem 1.6rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-download:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

/* ── Download dropdown ───────────────────────────────────────────────────────── */
.dl-wrap {
  position: relative;
  display: inline-block;
  margin-top: 0.75rem;
}
.dl-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  min-width: 160px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  z-index: 200;
}
.dl-wrap.open .dl-menu { display: block; }
.dl-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid #222;
  color: #e4e4e7;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.dl-opt:last-child { border-bottom: none; }
.dl-opt:hover { background: #252525; }
.dl-opt.locked { color: #666; cursor: not-allowed; }
.dl-opt.locked:hover { background: none; }
.dl-crown { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.dl-badge-pro  { font-size: 0.68rem; font-weight: 700; color: #f59e0b; background: rgba(245,158,11,0.12); padding: 2px 6px; border-radius: 4px; }
.dl-badge-max  { font-size: 0.68rem; font-weight: 700; color: #a78bfa; background: rgba(167,139,250,0.12); padding: 2px 6px; border-radius: 4px; }

.btn-reupload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-muted, #aaa);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s, border-color 0.2s;
}
.btn-reupload:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-delete-card {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: #ef4444;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(239, 68, 68, 0.3);
  transition: background 0.2s;
  cursor: pointer;
}
.btn-delete-card:hover { background: rgba(239, 68, 68, 0.1); }

/* ── History list ────────────────────────────────────────────────────────────── */
.history-list-section { margin-top: 2rem; }

.history-list-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main, #f0f0f0);
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.75rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Empty state (Gri / Mavi) ────────────────────────────────────────────────── */
.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 6rem 2rem 4rem;
  text-align: center;
}

.history-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main, #f0f0f0);
  margin: 0;
}

.history-empty-sub {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
  margin: 0;
  max-width: 320px;
  line-height: 1.6;
}

.btn-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #3b82f6; /* Mavi */
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.8rem 1.75rem;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}
.btn-empty-cta:hover { background: #2563eb; transform: translateY(-2px); }
