/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  --font-primary: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --bg:          #F8FAFC;
  --bg-card:     #ffffff;
  --bg-card2:    #f1f5f9;
  --border:      rgba(15,23,42,0.06);
  --shadow:      0 4px 24px rgba(15,23,42,0.04);
  --shadow-lg:   0 12px 64px rgba(15,23,42,0.08);
  --text:        #020617;
  --text-muted:  #475569;
  --accent:      #0369A1;
  --accent-h:    #0284C7;
  --purple:      #6366F1;
  --danger:      #EF4444;
  --success:     #10B981;
  --gold:        #F59E0B;
  --input-bg:    #ffffff;
  --input-bd:    #E2E8F0;
  --seg-bg:      #F1F5F9;
  --seg-active:  #ffffff;
  --orb-1:       rgba(3,105,161,0.25);
  --orb-2:       rgba(99,102,241,0.20);
  --orb-3:       rgba(14,165,233,0.15);
  --dot-color:   rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] {
  --bg:          #050507;
  --bg-card:     #0F172A;
  --bg-card2:    #1E293B;
  --border:      rgba(255,255,255,0.05);
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 12px 64px rgba(0,0,0,0.6);
  --text:        #F8FAFC;
  --text-muted:  #94A3B8;
  --accent:      #38BDF8;
  --accent-h:    #7DD3FC;
  --purple:      #818CF8;
  --success:     #34D399;
  --input-bg:    #0F172A;
  --input-bd:    #334155;
  --seg-bg:      #1E293B;
  --seg-active:  #334155;
  --orb-1:       rgba(56,189,248,0.15);
  --orb-2:       rgba(129,140,248,0.12);
  --orb-3:       rgba(14,165,233,0.10);
  --dot-color:   rgba(255, 255, 255, 0.05);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .logo-text, strong, .btn, .stat, .hero-stat strong, .pill {
  font-family: var(--font-heading);
}

/* ============================================
   ANIMATED BACKGROUND ORBS
   ============================================ */
.bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-image: radial-gradient(var(--dot-color) 1.5px, transparent 1.5px);
  background-position: 0 0;
  background-size: 28px 28px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: drift linear infinite;
}

.orb-1 {
  width: 600px; height: 600px;
  background: var(--orb-1);
  top: -200px; left: -150px;
  animation-duration: 20s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: var(--orb-2);
  bottom: -100px; right: -100px;
  animation-duration: 25s;
  animation-direction: reverse;
}
.orb-3 {
  width: 400px; height: 400px;
  background: var(--orb-3);
  top: 40%; left: 50%;
  transform: translate(-50%,-50%);
  animation-duration: 18s;
}

@keyframes drift {
  0%    { transform: translate(0,0) scale(1); }
  33%   { transform: translate(60px,-40px) scale(1.08); }
  66%   { transform: translate(-40px,60px) scale(0.95); }
  100%  { transform: translate(0,0) scale(1); }
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .app-header {
  background: rgba(255,255,255,0.75);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-text {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}
.logo-sub {
  font-weight: 400;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.user-quota-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
}
.quota-ai { color: var(--accent); }
.quota-sep { color: var(--text-muted); }
.quota-manual { color: var(--success); }

.user-email {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: var(--seg-bg); }

/* ============================================
   HERO & SEARCH SECTION
   ============================================ */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 24px 40px;
}

.main-hero-block {
  min-height: calc(100vh - 80px); /* Fill most of screen, minus header */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 40px;
}

.hero-inner { 
  max-width: 800px; /* Widened for the large search box */
  margin: 0 auto;
  width: 100%;
}

.seo-title {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 32px;
  padding: 8px 24px;
  border-radius: 100px;
  background: rgba(41, 151, 255, 0.04);
  border: 1px solid rgba(41, 151, 255, 0.2);
  box-shadow: 0 4px 16px rgba(41, 151, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeUp 0.6s ease both;
}

[data-theme="light"] .seo-title {
  background: rgba(41, 151, 255, 0.06);
  border: 1px solid rgba(41, 151, 255, 0.15);
  box-shadow: 0 4px 12px rgba(41, 151, 255, 0.06);
}

.seo-title span {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(41,151,255,0.15), rgba(139,92,246,0.15));
  border: 1px solid rgba(41,151,255,0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 24px;
  animation: fadeUp 0.6s ease both;
}

.hero-headline {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeUp 0.6s 0.1s ease both;
}
.hero-headline em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  animation: fadeUp 0.6s 0.2s ease both;
}

.mt-32 { margin-top: 32px; }

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  animation: fadeUp 0.6s 0.5s ease both; /* delayed after search box */
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 28px; font-weight: 700; }
.hero-stat span { font-size: 13px; color: var(--text-muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

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

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============================================
   GLASSMORPHIC SEARCH BOX
   ============================================ */
.search-box-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  text-align: left;
  animation: scaleUp 0.6s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.glass-card {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4), inset 0 1px 30px rgba(255, 255, 255, 0.03);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.08), inset 0 0 0 1px rgba(255,255,255,0.8);
}

