/* ==========================================================================
   Sadeem AI Ecosystem — Main Editable Theme Stylesheet (main.css)
   Futuristic Dark Glassmorphism + Three.js + RTL/LTR + WooCommerce + Elementor
   ========================================================================== */

:root {
  --sdm-bg-obsidian: #05050a;
  --sdm-bg-deep: #090817;
  --sdm-bg-card: rgba(16, 14, 35, 0.78);
  --sdm-violet: #8b5cf6;
  --sdm-violet-deep: #6d28d9;
  --sdm-cyan: #06b6d4;
  --sdm-sky: #38bdf8;
  --sdm-emerald: #10b981;
  --sdm-amber: #f59e0b;
  --sdm-rose: #f43f5e;
  --sdm-text: #f1f5f9;
  --sdm-muted: #94a3b8;
  --sdm-border: rgba(139, 92, 246, 0.22);
  --sdm-border-cyan: rgba(6, 182, 212, 0.4);
  --sdm-radius-lg: 24px;
  --sdm-radius-md: 16px;
  --sdm-radius-sm: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--sdm-bg-obsidian);
  color: var(--sdm-text);
}

body.sadeem-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--sdm-bg-obsidian);
  color: var(--sdm-text);
  font-family: 'Alexandria', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  background-size: 48px 48px;
  background-image:
    linear-gradient(to right, rgba(139, 92, 246, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(6, 182, 212, 0.055) 1px, transparent 1px);
}

html[dir="ltr"] body.sadeem-body {
  font-family: 'Plus Jakarta Sans', 'Alexandria', system-ui, sans-serif;
  direction: ltr;
  text-align: left;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

code, pre, .sdm-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Ambient Cosmic Nebulas */
.sdm-ambient-orb {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
}
.sdm-ambient-orb--violet {
  top: -160px;
  right: -120px;
  background: rgba(124, 58, 237, 0.16);
}
.sdm-ambient-orb--cyan {
  bottom: -180px;
  left: -120px;
  background: rgba(6, 182, 212, 0.13);
}

/* Container & Layout */
.sdm-container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  position: relative;
  z-index: 2;
}

.sdm-section {
  padding-top: 56px;
  padding-bottom: 56px;
}

.sdm-section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sdm-cyan);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.sdm-section-title {
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px 0;
  line-height: 1.25;
}

.sdm-section-desc {
  color: var(--sdm-muted);
  font-size: 0.95rem;
  max-width: 720px;
  margin: 0;
}

/* Glassmorphism Surfaces */
.sdm-glass-card {
  background: linear-gradient(145deg, rgba(17, 15, 36, 0.82) 0%, rgba(9, 9, 20, 0.9) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--sdm-border);
  border-radius: var(--sdm-radius-lg);
  padding: 26px;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.26s ease, border-color 0.26s ease, box-shadow 0.26s ease;
}

.sdm-glass-card:hover {
  transform: translateY(-3px);
  border-color: var(--sdm-border-cyan);
  box-shadow: 0 22px 48px -12px rgba(124, 58, 237, 0.24), 0 0 24px -6px rgba(6, 182, 212, 0.2);
}

.sdm-gradient-text {
  background: linear-gradient(110deg, #ffffff 12%, #c4b5fd 50%, #38bdf8 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons */
.sdm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.22s ease;
  font-family: inherit;
}

.sdm-btn--primary {
  background: linear-gradient(135deg, var(--sdm-violet) 0%, var(--sdm-violet-deep) 48%, #0891b2 100%);
  color: #ffffff;
  box-shadow: 0 8px 26px -4px rgba(124, 58, 237, 0.55);
}
.sdm-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -4px rgba(6, 182, 212, 0.55);
  color: #ffffff;
}

.sdm-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
.sdm-btn--ghost:hover {
  background: rgba(139, 92, 246, 0.18);
  border-color: var(--sdm-border-cyan);
  color: #ffffff;
}

.sdm-btn--cyan {
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(6, 182, 212, 0.42);
  color: #a5f3fc;
}
.sdm-btn--cyan:hover {
  background: rgba(6, 182, 212, 0.28);
  color: #ffffff;
}

/* Badges */
.sdm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.34);
  color: #67e8f9;
}

.sdm-badge--emerald {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* Sticky Header */
.sdm-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 10, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.22);
}

body.admin-bar .sdm-header {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .sdm-header { top: 46px; }
}

.sdm-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 78px;
}

