@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Liquid Glass Palette */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.3);
  --glass-shadow: rgba(0, 0, 0, 0.1);
  --glass-blur: 24px;

  /* Neomorphism & Depth */
  --surface: #e0e5ec;
  --surface-dark: #d1d9e6;
  --shadow-light: rgba(255, 255, 255, 0.8);
  --shadow-dark: rgba(163, 177, 198, 0.6);
  
  /* Text Colors */
  --ink: #2d3436;
  --ink-muted: #636e72;
  --ink-light: #b2bec3;

  /* Accents */
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.4);
  --accent-text: #ffffff;
  
  /* Status Colors */
  --success: #00b894;
  --error: #d63031;
  --warning: #fdcb6e;

  /* Metrics */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  
  /* Transitions */
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  background-color: var(--surface);
  color: var(--ink);
  overflow-x: hidden;
  /* Liquid Background setup */
  background: radial-gradient(circle at 0% 0%, #f6f7fb 0%, #e0e5ec 100%);
}

/* Liquid Blobs Background */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
  animation: float-liquid 20s infinite alternate ease-in-out;
}

body::before {
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -10vw;
  left: -10vw;
}

body::after {
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, #00cec9 0%, transparent 70%);
  bottom: -10vw;
  right: -10vw;
  animation-delay: -5s;
}

/* Layout */
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  gap: 40px;
  position: relative;
  z-index: 1;
}

/* NeoGlass Card Mixin */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-highlight);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 8px 32px 0 var(--glass-shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Typography */
h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Hero Section */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 0;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(135deg, var(--ink) 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.hero p {
  font-size: 1.125rem;
  color: var(--ink-muted);
  max-width: 600px;
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.badge {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--ink);
  backdrop-filter: blur(4px);
}

/* Grid Layout */
.grid-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
}

/* Neo Input Styles */
.neo-input-group {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 
    inset 6px 6px 12px var(--shadow-dark), 
    inset -6px -6px 12px var(--shadow-light);
  padding: 4px;
  transition: all 0.3s var(--ease-smooth);
}

.neo-input-group:focus-within {
  box-shadow: 
    inset 4px 4px 8px var(--shadow-dark), 
    inset -4px -4px 8px var(--shadow-light),
    0 0 0 2px var(--accent-glow);
}

input[type="url"] {
  width: 100%;
  border: none;
  background: transparent;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
}

input[type="url"]::placeholder {
  color: var(--ink-light);
}

/* Neo Button */
.neo-btn {
  border: none;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 
    8px 8px 16px var(--shadow-dark), 
    -8px -8px 16px var(--shadow-light);
  transition: all 0.2s var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.neo-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    10px 10px 20px var(--shadow-dark), 
    -10px -10px 20px var(--shadow-light);
}

.neo-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 
    inset 4px 4px 8px var(--shadow-dark), 
    inset -4px -4px 8px var(--shadow-light);
}

.neo-btn.primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 
    8px 8px 16px rgba(108, 92, 231, 0.3), 
    -8px -8px 16px rgba(255, 255, 255, 0.5);
}

.neo-btn.primary:hover:not(:disabled) {
  box-shadow: 
    0 8px 24px var(--accent-glow),
    inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.neo-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Cards */
.card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-card {
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .form-card {
    grid-column: span 1;
  }
}

/* Radio Segment */
.segment-group {
  display: flex;
  background: var(--surface);
  padding: 6px;
  border-radius: var(--radius-md);
  box-shadow: 
    inset 4px 4px 8px var(--shadow-dark), 
    inset -4px -4px 8px var(--shadow-light);
  gap: 8px;
}

.segment-option {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.segment-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segment-option span {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--ink-muted);
  transition: all 0.3s var(--ease-smooth);
}

.segment-option input:checked + span {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 
    4px 4px 8px var(--shadow-dark), 
    -4px -4px 8px var(--shadow-light);
}

/* Status Card */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.status-row:last-child {
  border-bottom: none;
}

.status-label {
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.status-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-dot.active { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-dot.idle { background: var(--ink-muted); }
.status-dot.error { background: var(--error); box-shadow: 0 0 10px var(--error); }

/* Progress Section */
.stream-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 40px;
}

@media (min-width: 900px) {
  .stream-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.progress-item {
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.progress-track {
  height: 12px;
  background: rgba(0,0,0,0.05);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a29bfe);
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width 0.3s var(--ease-smooth);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Logs */
.log-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.log-entry {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.4);
  border-left: 3px solid transparent;
  animation: slideIn 0.3s ease-out forwards;
}

.log-entry.error {
  background: rgba(214, 48, 49, 0.1);
  border-left-color: var(--error);
  color: #c0392b;
}

/* Animations */
@keyframes float-liquid {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(20px, 40px) rotate(10deg); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
