/*
  Shared CSS for newsite static pages.
  Goals:
  - No inline <style> needed (CSP-friendly)
  - Page-specific body layout is scoped via body class: .page-home/.page-plans/.page-signin
*/

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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  --bg-card: #1c1c1c;
  --bg-hover: #252525;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-green: #22c55e;
  --accent-green-hover: #16a34a;
  --accent-green-light: #4ade80;
  --border-color: #27272a;
  --border-light: #3f3f46;
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.is-hidden {
  display: none !important;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Mobile bottom nav (shown under 768px) */
.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(39, 39, 42, 0.85);
  z-index: 300;
}

.mobile-nav-inner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-nav-item {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.mobile-nav-item:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.85);
  outline-offset: 2px;
}

.mobile-nav-icon {
  width: 22px;
  height: 22px;
  color: currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-home .mobile-nav-item--home,
.page-plans .mobile-nav-item--plans {
  color: var(--text-primary);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.page-home .mobile-nav-item--home .mobile-nav-icon,
.page-plans .mobile-nav-item--plans .mobile-nav-icon {
  color: var(--accent-green);
}

/* Sidebar */
.sidebar {
  width: 68px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.3s ease;
}

.sidebar-logo {
  margin-bottom: 16px;
  cursor: pointer;
}

.sidebar-logo svg {
  width: 40px;
  height: 40px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  flex: 1;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 0 6px;
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--accent-green);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent-green);
  border-radius: 0 2px 2px 0;
}

.nav-item.active .nav-icon {
  color: var(--accent-green);
}

.nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover .nav-icon {
  color: var(--text-primary);
}

.nav-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.nav-item.active .nav-label {
  color: var(--accent-green);
}

.nav-item:hover .nav-label {
  color: var(--text-primary);
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.pricing-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 6px;
  margin: 6px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.pricing-card:hover {
  border-color: var(--accent-green);
}

.pricing-text {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.pricing-subtext {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Main content shared */
.main-content {
  flex: 1;
  margin-left: 68px;
  min-height: 100vh;
}

/* Tooltip (apply to any element with data-tooltip) */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  z-index: 1000;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 8px);
}

/* Notifications (no inline styles, CSP-friendly) */
.nb-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
}

.nb-notification--in {
  animation: nbSlideUp 0.3s ease forwards;
}

.nb-notification--out {
  animation: nbSlideDown 0.3s ease forwards;
}

@keyframes nbSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes nbSlideDown {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* Home page */
.hero-section {
  padding: 16px 20px;
  display: flex;
  gap: 14px;
}

.carousel-container {
  flex: 1;
  height: 260px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}

.carousel-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 18px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
}

.carousel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 6px;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.carousel-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 0%, #d4d4d8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.carousel-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

.carousel-dot.active {
  background: var(--accent-green);
  width: 24px;
  border-radius: 4px;
}

.carousel-dot:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.9);
  outline-offset: 3px;
}

.hero-section.is-banner .carousel-content {
  display: none;
}

.hero-section.is-banner .carousel-dots {
  display: none;
}

.hero-section.is-banner .carousel-slide:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.9);
  outline-offset: 4px;
}

.promo-card {
  width: 300px;
  height: 260px;
  background: linear-gradient(145deg, #0d1f1d 0%, #0a1628 50%, #0d1f1d 100%);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(34, 197, 94, 0.1);
}

.promo-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.1) 0%, transparent 70%);
  animation: nbPulse 4s ease-in-out infinite;
}

@keyframes nbPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

.promo-header {
  position: relative;
  z-index: 1;
}

.promo-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, #4ade80 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.promo-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.promo-features {
  position: relative;
  z-index: 1;
}

.promo-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.promo-feature svg {
  width: 16px;
  height: 16px;
  color: var(--accent-green);
  flex-shrink: 0;
}

.promo-gift {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
}

.promo-gift svg {
  width: 100%;
  height: 100%;
}

.tools-section {
  padding: 0 20px 16px;
}

.tools-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  width: 100%;
}

.tools-grid::-webkit-scrollbar {
  height: 4px;
}

.tool-card {
  flex: 1 1 0;
  min-width: 160px;
  height: 72px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.tool-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.tool-card.featured {
  flex: 2 1 0;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(34, 197, 94, 0.03) 100%);
  border-color: rgba(34, 197, 94, 0.25);
}

.tool-card.featured:hover {
  border-color: var(--accent-green);
}

.tool-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent-green);
}

.tool-info {
  flex: 1;
}

.tool-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-desc {
  font-size: 11px;
  color: var(--text-muted);
  display: none;
}

.tool-arrow {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tool-card:hover .tool-arrow {
  color: var(--accent-green);
  transform: translateX(4px);
}

.tool-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-green);
  color: var(--bg-primary);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.experience-btn {
  background: var(--accent-green);
  color: var(--bg-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.experience-btn:hover {
  background: var(--accent-green-hover);
}

.content-section {
  padding: 0 20px 20px;
}

.tabs-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  gap: 6px;
}

.tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.tab-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 8px;
}

