/* ==========================================================================
   AdMind AI - Dark Glassmorphism Design System & Stylesheet
   ========================================================================== */

:root {
  --bg-dark: #0b0f19;
  --bg-surface: #131b2e;
  --bg-card: rgba(23, 32, 54, 0.7);
  --bg-glass: rgba(19, 27, 46, 0.65);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.4);

  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.25);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 40%);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text .name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-text .highlight {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem;
  border-radius: 100px;
  border: 1px solid var(--border-color);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--accent-purple), #6d28d9);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.nav-btn.accent {
  position: relative;
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.nav-btn.accent:hover, .nav-btn.accent.active {
  background: var(--accent-cyan);
  color: #000000;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-ticker {
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
}

.ticker-label {
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.ticker-val {
  color: var(--accent-emerald);
  font-weight: 700;
}

.split-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
}

.split-item.platform { color: var(--accent-purple); }
.split-item.pub { color: var(--accent-pink); }
.split-divider { color: var(--text-muted); }

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
  display: block;
}

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

/* Buttons & Inputs */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* TAB 1: HERO & STATS */
.hero-banner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
  padding: 2.5rem;
  background: radial-gradient(circle at top left, rgba(139, 92, 246, 0.15), transparent 60%), var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.pill-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--accent-purple);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-text h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, #a78bfa, #f472b6, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
}

/* Ad Preview Box */
.ad-preview-box {
  background: #0f172a;
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-glow);
}

