:root {
  --bg-dark: #0a0a0c;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #ef4444;
  --success: #10b981;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --header-height: 64px
}

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

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: .2s;
  border: 1px solid transparent;
  font-size: .9rem
}

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

.btn-primary:hover {
  background: #2563eb;
  filter: brightness(110%)
}

.btn-danger {
  background: var(--danger);
  color: #fff
}

.btn-danger:hover {
  background: #dc2626
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: .9rem;
  padding: 4px 8px;
  border-radius: 4px
}

.link-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  text-decoration: underline
}

.home-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center
}

.home-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: auto auto 1rem
}

.home-logo-icon {
  font-size: 3rem;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow)
}

.home-logo-text {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -.02em
}

.search-bar-home {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin-bottom: 24px
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim)
}

.search-input-home {
  width: 100%;
  padding: 18px 120px 18px 56px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-main);
  font-size: 1.1rem;
  transition: .3s
}

.search-input-home:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1)
}

.search-go-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%)
}

.trending-wrap {
  margin-top: 20px;
  max-width: 600px
}

.trending-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 12px
}

.trending-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px
}

.trending-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: .2s;
  text-decoration: none
}

.trending-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px)
}

.trending-skeleton {
  width: 80px;
  height: 28px;
  background: var(--bg-card);
  border-radius: 14px;
  animation: pulse 1.5s infinite ease-in-out
}

@keyframes pulse {

  0%,
  100% {
    opacity: .5
  }

  50% {
    opacity: 1
  }
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: transform .3s
}

.app-header[aria-hidden="true"] {
  transform: translateY(-100%)
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px
}

.logo {
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0
}

.logo-icon {
  color: var(--accent);
  font-size: 1.5rem
}

.logo-text {
  font-weight: 600;
  font-size: 1.2rem
}

.search-bar-compact {
  flex-grow: 1;
  max-width: 600px;
  position: relative
}

.search-input-compact {
  width: 100%;
  padding: 10px 48px 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main)
}

.search-btn-compact {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer
}

.results-screen {
  max-width: 800px;
  margin: calc(var(--header-height) + 20px) auto 40px;
  padding: 0 20px
}

.results-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.results-meta {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 0;
}

.share-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.share-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--accent);
}

.result-item {
  margin-bottom: 32px;
  animation: slideUp .3s ease-out forwards
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.result-link {
  text-decoration: none;
  display: block
}

.result-url {
  color: var(--text-dim);
  font-size: .85rem;
  margin-bottom: 4px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.result-title {
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 6px
}

.result-link:hover .result-title {
  text-decoration: underline
}

.result-snippet {
  color: var(--text-muted);
  font-size: .95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.result-score {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  margin-top: 8px
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.toast {
  padding: 12px 20px;
  background: #141416;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: slideIn .3s ease-out
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

.global-footer {
  margin-top: auto;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-copyright {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.home-footer {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: .85rem;
  font-weight: 500;
  animation: fadeIn 1s ease-in-out
}

.dot-sep {
  opacity: .5
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

[hidden] {
  display: none !important
}