:root {
  --bg-color: #f7f7f8;
  --text-primary: #0a0a0b;
  --text-secondary: #6e6e73;
  --accent-primary: #4f46e5;
  --accent-hover: #4338ca;
  --border-color: rgba(0, 0, 0, 0.08);
  --glow-color: rgba(79, 70, 229, 0.15);
  --transition-base: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  padding: 40px 24px;
}

/* Hero Section */
.hero {
  text-align: center;
  max-width: 900px;
  margin-bottom: 0;
  animation: fadeIn 0.8s var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.hero h1 {
  font-size: 64px;
  font-weight: 850;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  line-height: 1.1;
  max-width: 1000px;
}

.hero p {
  font-size: 20px;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 850px;
  margin-bottom: 48px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 16px;
  opacity: 0.8;
}

/* Segmented Control (Format Switcher) */
.format-switcher {
  background: rgba(0, 0, 0, 0.04);
  padding: 4px;
  border-radius: 14px;
  display: flex;
  position: relative;
  margin-bottom: 24px;
  width: fit-content;
  user-select: none;
}

.switcher-item {
  padding: 8px 24px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 2;
  transition: color 0.3s ease;
}

.switcher-item.active {
  color: var(--text-primary);
}

.switcher-glider {
  position: absolute;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  background: white;
  left: 4px;
  top: 4px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.format-switcher.audio-active .switcher-glider {
  transform: translateX(100%);
}

/* Main Input Area */
/* Main Input Area - Premium Command Center */
.input-container {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px;
  display: flex;
  align-items: center;
  transition: var(--transition-base);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
  margin-top: 8px;
}

.input-container:focus-within {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: 0 20px 50px rgba(79, 70, 229, 0.1), 0 4px 15px rgba(0, 0, 0, 0.05);
}

.input-container:has(.url-input:not(:placeholder-shown)) {
  border-color: var(--accent-primary);
  box-shadow: 0 15px 35px rgba(79, 70, 229, 0.08);
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  color: #9ea0a5;
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: var(--transition-base);
  z-index: 5;
}

.input-container:focus-within .search-icon {
  color: var(--accent-primary);
  transform: scale(1.1);
}

.url-input {
  flex: 1;
  height: 56px;
  border: none;
  outline: none;
  padding: 0 16px 0 52px;
  font-size: 17px;
  font-weight: 500;
  background: transparent;
  color: var(--text-primary);
  width: 100%;
}

.url-input::placeholder {
  color: #9ea0a5;
  font-weight: 400;
}

.action-btns {
  display: flex;
  gap: 8px;
}

.btn {
  height: 54px;
  padding: 0 28px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary.is-processing {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-primary.is-processing::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: calc(50% - 10px);
  left: calc(50% - 10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
}

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

.btn-secondary {
  background-color: #f1f1f2;
  color: var(--text-primary);
}

/* Integrated Progress Bar */
.progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  pointer-events: none;
}

/* Results Grid (3 Horizontal Cards) */
.results-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin-top: 24px;
  perspective: 1000px;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition-base);
  animation: slideUp 0.6s var(--transition-base) both;
}

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

.result-card:hover {
  background: #ffffff;
  border-color: var(--accent-primary);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.result-thumb {
  width: 110px;
  height: 62px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.result-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-channel {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.result-action {
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-right: 8px;
  opacity: 0;
  transition: var(--transition-base);
}

.result-card:hover .result-action {
  opacity: 1;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s;
}

/* Real-Time Progress Container */
.progress-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  height: 0;
  transform: translateY(10px);
  transition: var(--transition-base);
  pointer-events: none;
  overflow: hidden;
}

.progress-container.active {
  opacity: 1;
  height: auto;
  margin-top: 32px;
  transform: translateY(0);
}

.progress-status {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition-base);
  text-align: center;
  max-width: 400px;
}

.progress-container.success .progress-status {
  color: #34c759;
}

/* Premium Pulse Animation for Waiting State */
@keyframes ringPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--glow-color)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 0 15px var(--accent-primary)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--glow-color)); }
}

.progress-container.is-waiting {
  animation: ringPulse 2s infinite ease-in-out;
}

.progress-container.is-waiting .progress-ring-fill {
  stroke-opacity: 0.8;
}

/* Pulse Animation */
@keyframes successPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(52, 199, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

.input-container.pulse-success {
  animation: successPulse 1s ease-out;
}

/* Trust Strip - Premium Badge System */
.trust-strip {
  margin-top: -20px;
  margin-bottom: 48px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeIn 1s var(--transition-base) both;
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.02);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition-base);
}

.trust-strip span::before {
  content: '';
  width: 6px;
  height: 10px;
  border-right: 2px solid var(--accent-primary);
  border-bottom: 2px solid var(--accent-primary);
  transform: rotate(45deg);
  margin-top: -2px;
  opacity: 0.8;
}

.trust-strip span:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
  color: var(--text-primary);
}

/* Remove dot styling as we are using badges now */
.dot { display: none; }

/* Extension Section - Permanent UI element */
.extension-promo {
  margin-top: 32px;
  padding: 40px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 40px;
  text-align: center;
  width: 100%;
  max-width: 800px;
  transition: var(--transition-base);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
}

.extension-promo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #4285F4, #34A853, #FBBC05, #EA4335); /* Chrome Colors */
  opacity: 0.8;
}

.chrome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #5f6368;
  margin-bottom: 24px;
}