.ad-preview-box.floating-glow {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.ad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ad-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

.ad-timer {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ad-content-sim {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ad-logo-wrapper {
  width: 44px;
  height: 44px;
  background: #1e293b;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-logo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ad-copy {
  flex: 1;
}

.ad-headline {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.ad-link-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.ad-click-btn {
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
}

.ad-click-btn:hover {
  background: var(--accent-purple);
  color: #ffffff;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  transition: var(--transition-fast);
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.stat-icon.pink { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0.2rem 0;
  letter-spacing: -0.02em;
}

.highlight-cyan { color: var(--accent-cyan); }
.highlight-emerald { color: var(--accent-emerald); }

.stat-trend {
  font-size: 0.75rem;
  font-weight: 700;
}

.stat-trend.positive { color: var(--accent-emerald); }
.stat-subtitle { font-size: 0.75rem; color: var(--text-muted); }

/* Features Section */
.features-section h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.75rem;
  border-radius: var(--radius-md);
  position: relative;
}

.step-num {
  font-family: var(--font-code);
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.08);
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* TAB 2: ADVERTISER PORTAL */
.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.pane-header h2 {
  font-size: 2rem;
  font-weight: 800;
}

.pane-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.advertiser-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
}

.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.brand-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.table-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #1e293b;
  padding: 4px;
}

.bid-badge {
  font-family: var(--font-code);
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.status-tag.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.side-panel h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.panel-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.creative-preview {
  margin-bottom: 2rem;
}

.bidding-calculator {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.bidding-calculator h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.calc-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.calc-row label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-symbol span {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}

.input-with-symbol input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem 0.65rem 2rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-purple);
}

.payout-summary-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

.summary-line.split-line {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px border-color;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* TAB 3: PUBLISHER HUB */
.publisher-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
}

.platform-selector {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.platform-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.platform-tab.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.4);
}

.code-box-wrapper {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.copy-btn {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.copy-btn:hover {
  background: var(--accent-purple);
  color: #ffffff;
}

.code-block {
  padding: 1.25rem;
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: #38bdf8;
  overflow-x: auto;
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.guide-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.guide-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.guide-card h5 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.guide-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Publisher Payout Box */
.pub-calc-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.input-group input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
}

.earnings-breakdown {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.earning-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.pub-share-highlight {
  color: var(--accent-emerald);
  font-size: 0.95rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-color);
}

.monthly-projection {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.monthly-projection h3 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-emerald);
  margin: 0.2rem 0;
}

.monthly-projection small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* TAB 4: LIVE AI OVERLAY SANDBOX */
.sandbox-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.custom-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sandbox-container {
  max-width: 950px;
  margin: 0 auto;
}

.ai-chat-window {
  background: #0d1322;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.ai-model-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.ai-status-indicator.online {
  width: 10px;
  height: 10px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

.badge-mini {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.ai-messages-log {
  padding: 1.5rem;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-msg {
  display: flex;
  gap: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.chat-msg.user-msg {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chat-msg.user-msg .msg-avatar {
  background: var(--accent-purple);
}

.msg-body {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  max-width: 80%;
  font-size: 0.92rem;
}

.chat-msg.user-msg .msg-body {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
}

/* THINKING AD OVERLAY (The core feature) */
.thinking-ad-overlay {
  display: none;
  margin: 0 1.5rem 1.5rem 1.5rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--accent-purple);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
  animation: slideUp 0.3s ease-out;
}

.thinking-ad-overlay.active {
  display: block;
}

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

.thinking-spinner-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.spinner-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent-cyan);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.ad-notice {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.overlay-ad-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.overlay-logo {
  width: 46px;
  height: 46px;
  background: #1e293b;
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.overlay-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.overlay-text-group {
  flex: 1;
}

.overlay-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.overlay-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.sponsor-link {
  color: var(--accent-cyan);
}

.bid-info strong {
  color: var(--accent-emerald);
}

.overlay-visit-btn {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
}

.overlay-visit-btn:hover {
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
  transform: scale(1.03);
}

.ai-input-area {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-color);
}

.ai-input-area input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
}

.ai-input-area input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

/* MODAL */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-banner { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .advertiser-layout, .publisher-layout { grid-template-columns: 1fr; }
  .anim-workflow-grid { grid-template-columns: 1fr; }
}

/* Interactive Workflow Animation Styles */
.workflow-demo-panel {
  margin-bottom: 3rem;
  background: var(--bg-surface);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.anim-workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.anim-step-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.anim-step-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.anim-step-num {
  font-family: var(--font-code);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.anim-step-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.code-typing-box {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: #38bdf8;
  position: relative;
  min-height: 110px;
  overflow-x: auto;
}

.typing-cursor {
  animation: blink 0.8s infinite;
  color: var(--accent-pink);
  font-weight: 800;
}

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

.rendered-ad-sim-box {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sim-ad-container {
  width: 100%;
}

.ad-placeholder-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

.revenue-ticker-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ticker-counter-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
}

/* Free Trial & Admin Styles */
.btn-free-trial {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #000000;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}
.btn-free-trial:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.admin-portal-btn {
  background: rgba(236, 72, 153, 0.12);
  color: var(--accent-pink);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.free-trial-banner-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.free-trial-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-emerald);
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

/* Comprehensive Mobile-First Responsive & Touch Design Rules */

.quick-action-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.25);
}

@media (max-width: 1024px) {
  .hero-title { font-size: 2.2rem !important; }
  .navbar { padding: 0.75rem 1rem !important; }
  .user-email { display: none; }
}

@media (max-width: 768px) {
  /* Prevent iOS Safari forced auto-zoom on input focus */
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="password"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Code Block Mobile Wrap & Touch Scroll Protection */
  pre, code, .code-output-card pre {
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-x: auto !important;
    max-width: 100% !important;
  }

  /* Navigation Drawer */
  .mobile-menu-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px;
    min-width: 44px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.4);
    flex-direction: column;
    padding: 1rem;
    gap: 0.65rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    z-index: 99999;
  }

  .nav-links.mobile-active {
    display: flex !important;
  }

  .nav-btn {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    min-height: 44px;
  }

  /* Main Container & Hero */
  .main-content { padding: 1.25rem 0.85rem !important; }
  .hero-section { padding: 1.5rem 0.5rem !important; text-align: center !important; }
  .hero-title { font-size: 1.75rem !important; line-height: 1.25 !important; }
  .hero-cta-group { flex-direction: column !alignment; gap: 0.75rem !important; }
  .hero-cta-group .btn { width: 100% !important; min-height: 48px; }

  /* Grids & Cards Stack */
  .stats-grid { grid-template-columns: 1fr !important; gap: 0.85rem !important; }
  .advertiser-layout { grid-template-columns: 1fr !important; }
  .publisher-tools-grid { grid-template-columns: 1fr !important; }
  .features-grid { grid-template-columns: 1fr !important; }

  /* Modals & Dialogs */
  .modal-box {
    width: 94vw !important;
    max-width: 100% !important;
    padding: 1.25rem !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    border-radius: 16px !important;
  }

  .form-row { flex-direction: column !important; gap: 0.75rem !important; }

  /* Touch Scrollable Data Tables */
  .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px;
    margin: 0 -0.5rem;
  }

  .data-table { min-width: 600px !important; }

  /* Floating AI Thinking Overlay Mobile Touch Rules */
  .sikads-floating-overlay, .sikads-ext-overlay {
    max-width: 92vw !important;
    bottom: 12px !important;
    right: 4vw !important;
    left: 4vw !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
  }

  .sikads-banner-container {
    flex-direction: column !important;
    text-align: center !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.5rem !important; }
  .brand-logo .logo-text { font-size: 1.15rem !important; }
  .v2-badge { display: none !important; }
  .split-pill { display: none !important; }
}