.sdm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sdm-brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sdm-violet), var(--sdm-cyan));
  padding: 1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sdm-brand__logo-inner {
  width: 100%;
  height: 100%;
  border-radius: 13px;
  background: #090817;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sdm-sky);
  font-weight: 900;
  font-size: 1.1rem;
}

.sdm-brand__title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  line-height: 1.2;
}
.sdm-brand__sub {
  font-size: 0.7rem;
  color: var(--sdm-muted);
}

.sdm-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 5px;
  border-radius: 16px;
}

.sdm-nav a,
.sdm-nav ul li a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 11px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
}
.sdm-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sdm-nav a:hover,
.sdm-nav a.is-active,
.sdm-nav ul li.current-menu-item > a {
  background: linear-gradient(135deg, var(--sdm-violet), #0891b2);
  color: #ffffff;
}

.sdm-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 20-Sections Mega Drawer */
.sdm-mega-drawer {
  display: none;
  background: rgba(7, 6, 18, 0.98);
  border-top: 1px solid rgba(139, 92, 246, 0.3);
  padding: 24px 0;
}
.sdm-mega-drawer.is-open {
  display: block;
}

/* Responsive Grid Helpers */
.sdm-grid {
  display: grid;
  gap: 22px;
}
.sdm-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sdm-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sdm-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sdm-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.sdm-hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 1080px) {
  .sdm-nav { display: none; }
  .sdm-hero-grid { grid-template-columns: 1fr; }
  .sdm-grid--4, .sdm-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sdm-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .sdm-grid--2, .sdm-grid--3, .sdm-grid--4, .sdm-grid--5 { grid-template-columns: 1fr; }
  .sdm-glass-card { padding: 20px; }
}

/* Hero Typography & 3D Box */
.sdm-hero-title {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 900;
  line-height: 1.18;
  margin: 14px 0 18px;
}
.sdm-hero-sub {
  font-size: 1.05rem;
  color: #cbd5e1;
  margin: 0 0 26px;
  max-width: 640px;
}

.sdm-three-wrap {
  position: relative;
  width: 100%;
  height: 410px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sdm-three-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}
.sdm-three-hud {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(11, 10, 24, 0.85);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 11px;
  z-index: 5;
}

/* Forms & Inputs */
.sdm-input,
.sdm-select,
.sdm-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 11px 14px;
  color: #ffffff;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}
.sdm-select option {
  background: #0b0a1a;
  color: #ffffff;
}
.sdm-input:focus,
.sdm-select:focus,
.sdm-textarea:focus {
  border-color: var(--sdm-cyan);
}

/* AI Hub Workspace */
.sdm-ai-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}
@media (max-width: 960px) {
  .sdm-ai-layout { grid-template-columns: 1fr; }
}

.sdm-ast-btn {
  width: 100%;
  text-align: inherit;
  background: rgba(12, 11, 26, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 15px;
  color: #ffffff;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.2s ease;
  font-family: inherit;
}
.sdm-ast-btn.is-active,
.sdm-ast-btn:hover {
  border-color: var(--sdm-cyan);
  background: rgba(124, 58, 237, 0.16);
}

.sdm-chat-stream {
  height: 410px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sdm-msg {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-line;
}
.sdm-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #ffffff;
}
.sdm-msg--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}
.sdm-msg pre {
  direction: ltr;
  text-align: left;
  background: #05050c;
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  color: #a5f3fc;
  font-size: 12px;
  margin-top: 10px;
}

/* Progress Meters */
.sdm-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 6px;
}
.sdm-meter__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sdm-violet), var(--sdm-cyan));
  transition: width 0.3s ease;
}

/* Modal Overlay */
.sdm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sdm-modal.is-open {
  display: flex;
}

/* Footer */
.sdm-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(4, 4, 9, 0.96);
  padding: 48px 0 32px;
  margin-top: 60px;
  position: relative;
  z-index: 2;
}

/* WooCommerce Dark Glass Integration */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  background: var(--sdm-bg-card);
  border: 1px solid var(--sdm-border);
  border-radius: 20px;
  padding: 20px;
}
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
  background: linear-gradient(135deg, var(--sdm-violet), #0891b2);
  color: #fff;
  border-radius: 12px;
}

/* Reduced Motion Accessibility (Criterion #10) */
html.sadeem-reduced-motion *,
html.sadeem-reduced-motion *::before,
html.sadeem-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
