
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b1230 0, #05030a 40%, #010005 100%);
  color: #f5f5ff;
}

.app-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.app-header h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

.app-header p {
  margin: 0;
  color: #b8b3e5;
  font-size: 0.95rem;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
}

.card {
  background: rgba(17, 12, 39, 0.95);
  border-radius: 16px;
  padding: 18px 18px 20px;
  box-shadow:
    0 0 0 1px rgba(155, 102, 255, 0.15),
    0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
}

.video-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row.inline {
  flex-direction: row;
  gap: 14px;
}

.form-row.inline > div {
  flex: 1;
}

.label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9f8fe5;
}

textarea,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(138, 104, 255, 0.35);
  background: rgba(7, 4, 20, 0.9);
  color: #f5f5ff;
  padding: 8px 10px;
  font-size: 0.95rem;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.btn-primary {
  position: relative;
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background:
    radial-gradient(circle at 20% 0, rgba(244, 114, 182, 0.7), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(129, 140, 248, 0.7), transparent 50%),
    linear-gradient(135deg, #6d28d9, #ec4899);
  box-shadow:
    0 0 18px rgba(168, 85, 247, 0.6),
    0 0 40px rgba(236, 72, 153, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow:
    0 0 10px rgba(168, 85, 247, 0.7),
    0 0 24px rgba(236, 72, 153, 0.45);
}

.btn-primary[disabled] {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.3);
  border-top-color: #f97316;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

.status-row {
  margin-top: 4px;
}

.status-text {
  font-size: 0.85rem;
  color: #e5e7eb;
  min-height: 1.4em;
}

.status-text.ok {
  color: #a5f3fc;
}

.status-text.error {
  color: #fecaca;
}

.progress-wrapper {
  margin-top: 10px;
}

.progress-label {
  font-size: 0.8rem;
  color: #a5b4fc;
  margin-bottom: 4px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(24, 18, 54, 0.9);
  overflow: hidden;
  box-shadow: 0 0 18px rgba(180, 83, 246, 0.5);
}

.progress-inner {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a855ff, #e11d48, #f97316, #a855ff);
  background-size: 200% 100%;
  animation: pulseBar 1.4s ease-in-out infinite;
}

.output-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: #e0e7ff;
}

.video-container {
  border-radius: 12px;
  background: radial-gradient(circle at top, #111827 0, #020617 60%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 10px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-container video {
  max-width: 100%;
  border-radius: 10px;
  outline: none;
}

.placeholder {
  font-size: 0.9rem;
  color: #9ca3af;
  text-align: center;
}

.download-link {
  display: inline-flex;
  margin-top: 10px;
  font-size: 0.9rem;
  color: #c4b5fd;
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(196, 181, 253, 0.5);
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
}

.download-link:hover {
  background: rgba(30, 64, 175, 0.7);
}

.app-footer {
  margin-top: 26px;
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
}

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

@keyframes pulseBar {
  0% {
    width: 10%;
    transform: translateX(-10%);
    background-position: 0 0;
  }
  50% {
    width: 65%;
    transform: translateX(20%);
    background-position: 100% 0;
  }
  100% {
    width: 100%;
    transform: translateX(100%);
    background-position: 0 0;
  }
}

@media (max-width: 860px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }
}


.hint{
  margin-top: 6px;
  font-size: 0.85rem;
  color: #b8b3e5;
  line-height: 1.35;
}

input[type="file"], input[type="number"]{
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(138, 104, 255, 0.35);
  background: rgba(7, 4, 20, 0.9);
  color: #f5f5ff;
  padding: 8px 10px;
  font-size: 0.95rem;
  outline: none;
}

.progress-label{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
}

.progress-pct{
  font-variant-numeric: tabular-nums;
  color: #d9d5ff;
  opacity: 0.9;
}

.debug-header{
  margin-top: 18px;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
}

.debug-header h3{
  margin: 0;
  font-size: 1.05rem;
}

.debug-actions{
  display:flex;
  gap: 8px;
}

.btn-secondary{
  border-radius: 10px;
  border: 1px solid rgba(138, 104, 255, 0.35);
  background: rgba(7, 4, 20, 0.6);
  color: #f5f5ff;
  padding: 8px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-secondary:hover{
  background: rgba(138, 104, 255, 0.18);
}

.debug-console{
  margin: 10px 0 0;
  height: 220px;
  overflow: auto;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(138, 104, 255, 0.25);
  background: rgba(0,0,0,0.35);
  color: #f5f5ff;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

