/* ==========================================================================
   SPINBOOST AI - MODERN DESIGN SYSTEM & STYLE ARCHITECTURE
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ROOT VARIABLES & THEMES
   -------------------------------------------------------------------------- */
:root {
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Primary Dark Theme Colors */
  --bg-primary: #0b0d13;
  --bg-secondary: #121520;
  --bg-card: rgba(22, 26, 38, 0.6);
  --bg-card-hover: rgba(28, 33, 48, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 75, 130, 0.2);
  
  /* Accent Colors */
  --accent: #ff4b82;
  --accent-glow: rgba(255, 75, 130, 0.4);
  --accent-hover: #ff6594;
  
  --primary-blue: #3b82f6;
  --primary-green: #10b981;
  --primary-yellow: #f59e0b;
  --primary-red: #ef4444;
  
  /* Neutral Colors */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Glow Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(255, 75, 130, 0.25);
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.2);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
  --border-radius-lg: 20px;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   2. GENERAL STYLES & RESET
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

/* Button & UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 75, 130, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(255, 75, 130, 0.45), var(--shadow-glow);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--primary-yellow);
}

.btn-warning:hover {
  background-color: rgba(245, 158, 11, 0.2);
  border-color: var(--primary-yellow);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.full-width-btn {
  width: 100%;
}

/* Card Class Styling */
.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

/* Form Styling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.form-group input, .form-group select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: white;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--border-glow);
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-2 > .form-group { flex: 1; }
.flex-3 > .form-group { flex: 1; }

.input-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   3. APP LAYOUT & CORE GRID SYSTEM
   -------------------------------------------------------------------------- */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  width: 100vw;
}

/* SIDEBAR STYLES */
.sidebar {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  height: 100vh;
  justify-content: space-between;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #a21caf 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.brand-icon {
  color: white;
  width: 20px;
  height: 20px;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.03em;
  display: block;
  line-height: 1.1;
}

.brand-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
}

.campaign-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  font-size: 13px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-indicator.online {
  background-color: var(--primary-green);
  box-shadow: 0 0 10px var(--primary-green);
}

.campaign-name {
  font-weight: 500;
}

/* NAVIGATION MENU */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
}

.nav-item i {
  width: 18px;
  height: 18px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: white;
}

.nav-item.active {
  background: rgba(255, 75, 130, 0.08);
  border: 1px solid rgba(255, 75, 130, 0.15);
  color: var(--accent);
}

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

.count-badge {
  margin-left: auto;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.nav-item.active .count-badge {
  background-color: var(--accent);
  color: white;
}

/* USER PROFILE SIDEBAR */
.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: 24px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
}