.actions-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
}

.search-input {
  width: 220px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0 32px 0 10px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-green);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.publish-btn {
  height: 32px;
  background: var(--accent-green);
  color: var(--bg-primary);
  border: none;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.publish-btn:hover {
  background: var(--accent-green-hover);
}

.filter-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-tag {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tag:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.filter-tag.active {
  color: var(--accent-green);
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.filter-tag:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.85);
  outline-offset: 2px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 4px;
}

.content-card {
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  border: 1px solid transparent;
  display: block;
  color: inherit;
  text-decoration: none;
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-color: var(--border-color);
}

.content-thumbnail {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
}

.content-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.content-card:hover .content-thumbnail img {
  transform: scale(1.05);
}

/* Fallback for older browsers/webviews without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
  .content-thumbnail {
    height: 0;
    padding-top: 125%;
  }

  .content-thumbnail img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }

  .content-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }
}

@supports not (aspect-ratio: 1 / 1) {
  @media (max-width: 768px) {
    .content-thumbnail {
      padding-top: 133.333%;
    }
  }
}

.content-duration {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-primary);
}

.content-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-card:hover .content-overlay {
  opacity: 1;
}

.content-card:focus-visible {
  outline: 2px solid rgba(74, 222, 128, 0.85);
  outline-offset: 3px;
}

/* Touch devices: don't rely on hover to reveal CTA */
@media (hover: none) and (pointer: coarse) {
  .content-card:hover {
    transform: none;
    box-shadow: none;
  }

  .content-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.18) 55%, transparent 100%);
    align-items: flex-end;
    justify-content: flex-start;
    padding: 10px;
  }

  .recreate-btn {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 999px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.recreate-btn {
  background: var(--accent-green);
  color: var(--bg-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nb-empty-state {
  grid-column: 1 / -1;
  padding: 18px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-secondary);
}

.recreate-btn:hover {
  background: var(--accent-green-hover);
}

.content-info {
  padding: 10px 12px;
}

.content-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--bg-primary);
}

.author-name {
  font-size: 11px;
  color: var(--text-secondary);
}

.content-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.stat-item svg {
  width: 12px;
  height: 12px;
}

/* Plans page */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.header-tabs {
  display: flex;
  gap: 24px;
}

.header-tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.header-tab:hover {
  color: var(--text-primary);
}

.header-tab.active {
  color: var(--accent-green);
  border-bottom-color: var(--accent-green);
}

.header-promo {
  font-size: 13px;
  color: var(--text-secondary);
}

.header-promo span {
  color: var(--accent-green);
  font-weight: 600;
}

.hero-banner {
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.05) 0%, transparent 100%);
}

.hero-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-subtitle span {
  color: var(--accent-green);
  font-weight: 600;
}

.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.toggle-btn {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
}

.toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.toggle-btn .discount {
  background: var(--accent-green);
  color: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
}

.plans-section {
  padding: 0 24px 40px;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.plan-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
}

.plan-card.featured {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, var(--bg-card) 100%);
}

.plan-card.featured:hover {
  border-color: #f59e0b;
}

.plan-header {
  margin-bottom: 16px;
}

.plan-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.plan-name .badge {
  background: var(--gradient-gold);
  color: var(--bg-primary);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.price-currency {
  font-size: 14px;
  color: var(--text-secondary);
}

.price-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-period {
  font-size: 12px;
  color: var(--text-muted);
}

.price-original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 4px;
}

.plan-renewal {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.plan-discount {
  display: inline-block;
  background: var(--bg-hover);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

.plan-cta {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  margin-bottom: 8px;
}

.plan-cta.primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.plan-cta.primary:hover {
  background: var(--accent-green);
}

.plan-cta.gold {
  background: var(--gradient-gold);
  color: var(--bg-primary);
}

.plan-cta.gold:hover {
  opacity: 0.9;
}

.plan-cta.free {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.plan-cta.free:hover {
  background: var(--border-light);
}

.plan-note {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

.plan-features {
  flex: 1;
}

.credits-box {
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.credits-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.credits-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-green);
}

.credits-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.credits-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.credits-rate,
.credits-equivalent {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.credits-equivalent {
  margin-top: 2px;
}

.feature-list {
  list-style: none;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.feature-item svg {
  width: 14px;
  height: 14px;
  color: var(--accent-green);
  flex-shrink: 0;
  margin-top: 1px;
}

.feature-item.disabled svg {
  color: var(--text-muted);
}

.feature-item .new-badge {
  background: var(--accent-green);
  color: var(--bg-primary);
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 4px;
}

.feature-item .free-badge {
  background: var(--accent-green);
  color: var(--bg-primary);
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: auto;
}

.feature-item .daily-badge {
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent-green);
  font-size: 8px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

.premium-section {
  padding: 40px 24px;
  border-top: 1px solid var(--border-color);
}

.premium-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
}

/* Signin page */
body.page-signin {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.page-plans .pricing-card {
  border-color: var(--accent-green);
}

body.page-plans .pricing-text {
  color: var(--accent-green);
}

.signin-container {
  width: 100%;
  max-width: 420px;
  padding: 40px;
}

.logo-section {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}

.logo svg {
  width: 100%;
  height: 100%;
}

.logo-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.signin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
}

.signin-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--text-primary);
}

.social-btn:hover {
  background: var(--border-light);
  border-color: var(--border-light);
}

.social-btn svg {
  width: 20px;
  height: 20px;
}

.social-btn.google {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.social-btn.google:hover {
  background: #e5e5e5;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 44px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent-green);
}

.form-textarea {
  height: auto;
  padding: 12px 14px;
  line-height: 1.35;
  resize: vertical;
  min-height: 110px;
}

.field-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-green);
}

.toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.remember-me input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-green);
  cursor: pointer;
}