.giant-textarea {
  font-size: 20px;
  line-height: 1.5;
  padding: 42px 76px 24px 24px; /* Space for the absolute circle button & overlapping top tab */
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25); 
  border: 1px solid transparent;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text);
  resize: none;
}

[data-theme="light"] .giant-textarea {
  background: rgba(241, 245, 249, 0.7);
  box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.05);
}

.giant-textarea:focus {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(56, 189, 248, 0.15);
  outline: none;
}

[data-theme="light"] .giant-textarea:focus {
  background: #ffffff;
  border-color: rgba(3, 105, 161, 0.3);
  box-shadow: inset 0 1px 3px rgba(15,23,42,0.02), 0 8px 24px rgba(3, 105, 161, 0.12);
}

.giant-textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.7;
}

.hidden-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.main-textarea-group {
  margin-bottom: 24px;
}

.inside-input-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0; /* Prevents stray whitespace flex gap offset */
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  color: #fff;
}
.inside-input-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}
.inside-input-btn:hover {
  transform: translateY(-2px);
}
.inside-input-btn.send-btn { background: var(--accent); }
.inside-input-btn.send-btn:hover { background: var(--accent-h); box-shadow: 0 6px 16px rgba(3, 105, 161, 0.3); }
.inside-input-btn.stop-btn { background: var(--danger); }
.inside-input-btn.stop-btn:hover { background: #DC2626; box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3); }

.giant-btn {
  padding: 18px 24px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 14px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-h));
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  color: #fff;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.giant-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.giant-btn:hover {
  box-shadow: 0 12px 32px rgba(3, 105, 161, 0.4);
  transform: translateY(-2px);
}

.giant-btn:hover::after {
  left: 100%;
}

.search-settings {
  background: rgba(0, 0, 0, 0.15);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .search-settings {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-settings .form-group {
  margin-bottom: 0;
}

/* ============================================
   RESULTS SECTION (Replaces Main Grid)
   ============================================ */
.app-results-section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px;
  animation: fadeUp 0.6s ease both;
}

.results-inner {
  width: 100%;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
}

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

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-body { padding: 32px; }

/* ============================================
   SEGMENTED CONTROL (Tabs)
   ============================================ */
.segmented-control.main-tabs-control {
  max-width: max-content;
  margin: 0 auto -28px auto; /* Overlap textarea to eliminate gap and sit perfectly flush */
  padding: 6px; /* Tight padding to hug pills */
  border-radius: 100px;
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.05); /* Very subtle outer line */
  box-shadow: 
    inset 0 4px 12px rgba(0, 0, 0, 0.6), /* Gives recessed track feel */
    0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 10;
}

[data-theme="light"] .segmented-control.main-tabs-control {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: 
    inset 0 2px 6px rgba(15, 23, 42, 0.08),
    0 8px 32px rgba(15, 23, 42, 0.05);
}

.main-tabs-control .segment {
  border-radius: 100px; /* Pill shape */
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  color: rgba(255, 255, 255, 0.5); /* Muted initially */
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none;
}

.main-tabs-control .segment:hover {
  color: rgba(255, 255, 255, 0.85);
}

.main-tabs-control .segment.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15); /* Stronger highlight border */
  border-top-color: rgba(255, 255, 255, 0.35); /* Top reflection */
  box-shadow: 
    inset 0 1px 4px rgba(255,255,255,0.08), /* Inner glass glow */
    0 4px 16px rgba(0,0,0,0.4); /* Pop out shadow */
}

