@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-color: #090b10;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1a103c 0%, #090b10 70%);
  --card-bg: rgba(18, 22, 33, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-glow: rgba(139, 92, 246, 0.3);
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.4);
  
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glows */
body::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.app-container {
  width: 100%;
  max-width: 900px;
  padding: 40px 20px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand-header-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
  border: 1px solid rgba(139, 92, 246, 0.4);
  object-fit: cover;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
}

.brand-badge span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 30%, #a78bfa 70%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
}

.platforms-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.platform-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.platform-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}

.platform-chip svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.15);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  align-items: center;
  background: rgba(9, 11, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 6px 6px 6px 16px;
  transition: var(--transition-smooth);
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.input-icon {
  color: var(--text-dim);
  margin-right: 12px;
  display: flex;
}

.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 1.05rem;
  font-family: inherit;
}

.btn-paste {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
  transition: var(--transition-smooth);
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-fetch {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: var(--transition-smooth);
}

.btn-fetch:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.preview-container {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.preview-container.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.media-preview-card {
  display: flex;
  gap: 24px;
}

@media (max-width: 650px) {
  .media-preview-card { flex-direction: column; }
}

.thumbnail-wrapper {
  position: relative;
  width: 260px;
  height: 150px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.media-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.media-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  line-height: 1.4;
  color: #fff;
}

.media-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.format-selection {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.section-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tab-selector {
  display: flex;
  gap: 8px;
  background: rgba(9, 11, 16, 0.5);
  padding: 4px;
  border-radius: var(--radius-md);
  width: fit-content;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Watermark Bar Selector */
.watermark-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.watermark-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.watermark-options {
  display: flex;
  gap: 8px;
}

.watermark-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.watermark-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.watermark-btn.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.quality-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quality-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
}

.quality-btn.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.quality-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.quality-tag {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.btn-download-action {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  transition: var(--transition-smooth);
}

.btn-download-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6);
}

.progress-container {
  display: none;
  margin-top: 20px;
}

.progress-container.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.progress-title { font-weight: 600; color: #fff; }
.progress-percent { font-family: 'Outfit', sans-serif; font-weight: 700; color: var(--accent-cyan); }

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-cyan) 100%);
  border-radius: 100px;
  transition: width 0.2s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-cancel {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn-cancel:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.ready-container {
  display: none;
  text-align: center;
  padding: 24px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  margin-top: 20px;
}

.ready-container.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.4s ease;
}

.btn-file-save {
  background: #10b981;
  color: white;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-file-save:hover {
  background: #059669;
  transform: translateY(-2px);
}

footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 30px;
}
