/* MarkItDown Converter — custom styles */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0f172a;
  min-height: 100vh;
}

/* ── Animated gradient background ── */
.bg-gradient-animated {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Glass card ── */
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed rgba(139, 92, 246, 0.4);
  border-radius: 1rem;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.08);
  transform: scale(1.005);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.15);
}

.drop-zone.drag-over::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(139, 92, 246, 0.06);
  pointer-events: none;
}

/* ── Upload icon pulse ── */
.upload-icon {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ── Progress bar ── */
.progress-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  transition: width 0.3s ease;
}

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-waiting    { background: rgba(100,116,139,0.2); color: #94a3b8; }
.badge-uploading  { background: rgba(59,130,246,0.2);  color: #60a5fa; }
.badge-converting { background: rgba(245,158,11,0.2);  color: #fbbf24; }
.badge-completed  { background: rgba(16,185,129,0.2);  color: #34d399; }
.badge-failed     { background: rgba(239,68,68,0.2);   color: #f87171; }

/* ── Spinner ── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Queue item ── */
.queue-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.75rem;
  transition: border-color 0.2s;
}

.queue-item.completed { border-color: rgba(16,185,129,0.25); }
.queue-item.failed    { border-color: rgba(239,68,68,0.25); }
.queue-item.active    { border-color: rgba(139,92,246,0.35); }

/* ── Success flash ── */
@keyframes successFlash {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  70%  { box-shadow: 0 0 0 12px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.flash-success {
  animation: successFlash 0.8s ease-out;
}

/* ── Buttons ── */
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover   { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active  { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-secondary:hover  { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); }

.btn-icon {
  background: rgba(139,92,246,0.15);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 0.4rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-icon:hover { background: rgba(139,92,246,0.25); }

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.4); border-radius: 999px; }

/* ── Toast notifications ── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.1rem;
  border-radius: 0.625rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 320px;
  pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
}

.toast-success { background: rgba(16,185,129,0.85); border: 1px solid rgba(16,185,129,0.4); }
.toast-error   { background: rgba(239,68,68,0.85);  border: 1px solid rgba(239,68,68,0.4); }
.toast-info    { background: rgba(59,130,246,0.85);  border: 1px solid rgba(59,130,246,0.4); }

@keyframes toastIn  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; pointer-events: none; } }

/* ── History items ── */
.history-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ── API status dot ── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online  { background: #34d399; box-shadow: 0 0 6px #34d39988; }
.status-dot.offline { background: #f87171; box-shadow: 0 0 6px #f8717188; }
.status-dot.checking {
  background: #fbbf24;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Gradient text ── */
.gradient-text {
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
  .drop-zone { padding: 2rem 1rem; }
  .queue-item { padding: 0.75rem; }
}

/* ── Subtle grid overlay ── */
.grid-overlay {
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Section headings ── */
.section-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

/* ── File size badge ── */
.file-size {
  font-size: 0.72rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* ── Truncate long filenames ── */
.filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

@media (max-width: 480px) {
  .filename { max-width: 140px; }
}