[data-theme="light"] .main-tabs-control .segment {
  color: var(--text-muted);
}

[data-theme="light"] .main-tabs-control .segment:hover {
  color: var(--text);
}

[data-theme="light"] .main-tabs-control .segment.active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 
    inset 0 2px 4px rgba(255,255,255,1),
    0 4px 16px rgba(15,23,42,0.1);
}

/* ============================================
   SEGMENTED CONTROL
   ============================================ */
.segmented-control {
  display: flex;
  background: var(--seg-bg);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.segment {
  flex: 1;
  background: transparent;
  border: none;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.segment.active {
  background: var(--seg-active);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* ============================================
   TABS
   ============================================ */
.tab { display: none; animation: fadeUp 0.3s ease; }
.tab.active { display: block; }

/* ============================================
   PLAN BANNERS
   ============================================ */
.plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(41,151,255,0.08);
  border: 1px solid rgba(41,151,255,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.plan-banner p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.plan-banner strong { font-size: 14px; }
.plan-banner-blue { background: rgba(41,151,255,0.06); }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }
label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.opt-badge {
  background: var(--seg-bg);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  background: var(--input-bg);
  border: 1px solid var(--input-bd);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(41,151,255,0.15);
}
textarea { resize: vertical; }

.form-row { display: flex; gap: 12px; }
.flex-1 { flex: 1; min-width: 0; }
.mt-16 { margin-top: 16px; }

/* Pill group */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: var(--seg-bg);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill:hover:not(.active) { border-color: var(--input-bd); }

/* Brainstorm idea pills */
.brainstorm-group { gap: 8px; margin-top: 12px; justify-content: center; }
.brainstorm-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

[data-theme="light"] .brainstorm-pill {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 4px 12px rgba(15,23,42,0.04);
  color: var(--text);
}

.brainstorm-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.3), 0 0 0 1px rgba(56, 189, 248, 0.2);
}

[data-theme="light"] .brainstorm-pill:hover {
  background: #ffffff;
  color: var(--accent-h);
  border-color: rgba(3, 105, 161, 0.2);
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.15);
}

.brainstorm-pill.active {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  transform: translateY(0);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 11px 24px;
  white-space: nowrap;
  
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  box-shadow: 
    inset 0 1px 1px rgba(255,255,255,0.05),
    0 4px 12px rgba(0,0,0,0.15);
}

[data-theme="light"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-gold):not(.btn-pro):not(.inside-input-btn) {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    inset 0 1px 1px rgba(255,255,255,0.9),
    0 4px 12px rgba(15,23,42,0.08);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 
    inset 0 2px 4px rgba(255,255,255,0.1),
    0 8px 24px rgba(0,0,0,0.25);
}

[data-theme="light"] .btn:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  box-shadow: 
    inset 0 2px 4px rgba(255,255,255,1),
    0 8px 24px rgba(15,23,42,0.12);
}

.btn:active { transform: translateY(0) scale(0.97); }
.full-width { width: 100%; }

.btn-primary { 
  background: var(--accent); 
  color: #fff; 
  border: 1px solid rgba(0,0,0,0.1);
  border-top: 1px solid rgba(255,255,255,0.3);
}

.btn-danger { 
  background: var(--danger); 
  color: #fff; 
  border-top: 1px solid rgba(255,255,255,0.3); 
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--text);
}
.btn-ghost:hover { 
  background: var(--seg-bg); 
  transform: translateY(0);
  box-shadow: none;
}

