@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #08090c;
  --bg-secondary: #111318;
  --bg-tertiary: #191c24;
  --accent-purple: #8b5cf6;
  --accent-indigo: #6366f1;
  --accent-green: #10b981;
  --accent-pink: #ec4899;
  --accent-red: #ef4444;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-bg: rgba(17, 19, 24, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 60px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* Layout Utilities */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 32px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.logo-icon {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-item:hover {
  color: #fff;
}

.status-pill {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   VIEW 1: PUBLIC LANDING PAGE STYLING
   ========================================================================== */

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 0 20px 0;
  max-width: 800px;
  margin: 0 auto;
}

.hero-pill {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #a78bfa;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}

.hero-headline {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  background: linear-gradient(to right, #ffffff, #d8b4fe, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subheadline {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 36px;
  font-weight: 400;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  margin-bottom: 60px;
  justify-content: center;
}

.dashboard-preview {
  width: 100%;
  max-width: 680px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.dashboard-preview:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--accent-purple);
}

.preview-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  display: inline-block;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 28px;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   VIEW 2: OAUTH ONBOARDING STYLING
   ========================================================================== */

.oauth-account {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.oauth-account:hover {
  background: #e5e7eb;
}

.oauth-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-purple);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ==========================================================================
   VIEW 3: DASHBOARD METRICS & CORE PANELS STYLING
   ========================================================================== */

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

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--card-shadow);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}

.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 16px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.metric-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--card-shadow);
  margin-bottom: 32px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.link-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.25s ease;
}

.link-item.active {
  border-left: 4px solid var(--accent-purple);
}

.link-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.link-title-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-title {
  font-weight: 600;
  font-size: 16px;
  color: #fff;
}

.link-alias {
  font-size: 13px;
  color: var(--accent-indigo);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.link-alias:hover {
  text-decoration: underline;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.target-display {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

.target-value {
  font-weight: 500;
  color: #fff;
  font-family: monospace;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.badge-fallback {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: 100%;
  gap: 8px;
}

.btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

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

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

/* Sandbox Widgets */
.sandbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.sandbox-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.sandbox-btn:hover {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.05);
  transform: translateY(-2px);
}

.sandbox-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.sandbox-label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.sandbox-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  display: block;
  margin-top: 2px;
}

/* SVG Charting */
.chart-container {
  position: relative;
  height: 220px;
  width: 100%;
  margin-bottom: 16px;
}

.chart-svg {
  width: 100%;
  height: 100%;
}

.grid-line {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1;
}

.chart-path-clicks {
  stroke: var(--accent-purple);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area-clicks {
  fill: url(#clicks-gradient);
}

.chart-dot {
  fill: var(--accent-purple);
  stroke: var(--bg-secondary);
  stroke-width: 2;
  transition: r 0.2s ease;
}

.chart-dot:hover {
  r: 7;
}

/* Timed Bio-Scheduler Console */
.scheduler-timeline {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.timeline-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  position: relative;
  margin: 30px 0;
}

.timeline-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-indigo));
  border-radius: 3px;
}

.timeline-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent-purple);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  transition: left 0.1s ease;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.scheduler-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

/* Migrator Simulator */
.migrator-box {
  background: linear-gradient(135deg, rgba(25, 28, 36, 0.9), rgba(17, 19, 24, 0.9));
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--card-shadow);
  margin-bottom: 32px;
}

.migrator-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.migrator-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.migrator-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.migrator-list {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.migrator-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 10px;
}

.migrator-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.migrator-item-title {
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.migrator-item-link {
  color: var(--accent-pink);
  font-family: monospace;
}

.migrator-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  display: none;
}

.migrator-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-green));
  border-radius: 4px;
  transition: width 0.1s linear;
}

/* Mobile Simulator Device */
.mobile-simulator-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}

.phone-shell {
  width: 320px;
  height: 600px;
  border-radius: 40px;
  background: #000;
  border: 8px solid #27272a;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  width: 130px;
  height: 20px;
  background: #27272a;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.phone-screen {
  flex: 1;
  background: #0f1015;
  padding: 30px 16px 16px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #fff;
  font-size: 14px;
}

.phone-screen::-webkit-scrollbar {
  display: none;
}

.phone-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.phone-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent-purple), var(--accent-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  border: 3px solid #0f1015;
  box-shadow: 0 0 0 2px var(--accent-purple);
}

.phone-username {
  font-weight: 700;
  font-size: 16px;
}

.phone-bio {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 220px;
  line-height: 1.4;
}

.phone-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.phone-link-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 25px;
  padding: 14px 20px;
  text-align: center;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
  display: block;
}

.phone-link-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.phone-link-btn.highlight {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-indigo));
  border: none;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Modal and notification overlays */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-green);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(150%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateY(0);
}

.toast-icon {
  font-size: 18px;
  color: var(--accent-green);
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-purple);
  border-color: var(--accent-purple);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #fff;
}

/* Quick Tools section */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.tool-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
}

.tool-header {
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14px;
}

.tool-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}
