/* ITLAQ (إِطْلَاق): Salla Product Launchpad & A/B Landing Page Studio */
/* Duskstone Design System: Dark/Light Canvas with Emerald & Amber/Orange Accents */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Readex+Pro:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root, [data-theme="dark"] {
  --bg-canvas: #09090b;
  --bg-surface: #121215;
  --bg-surface-elevated: #18181d;
  --border-subtle: #27272a;
  --border-highlight: #3f3f46;
  
  --emerald-primary: #10b981;
  --emerald-hover: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --emerald-subtle: rgba(16, 185, 129, 0.1);
  --emerald-border: rgba(16, 185, 129, 0.35);

  --amber-primary: #f59e0b;
  --amber-hover: #d97706;
  --amber-subtle: rgba(245, 158, 11, 0.12);
  --amber-glow: rgba(245, 158, 11, 0.25);

  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --heading-color: #ffffff;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-highlight: #cbd5e1;

  --emerald-primary: #0d9488;
  --emerald-hover: #0f766e;
  --emerald-glow: rgba(13, 148, 136, 0.15);
  --emerald-subtle: rgba(13, 148, 136, 0.08);
  --emerald-border: rgba(13, 148, 136, 0.3);

  --amber-primary: #d97706;
  --amber-hover: #b45309;
  --amber-subtle: rgba(217, 119, 6, 0.08);
  --amber-glow: rgba(217, 119, 6, 0.15);

  --accent-cyan: #0284c7;
  --accent-purple: #7c3aed;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --heading-color: #0f172a;
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', -apple-system, sans-serif;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 24px;
  min-height: 100vh;
}

.dashboard-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  padding: 18px 24px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--heading-color);
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f59e0b, #10b981);
  color: #000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--amber-glow);
  font-size: 22px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--emerald-primary);
  background: var(--emerald-subtle);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--emerald-border);
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-primary);
  box-shadow: 0 0 10px var(--emerald-primary);
  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); }
}

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

.btn-ctrl {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.btn-ctrl:hover {
  background: var(--border-subtle);
  border-color: var(--border-highlight);
}

.current-plan-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(16, 185, 129, 0.15));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Operational Metrics Strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-subtle);
}

.metric-card.highlight-amber::before { background: var(--amber-primary); }
.metric-card.highlight-emerald::before { background: var(--emerald-primary); }
.metric-card.highlight-cyan::before { background: var(--accent-cyan); }
.metric-card.highlight-purple::before { background: var(--accent-purple); }

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

.metric-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--heading-color);
  letter-spacing: -0.5px;
}

.metric-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.metric-subtext.positive {
  color: var(--emerald-primary);
  font-weight: 500;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  margin-bottom: 28px;
}

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

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.badge-amber {
  background: var(--amber-subtle);
  color: var(--amber-primary);
  border: 1px solid var(--amber-glow);
}

.badge-emerald {
  background: var(--emerald-subtle);
  color: var(--emerald-primary);
  border: 1px solid var(--emerald-border);
}

/* A/B Variant Switcher Buttons */
.variant-switcher {
  display: flex;
  background: var(--bg-surface-elevated);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 18px;
  gap: 4px;
}

.btn-variant {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-variant.active {
  background: var(--amber-primary);
  color: #000;
  box-shadow: 0 2px 10px var(--amber-glow);
}

/* Mobile Screen Simulation */
.mobile-frame {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: #09090b;
  border: 4px solid var(--border-highlight);
  border-radius: 28px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.mobile-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  display: inline-block;
  margin-bottom: 12px;
  font-weight: bold;
}

.mobile-headline {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 8px;
}

.mobile-subhead {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.mobile-media {
  width: 100%;
  height: 160px;
  background: #18181d;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 16px;
}

.pricing-tier-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pricing-tier-card.selected {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--emerald-primary);
}

.btn-mobile-buy {
  width: 100%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--emerald-glow);
  margin-top: 14px;
}

/* A/B Experiment Comparison Box */
.ab-comparison-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.variant-stat-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.variant-stat-card.winner {
  border-color: var(--emerald-primary);
  box-shadow: 0 4px 18px var(--emerald-glow);
}

.winner-ribbon {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--emerald-primary);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card.popular {
  border-color: var(--amber-primary);
  box-shadow: 0 6px 24px var(--amber-glow);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
}

.plan-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--heading-color);
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  margin-bottom: 24px;
  flex-grow: 1;
}

.plan-features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features .check {
  color: var(--emerald-primary);
  font-weight: bold;
}

.btn-plan {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-plan:hover {
  background: var(--amber-primary);
  color: #000;
  border-color: var(--amber-primary);
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--amber-glow);
  padding: 12px 24px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
}


/* --- Batch A5: Navigation Tabs, Modals, Tables, Block Editor, and Progress Bar --- */
.nav-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}

.nav-tab {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s;
}

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

.nav-tab.active {
  background: var(--emerald-primary);
  color: #000;
  box-shadow: 0 2px 10px var(--emerald-glow);
}

.view-container {
  display: none;
}

.view-container.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-surface);
  border-radius: 14px;
  border: 2px dashed var(--border-subtle);
  margin-top: 16px;
}

.empty-icon {
  font-size: 54px;
  margin-bottom: 16px;
  display: inline-block;
}

.empty-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 10px;
}

.empty-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 540px;
  margin: 0 auto 24px auto;
  line-height: 1.6;
}

/* Table */
.pages-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.88rem;
}

.pages-table th, .pages-table td {
  padding: 14px 16px;
  text-align: start;
  border-bottom: 1px solid var(--border-subtle);
}

.pages-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-weight: 600;
}

.pages-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Sample Horizon Progress Bar */
.sample-progress-container {
  background: var(--bg-surface-elevated);
  border-radius: 20px;
  height: 12px;
  width: 100%;
  overflow: hidden;
  margin: 12px 0 8px 0;
  border: 1px solid var(--border-subtle);
}

.sample-progress-bar {
  background: linear-gradient(90deg, var(--amber-primary), var(--emerald-primary));
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}

/* Modal Dialog */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  padding: 28px;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

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

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

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--emerald-primary);
}

/* Block Editor */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.block-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
}

.block-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.block-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.preview-canvas-box {
  background: #000;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  min-height: 550px;
  display: flex;
  flex-direction: column;
}

.preview-toolbar {
  background: var(--bg-surface-elevated);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-body {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  padding: 20px;
  background: #09090b;
  overflow-y: auto;
}

.preview-body.mobile .preview-frame {
  width: 375px;
  min-height: 667px;
  border: 4px solid var(--border-highlight);
  border-radius: 28px;
  padding: 16px;
  background: #000;
}

.preview-body.desktop .preview-frame {
  width: 100%;
  min-height: 600px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 24px;
  background: #09090b;
}

.grace-period-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.grace-period-notice {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