.browser-mockup {
  margin: 32px auto;
  width: 280px;
  height: 160px;
  background: #f1f1f2;
  border: 1px solid var(--border-color);
  border-radius: 16px 16px 0 0;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.browser-header {
  height: 24px;
  background: #e5e5ea;
  border-bottom: 1px solid var(--border-color);
  border-radius: 15px 15px 0 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}

.browser-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff5f57; }
.browser-dot:nth-child(2) { background: #febc2e; }
.browser-dot:nth-child(3) { background: #28c840; }

.browser-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-line { height: 8px; background: #e5e5ea; border-radius: 4px; width: 80%; }
.mock-line.short { width: 40%; }

.extension-icon-mock {
  position: absolute;
  top: 35px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--accent-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
  animation: pulseGhost 2s infinite ease-in-out;
}

@keyframes pulseGhost {
  0% { transform: scale(1); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); }
  50% { transform: scale(1.1); box-shadow: 0 12px 30px rgba(79, 70, 229, 0.5); }
  100% { transform: scale(1); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); }
}

.extension-promo h2 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.extension-promo p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 32px auto;
  line-height: 1.6;
}

.extension-promo:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.btn-outline {
  height: 54px;
  padding: 0 28px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid var(--border-color);
  font-weight: 600;
  cursor: pointer;
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Modal System */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  width: 90%;
  max-width: 800px;
  border-radius: 32px;
  padding: 48px;
  position: relative;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.2);
}

.modal.active .modal-card {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: #f5f5f7;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
}

.close-modal:hover {
  background: #e5e5ea;
  transform: rotate(90deg);
}

.btn-guide {
  background: #f1f1f2;
  color: var(--text-primary);
  margin-left: 12px;
}

.btn-guide:hover {
  background: #e5e5ea;
  transform: translateY(-1px);
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.guide-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: var(--transition-base);
}

.guide-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-primary);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 20px;
}

.guide-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.guide-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

footer {
  margin-top: 40px;
  padding: 48px 0;
  font-size: 13px;
  color: #aeaeb2;
  text-align: center;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 40px; }
  .input-container { flex-direction: column; padding: 16px; height: auto; }
  .url-input { width: 100%; height: 56px; padding: 0; text-align: center; margin-bottom: 16px; }
  .action-btns { width: 100%; flex-direction: column; }
  .btn { width: 100%; }
}
/* Floating Bookmark Button */
.bookmark-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: var(--transition-base);
}

.bookmark-fab:hover {
  background: #ffffff;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--accent-primary);
}

.star-icon {
  color: #fbbf24;
  font-size: 18px;
}

/* Smart Tooltip */
.bookmark-tooltip {
  position: fixed;
  bottom: 85px;
  right: 32px;
  background: #111827;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition-base);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.bookmark-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .bookmark-fab {
    bottom: 24px;
    right: 20px;
    padding: 10px 16px;
  }
  .bookmark-tooltip {
    right: 20px;
    bottom: 75px;
  }
}

/* Premium Auth Gate */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(247, 247, 248, 0.7);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s var(--transition-base), visibility 0.8s var(--transition-base);
}

.auth-gate.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  background: #ffffff;
  padding: 48px;
  border-radius: 32px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  animation: fadeInUp 0.8s var(--transition-base);
}

.auth-icon {
  font-size: 40px;
  margin-bottom: 24px;
}

.auth-card h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.auth-card p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.6;
}

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

.auth-form input {
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  padding: 0 20px;
  font-size: 16px;
  text-align: center;
  transition: var(--transition-base);
  background: #fdfdfd;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--glow-color);
}

.auth-error {
  margin-top: 16px;
  color: #ff3b30;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transition: var(--transition-base);
}

.auth-error.show {
  opacity: 1;
}

.auth-card.shake {
  animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
/* --- Responsive Design (Mobile Optimization) --- */
@media (max-width: 768px) {
  body {
    padding: 0;
    display: block; /* Remove centering flex for easier vertical flow on mobile */
  }

  .page-wrapper {
    padding: 20px 16px;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }

  .hero {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 8px;
  }

  .hero h1 {
    font-size: 32px !important; /* Force smaller size */
    line-height: 1.2;
    max-width: 100% !important;
    margin-bottom: 12px;
  }

  .hero p {
    font-size: 15px;
    padding: 0 10px;
  }

  .input-container {
    width: 130% !important; /* Slightly wider to match hero scale */
    transform: translateX(-11.5%); /* Re-center the wider container */
    max-width: 100vw !important;
    padding: 6px !important;
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
    position: relative !important;
  }

  .input-wrapper {
    flex: 1 !important;
    min-width: 0 !important; /* Allow it to shrink if needed */
    display: flex !important;
    position: relative !important;
  }

  .url-input {
    width: 100% !important;
    height: 48px !important;
    padding: 0 12px 0 44px !important;
    font-size: 15px !important;
    border: none !important;
    background: transparent !important;
  }

  .search-icon {
    left: 14px !important;
    z-index: 10 !important;
  }

  .action-btns {
    flex-shrink: 0 !important;
    margin-left: 8px !important;
  }

  .btn-primary {
    width: auto !important;
    min-width: 90px !important;
    height: 44px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
  }

  .results-grid {
    width: 100% !important;
    padding: 0 4px;
  }

  .result-card {
    padding: 8px;
    border-radius: 12px;
  }

  .result-card img {
    width: 80px;
    height: 60px;
    min-width: 80px;
  }

  .result-info h3 {
    font-size: 14px;
  }

  .extension-promo {
    width: 100% !important;
    max-width: 100% !important;
    padding: 30px 16px !important;
    border-radius: 24px !important;
    margin-top: 24px !important;
  }

  .extension-promo h2 {
    font-size: 24px;
  }

  .browser-mockup {
    display: none; /* Hide mockup on smaller mobile to save space */
  }
}
@media (max-width: 480px) {
  .auth-card {
    padding: 32px 24px;
    margin: 20px;
  }
}