.btn-gold {
  background: linear-gradient(135deg, #f5a623, #f76f29);
  color: #fff;
  font-weight: 700;
  border-top: 1px solid rgba(255,255,255,0.4);
}
.btn-gold:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-pro {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-weight: 700;
  border-top: 1px solid rgba(255,255,255,0.4);
}
.btn-pro:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-sm { padding: 7px 16px; font-size: 13px; }

/* ============================================
   STATUS CARD
   ============================================ */
/* removed empty status card rule */
.status-row {
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.status-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 4px; }
.status-value { font-size: 18px; font-weight: 700; }
.status-value.idle { color: var(--text-muted); }
.status-value.running { color: var(--accent); animation: pulse 1.5s ease-in-out infinite; }
.text-right { text-align: right; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.found-chips {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 72px;
}
.chips-empty { font-size: 13px; color: var(--text-muted); font-style: italic; width: 100%; }

.domain-chip {
  background: rgba(52,199,89,0.12);
  border: 1px solid rgba(52,199,89,0.35);
  color: var(--success);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  animation: popIn 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes popIn { from { opacity:0; transform: scale(0.7); } to { opacity:1; transform: scale(1); } }

/* ============================================
   LOG
   ============================================ */
/* removed empty log card rule */
.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.log-header h3 { font-size: 15px; font-weight: 600; }
.log-controls { display: flex; gap: 8px; align-items: center; }

.select-minimal {
  border: 1px solid var(--input-bd);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--input-bg);
  width: auto;
}

.log-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}
.log-empty { text-align: center; color: var(--text-muted); padding: 32px; font-size: 14px; }

.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  transition: background 0.15s;
}
.log-item:hover { background: var(--seg-bg); }
.log-item.checking span:first-child { font-weight: 800; font-size: 1.05em; }

.log-checking { 
  color: var(--accent); 
  font-weight: 700; 
  animation: pulseGlow 0.6s infinite alternate ease-in-out; 
}
@keyframes pulseGlow { 
  from { opacity: 0.5; } 
  to { opacity: 1; transform: scale(1.02); letter-spacing: 0.5px; } 
}

.log-available { color: var(--success); font-weight: 700; }
.log-taken { color: var(--text-muted); }
.log-error { color: #f5a623; }

/* ============================================
   AUTH MODAL
   ============================================ */
.hidden { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  padding: 5vh 24px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

body:has(.modal-overlay:not(.hidden)) {
  overflow: hidden;
}

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal-card {
  margin: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideUp 0.25s ease;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--seg-bg);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.modal-close:hover { background: var(--input-bd); }

.modal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 17px;
  font-weight: 700;
}

.modal-tabs {
  display: flex;
  background: var(--seg-bg);
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 24px;
}
.modal-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.modal-tab.active {
  background: var(--seg-active);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* removed empty modal pane rule */

.perks-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--seg-bg);
  border-radius: 10px;
}
.perk { font-size: 13px; font-weight: 500; }

.form-msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.form-msg.error { background: rgba(255,59,48,0.1); color: var(--danger); }
.form-msg.success { background: rgba(52,199,89,0.1); color: var(--success); }
.form-input-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 4px 8px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input-sm:focus { border-color: var(--accent); }

/* ============================================
   PRICING SECTION
   ============================================ */
