:root {
  --bg-primary: #070a12;
  --bg-surface: rgba(14, 20, 34, 0.75);
  --bg-surface-elevated: rgba(22, 31, 52, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-glow: rgba(99, 102, 241, 0.25);

  --accent-primary: #4f46e5;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  --accent-hover: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #38bdf8;

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --shadow-card: 0 24px 48px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-btn: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 20px 80px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Backdrops */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  top: -120px;
  left: 20%;
  width: 500px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
}

.glow-2 {
  top: 15%;
  right: 15%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
}

.glow-3 {
  bottom: 10%;
  left: 30%;
  width: 600px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}

.app-container {
  width: 100%;
  max-width: 820px;
  position: relative;
  z-index: 1;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 36px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #34d399;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.main-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-subtitle {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 24px;
}

.main-subtitle strong {
  color: #e2e8f0;
}

/* Providers Bar */
.providers-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.provider-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  transition: all 0.25s ease;
  cursor: pointer;
  user-select: none;
}

.provider-pill:hover, .provider-pill.active {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.provider-pill.active {
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.pill-dot.gofile { background-color: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.pill-dot.gdrive { background-color: #34d399; box-shadow: 0 0 8px #34d399; }
.pill-dot.mediafire { background-color: #60a5fa; box-shadow: 0 0 8px #60a5fa; }
.pill-dot.mega { background-color: #f87171; box-shadow: 0 0 8px #f87171; }
.pill-dot.anonfiles { background-color: #c084fc; box-shadow: 0 0 8px #c084fc; }
.pill-dot.pixeldrain { background-color: #fbbf24; box-shadow: 0 0 8px #fbbf24; }

/* Glass Cards */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card);
  padding: 30px;
  margin-bottom: 24px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Form & Input */
.input-container {
  margin-bottom: 22px;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.input-header label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #e2e8f0;
}

.auto-detect-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s ease;
}

.auto-detect-label.detected {
  color: #38bdf8;
  font-weight: 600;
}

.input-field-wrapper {
  display: flex;
  align-items: center;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px 12px;
  transition: all 0.25s ease;
}

.input-field-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--border-glow);
}

.input-prefix-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding-left: 4px;
  padding-right: 12px;
  transition: color 0.2s ease;
}

.input-field-wrapper:focus-within .input-prefix-icon {
  color: #60a5fa;
}

.input-field-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-family: var(--font-sans);
  padding: 10px 0;
}

.input-field-wrapper input::placeholder {
  color: #475569;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.pill-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Quick Examples */
.quick-examples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.examples-tag {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.example-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.example-btn:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.08);
}

/* Submit Button */
.primary-gradient-btn {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-lg);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-sans);
  padding: 14px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-btn);
  transition: all 0.25s ease;
}

.primary-gradient-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(99, 102, 241, 0.5);
}

.primary-gradient-btn:active {
  transform: translateY(0);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Error Card */
.error-glass-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.error-badge-icon {
  font-size: 1.6rem;
}

.error-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 6px;
}

.error-content p {
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.5;
  white-space: pre-line;
}

/* Results Wrapper */
.results-wrapper {
  margin-top: 24px;
}

.result-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.file-lead {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.file-icon-square {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  flex-shrink: 0;
}

.file-title-wrap {
  min-width: 0;
}

.file-name-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  word-break: break-all;
  color: #ffffff;
  margin-bottom: 3px;
}

.file-mime-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.result-top-badges {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.meta-tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.provider-tag {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.size-tag {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #67e8f9;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.metric-card {
  background: rgba(8, 12, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.metric-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
}

.metric-value.mono {
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.metric-value.highlight {
  color: #38bdf8;
  font-size: 0.86rem;
}

.card-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 20px 0;
}

/* Direct Stream Link Block */
.stream-url-block {
  margin-bottom: 24px;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
}

.pill-mini {
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: 9999px;
}

.hint-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stream-input-row {
  display: flex;
  gap: 10px;
}

.code-font-input {
  flex: 1;
  background: rgba(8, 12, 22, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
}

.action-btn-copy, .action-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  font-family: var(--font-sans);
  padding: 0 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.action-btn-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.action-btn-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

.action-btn-download {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.35);
}

.action-btn-download:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

/* Terminal Switcher */
.terminal-command-block {
  background: #060910;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
}

.terminal-tabs {
  display: flex;
  gap: 4px;
}

.term-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.term-tab:hover {
  color: #e2e8f0;
}

.term-tab.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.copy-term-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.copy-term-btn:hover {
  color: #ffffff;
}

.terminal-body {
  padding: 14px 16px;
  overflow-x: auto;
}

.mono-code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #e2e8f0;
  white-space: pre;
}

/* Folder Results */
.folder-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.folder-subtitle-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.folder-items-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.folder-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 12, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.folder-row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.folder-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
  word-break: break-all;
}

.folder-item-size {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.feature-card {
  background: rgba(14, 20, 34, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(16px);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.feature-card code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
}

/* Footer */
.app-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #60a5fa;
}

.footer-credit {
  font-size: 0.78rem;
  color: #475569;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 24px 12px 60px;
  }

  .main-title {
    font-size: 2rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .stream-input-row {
    flex-direction: column;
  }

  .action-btn-copy, .action-btn-download {
    padding: 12px;
  }
}