.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.user-info .user-plan {
  font-size: 11px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   4. MAIN CONTENT AREA
   -------------------------------------------------------------------------- */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.top-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title-area h1 {
  font-size: 24px;
  line-height: 1.2;
}

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

.header-actions {
  display: flex;
  gap: 12px;
}

/* SPLIT VIEW LAYOUT GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.settings-workspace {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tab-panel {
  display: none;
  height: 100%;
  flex-direction: column;
}

.tab-panel.active {
  display: flex;
}

/* Sub-Tab Navigation inside Config */
.settings-tabs-sub {
  display: flex;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.tab-sub-item {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-sub-item:hover {
  color: white;
}

.tab-sub-item.active {
  background-color: var(--bg-secondary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.subtab-content {
  display: none;
  flex-direction: column;
  flex: 1;
}

.subtab-content.active {
  display: flex;
}

.subtab-header {
  margin-bottom: 20px;
}

.subtab-header h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

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

/* --------------------------------------------------------------------------
   5. SLICES EDITOR & PROBABILITY VALIDATION
   -------------------------------------------------------------------------- */
.slices-editor-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.slice-editor-row {
  display: grid;
  grid-template-columns: 40px 1.5fr 1fr 1fr 40px;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--border-radius);
  transition: var(--transition-smooth);
}

.slice-editor-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.slice-number {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.slice-editor-row input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
}

.slice-editor-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.slice-color-picker-cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.slice-color-picker-cell input[type="color"] {
  padding: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

.slice-color-picker-cell input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.slice-color-picker-cell input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

/* Dynamic Odds indicator status bar */
.odds-validation-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--border-radius);
}

.validator-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.validator-info i {
  color: var(--accent);
  width: 16px;
  height: 16px;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.success {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--primary-green);
}

.status-pill.danger {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--primary-red);
}

/* Form styling helpers */
.color-picker-input {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  align-items: center;
  padding-left: 8px;
}

.color-picker-input input[type="color"] {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.color-picker-input input[type="text"] {
  border: none;
  background: transparent;
  flex: 1;
}

/* --------------------------------------------------------------------------
   6. TRIGGERS & WEBHOOK SECTION Styling
   -------------------------------------------------------------------------- */
.form-section {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.form-section h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* Display trigger radio cards */
.radio-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.radio-card {
  border: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: var(--border-radius);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.radio-card input[type="radio"] {
  position: absolute;
  top: 12px;
  right: 12px;
  accent-color: var(--accent);
}

.radio-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-card-content i {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.radio-card-content strong {
  font-size: 13px;
  color: white;
}

.radio-card-content span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

.radio-card:hover {
  border-color: rgba(255, 75, 130, 0.3);
  background-color: rgba(255, 75, 130, 0.02);
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
  background-color: rgba(255, 75, 130, 0.05);
  box-shadow: 0 0 10px rgba(255, 75, 130, 0.1);
}

.radio-card:has(input:checked) i {
  color: var(--accent);
}

.timer-config-group {
  max-width: 200px;
}

/* Webhook inputs */
.webhook-input-wrapper {
  display: flex;
  gap: 8px;
}

.webhook-input-wrapper input {
  flex: 1;
}

/* Security switch controls */
.toggle-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
}

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

.toggle-text strong {
  font-size: 14px;
}

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

/* Switch UI Component */
.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: #374151;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

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

input:checked + .slider:before {
  transform: translateX(20px);
}

.developer-panel {
  background: rgba(245, 158, 11, 0.05);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  padding: 16px;
  border-radius: var(--border-radius);
}

.developer-panel strong {
  color: var(--primary-yellow);
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
}

.developer-panel p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   7. LEADS LIST & LIVE MONITOR TERMINAL
   -------------------------------------------------------------------------- */
.panel-header-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.leads-actions {
  display: flex;
  gap: 12px;
}

.leads-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.leads-stats-row .stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-heading);
}

.green-text {
  color: var(--primary-green);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 28px;
}

.leads-split-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.leads-table-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow-y: auto;
  max-height: 300px;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.leads-table th {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.leads-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.leads-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
}

/* Webhook Terminal Console */
.webhook-terminal {
  background-color: #05070c;
  border: 1px solid #1a2236;
  border-radius: var(--border-radius);
  overflow: hidden;
  height: 250px;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background-color: #0e121f;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #1a2236;
  gap: 12px;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.terminal-title {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-secondary);
}

.terminal-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.4;
  color: #a8ffb2;
}

.terminal-code {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* --------------------------------------------------------------------------
   8. ANALYTICS & CODE EXPORTER
   -------------------------------------------------------------------------- */
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.chart-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--border-radius-lg);
}

.chart-card h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Integration Widget Exporter Code styling */
.export-instructions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.step-guide {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--border-radius);
  display: flex;
  gap: 14px;
}

.step-num {
  width: 32px;
  height: 32px;
  background-color: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.step-guide strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.step-guide span {
  font-size: 11px;
  color: var(--text-secondary);
}

.code-editor-viewport {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  background-color: #090b11;
  display: flex;
  flex-direction: column;
}

.code-editor-header {
  background-color: var(--bg-secondary);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-secondary);
}

.code-editor-body {
  padding: 20px;
  max-height: 320px;
  overflow-y: auto;
}

.code-editor-body pre {
  margin: 0;
  font-family: monospace;
  font-size: 12px;
  color: #38bdf8;
  white-space: pre-wrap;
}

/* --------------------------------------------------------------------------
   9. SIMULATED STOREFRONT PANEL
   -------------------------------------------------------------------------- */
.storefront-preview {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
}