.pricing-section {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.pricing-header {
  text-align: center;
  margin-bottom: 48px;
}
.pricing-eyebrow {
  display: inline-block;
  background: linear-gradient(135deg, rgba(41,151,255,0.15), rgba(139,92,246,0.15));
  border: 1px solid rgba(41,151,255,0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pricing-header h2 {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 10px;
}
.pricing-header > p { color: var(--text-muted); font-size: 17px; }

/* Coupon Bar */
.coupon-bar { text-align: center; margin-bottom: 48px; }
.coupon-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 8px 8px 14px;
  max-width: 460px;
  width: 100%;
}
.coupon-inner input {
  background: none;
  border: none;
  box-shadow: none;
  flex: 1;
  width: auto;
  padding: 0;
  font-size: 14px;
}
.coupon-inner input:focus { box-shadow: none; }
.coupon-icon { font-size: 18px; flex-shrink: 0; }
.coupon-msg {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  display: block;
}
.coupon-msg.success { color: var(--success); }
.coupon-msg.error   { color: var(--danger); }

/* Pricing Grid */
.pricing-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { 
  .pricing-grid > .pricing-card { width: calc(50% - 10px); } 
}
@media (max-width: 560px) { 
  .pricing-grid > .pricing-card { width: 100%; } 
}

.pricing-card {
  width: calc(33.333% - 14px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px 24px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Popular card: accent border + soft glow */
.pricing-card.popular {
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, rgba(41,151,255,0.06) 0%, var(--bg-card) 60%);
  box-shadow: 0 0 40px rgba(41,151,255,0.13);
}

/* Agency card: gold accent */
.agency-card {
  background: linear-gradient(180deg, rgba(245,166,35,0.06) 0%, var(--bg-card) 60%);
  border: 1px solid rgba(245,166,35,0.25);
}

.popular-badge, .agency-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 14px;
  width: fit-content;
}
.popular-badge { background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff; }
.agency-badge  { background: linear-gradient(135deg, #f5a623, #f76f29); color: #fff; }

.plan-name { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.price-num { font-size: 42px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.price-per { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.plan-billed { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }

.plan-features {
  list-style: none;
  margin-bottom: 24px;
  flex: 1;
}
.plan-features li {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.plan-features li:last-child { border-bottom: none; }
.feat-yes::before { content: "✅"; font-size: 12px; flex-shrink: 0; margin-top: 1px; }
.feat-no  { color: var(--text-muted); }
.feat-no::before  { content: "⬜"; font-size: 12px; flex-shrink: 0; opacity: 0.4; margin-top: 1px; }

.soon-tag {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Enterprise Row */
.enterprise-row { margin-top: 8px; }
.enterprise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.enterprise-info { display: flex; flex-direction: column; gap: 3px; }
.enterprise-info strong { font-size: 16px; font-weight: 700; }
.enterprise-info span { font-size: 13px; color: var(--text-muted); }
.enterprise-cta { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.dev-card { display: flex; align-items: center; gap: 12px; }
.dev-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.dev-info { display: flex; flex-direction: column; }
.dev-info strong { font-size: 15px; font-weight: 700; }
.dev-info span { font-size: 12px; color: var(--text-muted); }

.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-link { display: flex; align-items: center; gap: 6px; color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-link:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: var(--text-muted); width: 100%; text-align: center; margin-top: 8px; }

/* ============================================
   USDT TAG + PAYMENT MODAL
   ============================================ */
.usdt-tag {
  font-size: 9px; font-weight: 800;
  background: linear-gradient(135deg, #26a17b, #1a7a5e);
  color: #fff;
  padding: 2px 6px; border-radius: 4px;
  margin-left: 4px; vertical-align: middle;
  letter-spacing: 0.5px;
}

.payment-modal {
  max-width: 420px;
  text-align: center;
}
.pay-header { margin-bottom: 20px; }
.pay-icon { font-size: 36px; margin-bottom: 8px; }
.pay-header h3 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.pay-period { color: var(--text-muted); font-size: 13px; }

.pay-amount-row {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  font-size: 14px; margin-bottom: 18px;
  padding: 12px; background: var(--seg-bg); border-radius: 10px;
}
.pay-amount-num {
  font-size: 22px; font-weight: 800;
  color: #26a17b;
}

.pay-qr-wrap {
  display: flex; justify-content: center; margin-bottom: 12px;
}
.pay-qr {
  width: 160px; height: 160px;
  border-radius: 12px;
  border: 3px solid var(--border);
  background: #fff;
}

.pay-network-badge {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  color: #f5a623;
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.2);
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 14px;
}

.pay-address-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--seg-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
  margin-bottom: 16px; text-align: left;
}
.pay-addr-text {
  font-family: ui-monospace, monospace;
  font-size: 11px; word-break: break-all;
  flex: 1; color: var(--text);
}
.pay-copy-btn { flex-shrink: 0; }

.pay-note {
  font-size: 13px; color: var(--text-muted);
  background: var(--seg-bg); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  text-align: left; line-height: 1.6;
}
.pay-note strong { color: var(--text); }
.pay-tg-btn { margin-top: 0; }

/* ============================================

   MOBILE
   ============================================ */
@media (max-width: 600px) {
  .header-inner { padding: 12px 16px; gap: 8px; }
  .logo-sub { display: none; }
  .user-email { display: none; }
  .user-quota-badge { font-size: 11px; padding: 3px 6px; }

  .header-actions { flex-wrap: nowrap; gap: 6px; }
  .auth-actions { gap: 4px; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }
  
  .hero { padding: 48px 16px 40px; }
  .hero-headline { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .hero-stats { gap: 20px; }
  .hero-stat strong { font-size: 22px; }

  .app-grid { padding: 0 16px 32px; gap: 16px; }
  .card-body { padding: 16px; }

  .coupon-inner { max-width: 100%; }
  .pricing-grid { flex-direction: column; }
  .pricing-card { width: 100%; padding: 22px 18px; }

  .enterprise-card { flex-direction: column; align-items: flex-start; }

  .footer-inner { flex-direction: column; align-items: center; }
  .dev-card { flex-direction: column; align-items: center; text-align: center; }
  .footer-links { width: 100%; justify-content: space-between; }
}

/* ============================================
   NOTIFICATION BELL & PANEL
   ============================================ */
.notif-dot {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  pointer-events: none;
  animation: popIn 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
}

.notif-panel {
  position: fixed;
  top: 64px; right: 16px;
  z-index: 300;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
  overflow: hidden;
}

.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}

.notif-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.notif-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 16px;
  font-size: 13px;
}

.notif-item {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  border-left: 3px solid transparent;
  transition: background 0.15s;
  cursor: default;
}
.notif-item:hover { background: var(--seg-bg); }
.notif-item.notif-read { opacity: 0.55; }
.notif-item.notif-success { border-left-color: var(--success); background: rgba(52,199,89,0.06); }
.notif-item.notif-error   { border-left-color: var(--danger);  background: rgba(255,59,48,0.06); }
.notif-item.notif-warning { border-left-color: #f5a623;         background: rgba(245,166,35,0.06); }
.notif-item.notif-info    { border-left-color: var(--accent);   background: rgba(41,151,255,0.06); }
.notif-msg { font-size: 13px; line-height: 1.5; margin-bottom: 4px; }
.notif-time { font-size: 11px; color: var(--text-muted); }

/* ============================================
   PAYMENT MODAL — STEP 2 & SUCCESS
   ============================================ */
.pay-next-btn { margin-top: 14px; }

.pay-step2-info {
  background: var(--seg-bg);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  text-align: center;
}
.pay-step2-icon { font-size: 32px; margin-bottom: 8px; }
.pay-step2-info p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.pay-step2-info strong { color: var(--text); }

.pay-success {
  text-align: center;
  padding: 20px 0;
}
.pay-success-icon { font-size: 56px; margin-bottom: 16px; animation: popIn 0.4s cubic-bezier(0.175,0.885,0.32,1.275); }
.pay-success h4 { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.pay-success p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.pay-success strong { color: var(--text); }

/* ============================================
   ADMIN DASHBOARD
   ============================================ */
.admin-table-wrap {
  overflow-x: auto;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  background: var(--seg-bg);
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }

.admin-table tbody tr:hover { background: var(--seg-bg); }

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-pending  { background: rgba(41,151,255,0.15); color: var(--accent); }
.badge-approved { background: rgba(52,199,89,0.15); color: var(--success); }
.badge-rejected { background: rgba(255,59,48,0.15); color: var(--danger); }
.badge-warning  { background: rgba(245,166,35,0.15); color: #f5a623; }

.tx-hash-link {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  background: rgba(41,151,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
}
.tx-hash-link:hover { text-decoration: underline; }

/* ============================================
   REVENUE STATS GRID
   ============================================ */
.revenue-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.rev-stat-card {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
}

.rev-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.rev-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.rev-stat-delta {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  border-radius: 20px;
  padding: 2px 8px;
  display: inline-block;
}
.rev-stat-delta.positive { background: rgba(52,199,89,0.15); color: var(--success); }
.rev-stat-delta.negative { background: rgba(255,59,48,0.15); color: var(--danger); }
.rev-stat-delta.neutral  { background: var(--seg-bg); color: var(--text-muted); }

/* ============================================
   PLAN BADGES (in Users table)
   ============================================ */
.plan-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.plan-free       { background: var(--seg-bg); color: var(--text-muted); }
.plan-starter    { background: rgba(41,151,255,0.12); color: #60a5fa; }
.plan-hustler    { background: rgba(99,102,241,0.15); color: #818cf8; }
.plan-builder    { background: rgba(245,158,11,0.15); color: #f59e0b; }
.plan-pro        { background: rgba(16,185,129,0.15); color: #10b981; }
.plan-agency     { background: rgba(239,68,68,0.15); color: #ef4444; }
.plan-enterprise { background: linear-gradient(90deg,#f59e0b22,#a855f722); color: #a855f7; border: 1px solid #a855f733; }
.plan-premium    { background: rgba(168,85,247,0.15); color: #c084fc; }