.remember-me span {
  font-size: 12px;
  color: var(--text-secondary);
}

.forgot-password {
  font-size: 12px;
  color: var(--accent-green);
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: var(--accent-green-light);
}

.submit-btn {
  width: 100%;
  height: 44px;
  background: var(--accent-green);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.submit-btn:hover {
  background: var(--accent-green-hover);
}

.signup-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.signup-link a {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.signup-link a:hover {
  color: var(--accent-green-light);
}

.terms {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 20px;
  line-height: 1.5;
}

.terms a {
  color: var(--text-secondary);
  text-decoration: none;
}

.terms a:hover {
  color: var(--text-primary);
}

.back-link {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text-primary);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

/* Video page */
body.page-video .main-content {
  padding-bottom: 40px;
}

.video-shell {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.video-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.06) 0%, rgba(10, 10, 10, 0.2) 55%, rgba(10, 10, 10, 0) 100%);
  margin-bottom: 16px;
}

.video-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.video-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.45;
}

.video-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
  padding: 14px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(10px);
}

.video-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.video-meta-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.video-meta-value {
  font-size: 12px;
  color: var(--text-primary);
  text-align: right;
}

.video-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 16px;
}

.video-card,
.video-result-card {
  padding: 20px;
}

.video-card-head {
  margin-bottom: 14px;
}

.video-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.video-card-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.35;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.upload-dropzone {
  position: relative;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  background: rgba(26, 26, 26, 0.7);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-height: 160px;
}

.upload-dropzone:hover {
  border-color: var(--border-light);
}

.upload-dropzone.is-dragover {
  border-color: var(--accent-green);
  background: rgba(34, 197, 94, 0.08);
}

.upload-inner {
  padding: 14px;
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
}

.upload-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.upload-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-preview {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #000;
}

.upload-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid var(--border-color);
  background: rgba(10, 10, 10, 0.65);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.upload-clear:hover {
  border-color: var(--border-light);
  background: rgba(20, 20, 20, 0.9);
}

.video-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.video-secondary {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-hover);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.video-secondary:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.video-error {
  margin-top: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: rgba(254, 202, 202, 0.95);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 13px;
  line-height: 1.35;
}

.video-empty {
  border: 1px solid var(--border-color);
  background: rgba(26, 26, 26, 0.7);
  border-radius: 14px;
  padding: 18px;
}

.video-empty-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
}

.video-empty-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.result-media {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: #000;
  overflow: hidden;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
  flex: 1;
}

.result-link:hover {
  border-color: var(--border-light);
}

@media (max-width: 980px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  .video-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .video-hero-meta {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .upload-row {
    grid-template-columns: 1fr;
  }
  .settings-row {
    grid-template-columns: 1fr;
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .plans-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .hero-section {
    flex-direction: column;
  }

  .promo-card {
    width: 100%;
    height: auto;
    min-height: 200px;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .nb-notification {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .hero-section {
    padding: 16px;
  }

  .tools-section,
  .content-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .carousel-container {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .carousel-dots {
    bottom: 12px;
    gap: 10px;
  }

  .carousel-dot {
    width: 10px;
    height: 10px;
    position: relative;
  }

  .carousel-dot::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
  }

  .filter-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .filter-tag {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 14px;
    font-size: 12px;
    scroll-snap-align: start;
  }

  .filter-tags::-webkit-scrollbar {
    height: 4px;
  }

  .search-input {
    width: 180px;
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  /* Match WebApp cards (3:4) on mobile */
  .content-thumbnail {
    aspect-ratio: 3 / 4;
  }

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

  .header {
    flex-direction: column;
    gap: 12px;
  }

  .signin-container {
    padding: 24px;
  }

  .signin-card {
    padding: 24px;
  }

  .back-link {
    top: 16px;
    left: 16px;
  }
}

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

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