.device-frame {
  width: 100%;
  max-width: 440px;
  height: 680px;
  background-color: #000;
  border: 10px solid #1f2937;
  border-radius: 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 75, 130, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.device-header {
  background-color: #1f2937;
  padding: 6px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.url-bar {
  background-color: #0b0f19;
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lock-icon {
  width: 12px;
  height: 12px;
  color: var(--primary-green);
}

.url-text {
  font-size: 11px;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.refresh-icon {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.refresh-icon:hover {
  color: white;
}

.device-status {
  display: flex;
  justify-content: center;
}

.device-badge {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Simulated Store Body */
.shop-viewport {
  background-color: #fafaf9;
  color: #1c1917;
  flex: 1;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.shop-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: #fff;
  border-bottom: 1px solid #f5f5f4;
  position: sticky;
  top: 0;
  z-index: 5;
}

.shop-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  color: #1c1917;
}

.shop-logo span {
  color: #d97706;
}

.shop-nav-links {
  display: flex;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #78716c;
}

.shop-nav-icons {
  display: flex;
  gap: 8px;
  color: #1c1917;
}

.shop-nav-icons i {
  width: 16px;
  height: 16px;
}

/* Shop Hero Section */
.shop-hero {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 24px 16px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid #fbbf24;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-tag {
  font-size: 9px;
  font-weight: 800;
  background-color: #1c1917;
  color: white;
  padding: 2px 8px;
  border-radius: 20px;
}

.hero-content h2 {
  font-size: 18px;
  color: #1c1917;
  line-height: 1.2;
}

.hero-content p {
  font-size: 11px;
  color: #78716c;
  line-height: 1.4;
  max-width: 280px;
}

.shop-btn {
  background-color: #1c1917;
  color: white;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.shop-btn:hover {
  background-color: #44403c;
}

/* Shop Products */
.shop-products {
  padding: 16px;
}

.shop-products h3 {
  font-size: 12px;
  color: #44403c;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background: white;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-img {
  height: 110px;
  background-color: #f5f5f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d97706;
  position: relative;
}

.product-img.second {
  color: #0284c7;
  background-color: #f0fdf4;
}

.product-img i {
  width: 32px;
  height: 32px;
}

.badge-sale {
  position: absolute;
  top: 6px;
  left: 6px;
  background-color: #ef4444;
  color: white;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

.product-meta {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-meta h4 {
  font-size: 10px;
  color: #292524;
  font-weight: 600;
  line-height: 1.3;
}

.price-row {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}

.price-old {
  text-decoration: line-through;
  color: #a8a29e;
}

.price-new {
  font-weight: 700;
  color: #1c1917;
}

/* Simulated Exit Intent Zone Box */
.exit-detection-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(239, 68, 68, 0.95);
  border-bottom: 2px solid #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  z-index: 100;
  text-align: center;
}

/* Show exit zone on viewport hover detection */
.shop-viewport:hover .exit-detection-zone {
  transform: translateY(0);
}

/* Floating Action Spin Widget */
.floating-spin-badge {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #a21caf 100%);
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 30px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 75, 130, 0.4);
  transition: var(--transition-smooth);
  animation: pulse-badge 2s infinite;
  z-index: 20;
}

.floating-spin-badge i {
  width: 16px;
  height: 16px;
}

.floating-spin-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 75, 130, 0.6);
}

@keyframes pulse-badge {
  0% { transform: scale(1); box-shadow: 0 4px 15px rgba(255, 75, 130, 0.4); }
  50% { transform: scale(1.04); box-shadow: 0 4px 25px rgba(255, 75, 130, 0.7); }
  100% { transform: scale(1); box-shadow: 0 4px 15px rgba(255, 75, 130, 0.4); }
}

/* Simulated Store Toast Notification */
.store-toast {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background-color: #1c1917;
  color: white;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  box-shadow: var(--shadow-lg);
  transform: translateY(150%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 99;
}

.store-toast.active {
  transform: translateY(0);
}

.store-toast i {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   10. PREMIUM SPIN DIALOG MODAL LAYOUT
   -------------------------------------------------------------------------- */
.spin-popup {
  border: none;
  background: transparent;
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  max-height: 100%;
  align-items: center;
  justify-content: center;
  display: none; /* Controlled by open/close dialog native state */
  padding: 20px;
  z-index: 1000;
}

.spin-popup[open] {
  display: flex;
}

/* Styling backdrop with blur filter */
.spin-popup::backdrop {
  background-color: rgba(6, 8, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.popup-container {
  background-color: var(--bg-primary);
  width: 100%;
  max-width: 820px;
  min-height: 480px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  position: relative;
  animation: scale-up-popup 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes scale-up-popup {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.popup-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 100;
}

.popup-close-btn:hover {
  background-color: var(--primary-red);
  color: white;
  border-color: transparent;
}

/* POPUP LEFT COLUMN: Canvas Wheel */
.popup-wheel-column {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background-color: #0b0d13;
  border-right: 1px solid var(--border-color);
  position: relative;
}

.wheel-canvas-container {
  position: relative;
  width: 380px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mechanical pointer (arrow pin) */
.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 26px solid #ffd700;
  z-index: 50;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  max-width: 360px;
  max-height: 360px;
  display: block;
}

/* POPUP RIGHT COLUMN: States panel */
.popup-form-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 30px;
}

.popup-state {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  animation: fade-in-state 0.3s ease;
}

.popup-state.active {
  display: flex;
}

@keyframes fade-in-state {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.popup-title {
  font-size: 24px;
  line-height: 1.2;
}

.popup-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Form Styles inside Pop-up */
.popup-lead-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup-input-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.popup-input-group label i {
  width: 12px;
  height: 12px;
}

.popup-input-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: white;
  padding: 10px 14px;
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: 13px;
  transition: var(--transition-smooth);
}

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

.popup-security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.popup-security-note i {
  width: 14px;
  height: 14px;
  color: var(--primary-green);
}

.popup-spin-btn {
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 14px 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(255, 75, 130, 0.3);
  transition: var(--transition-smooth);
  width: 100%;
}

.popup-spin-btn:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(255, 75, 130, 0.45);
  transform: translateY(-1px);
}

/* STATE 2: SPINNING LOADING COMPONENT */
.spinning-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 20px 0;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* STATE 3: VICTORY SCREEN */
.victory-icon-container {
  display: flex;
  justify-content: center;
}

.victory-icon {
  width: 48px;
  height: 48px;
  color: #f59e0b;
  animation: pop-victory 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-victory {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.prize-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: 0 10px 20px rgba(217, 119, 6, 0.2);
}

.coupon-display-box {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  padding: 14px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coupon-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.coupon-code-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.coupon-code-row strong {
  font-family: monospace;
  font-size: 18px;
  color: white;
  letter-spacing: 0.05em;
}

.urgency-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  background-color: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  padding: 8px 12px;
  border-radius: 8px;
}

.urgency-timer i {
  color: var(--primary-red);
  width: 14px;
  height: 14px;
}

/* STATE 4: BLOCKED USER */
.block-icon-container {
  display: flex;
  justify-content: center;
}

.block-icon {
  width: 48px;
  height: 48px;
  color: var(--primary-red);
}

.blocked-message-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-color);
  padding: 16px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blocked-message-box span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   11. MOBILE RESPONSIVE ADAPTATIONS
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }
  
  .sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
  }
  
  .brand-header {
    margin-bottom: 12px;
  }
  
  .campaign-badge {
    display: none;
  }
  
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .nav-item {
    width: auto;
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 12px;
    justify-content: center;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .main-content {
    height: auto;
    overflow-y: visible;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px;
    overflow-y: visible;
  }
  
  .settings-workspace {
    height: auto;
    max-height: none;
  }
  
  .storefront-preview {
    margin-top: 16px;
  }
  
  .device-frame {
    height: 600px;
  }
}

@media (max-width: 768px) {
  .popup-container {
    grid-template-columns: 1fr;
    max-width: 440px;
    min-height: auto;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .popup-wheel-column {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
  }
  
  .wheel-canvas-container {
    width: 260px;
    height: 260px;
  }
  
  #wheel-canvas {
    max-width: 250px;
    max-height: 250px;
  }
  
  .popup-form-column {
    padding: 24px 20px;
  }
}
