/* ==========================================================================
   AI SMARTA - Enterprise AI & Automation Platform
   Theme: Midnight Navy Luxury Tech
   ========================================================================== */

:root {
  --bg-midnight: #07111F;
  --bg-deep: #0B1F36;
  --bg-card: rgba(11, 31, 54, 0.75);
  --bg-card-hover: rgba(16, 42, 73, 0.85);
  --bg-card-border: rgba(79, 140, 255, 0.16);
  --bg-card-border-glow: rgba(25, 211, 243, 0.35);

  --accent-cyan: #19D3F3;
  --accent-cyan-rgb: 25, 211, 243;
  --accent-cyan-soft: rgba(25, 211, 243, 0.12);
  --accent-blue: #4F8CFF;
  --accent-blue-soft: rgba(79, 140, 255, 0.12);

  --text-white: #F5F8FC;
  --text-muted: #8FA3B8;
  --text-dim: #5A7188;

  --font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-cyan-glow: 0 0 25px rgba(25, 211, 243, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-midnight);
  color: var(--text-white);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(79, 140, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(25, 211, 243, 0.05) 0%, transparent 45%),
    linear-gradient(180deg, #07111F 0%, #060D18 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Typography & Utilities */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-white);
  font-weight: 700;
  line-height: 1.3;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.container {
  width: 90%;
  max-width: 1240px;
  margin: 0 auto;
}

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

.accent-blue {
  color: var(--accent-blue);
}

.text-muted {
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(25, 211, 243, 0.08);
  border: 1px solid rgba(25, 211, 243, 0.25);
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  font-size: 0.98rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: inherit;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #1d4ed8 0%, #0284c7 100%);
  color: #ffffff;
  border: 1px solid rgba(25, 211, 243, 0.4);
  box-shadow: 0 4px 20px rgba(29, 78, 216, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-cyan-glow), 0 6px 24px rgba(29, 78, 216, 0.5);
}

.btn-secondary {
  background: rgba(11, 31, 54, 0.8);
  color: var(--text-white);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Header Styles */
.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 17, 31, 0.85);
  border-bottom: 1px solid var(--bg-card-border);
  transition: var(--transition-smooth);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

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

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--bg-deep), #16365c);
  border: 1px solid rgba(25, 211, 243, 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(25, 211, 243, 0.15);
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 28px;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-white);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--accent-cyan);
  transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

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

/* Hero Section */
.hero {
  padding: 80px 0 60px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 540px;
  line-height: 1.8;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--bg-card-border);
}

.stat-item h4 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-white);
}

.stat-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Chat Assistant Widget */
.chat-container-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-subtle), 0 0 40px rgba(11, 31, 54, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 540px;
  position: relative;
  transition: border-color 0.3s;
}

.chat-container-card:hover {
  border-color: rgba(79, 140, 255, 0.35);
}

.chat-card-header {
  padding: 16px 20px;
  background: rgba(7, 17, 31, 0.7);
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.consultant-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0B1F36, #1d4ed8);
  border: 1.5px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.status-online-dot {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  background: #10B981;
  border: 2px solid var(--bg-deep);
  border-radius: 50%;
}

.consultant-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.consultant-info span {
  font-size: 0.78rem;
  color: var(--accent-cyan);
}

.n8n-badge-pill {
  font-size: 0.75rem;
  background: rgba(79, 140, 255, 0.12);
  border: 1px solid rgba(79, 140, 255, 0.25);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 140, 255, 0.3) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(79, 140, 255, 0.3);
  border-radius: 10px;
}

.msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  position: relative;
  animation: fadeIn 0.3s ease;
}

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

.msg.bot {
  background: rgba(11, 31, 54, 0.9);
  border: 1px solid var(--bg-card-border);
  color: var(--text-white);
  align-self: flex-start;
  border-bottom-right-radius: 4px;
}

.msg.user {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-left-radius: 4px;
}

.quick-suggestions {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-suggestions::-webkit-scrollbar { display: none; }

.quick-chip {
  background: rgba(11, 31, 54, 0.9);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quick-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.chat-input-box {
  padding: 14px 16px;
  background: rgba(7, 17, 31, 0.9);
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input-box input {
  flex: 1;
  background: rgba(11, 31, 54, 0.6);
  border: 1px solid var(--bg-card-border);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.chat-input-box input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(79, 140, 255, 0.2);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
  border: 1px solid rgba(25, 211, 243, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chat-send-btn:hover {
  box-shadow: 0 0 15px rgba(25, 211, 243, 0.4);
  transform: scale(1.05);
}

/* Architecture / Engine Flow Section */
.section {
  padding: 80px 0;
}

.section-title-wrap {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 50px;
}

.section-title-wrap h2 {
  font-size: 2.2rem;
  margin-bottom: 14px;
}

.section-title-wrap p {
  color: var(--text-muted);
  font-size: 1.02rem;
}

.arch-flow-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-subtle);
  position: relative;
}

.nodes-diagram {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  z-index: 2;
}

.node-box {
  background: rgba(7, 17, 31, 0.7);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  transition: var(--transition-smooth);
  position: relative;
}

.node-box:hover {
  transform: translateY(-5px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-cyan-glow);
}

.node-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(25, 211, 243, 0.08);
  border: 1px solid rgba(25, 211, 243, 0.25);
  color: var(--accent-cyan);
  font-size: 1.4rem;
}

.node-box h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.node-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.node-tag {
  display: inline-block;
  font-size: 0.72rem;
  margin-top: 12px;
  color: var(--accent-blue);
  background: rgba(79, 140, 255, 0.1);
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid rgba(79, 140, 255, 0.2);
}

/* Roadmap Grid (The 4 Phases) */
.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.roadmap-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  position: relative;
  transition: var(--transition-smooth);
}

.roadmap-card:hover {
  border-color: rgba(79, 140, 255, 0.4);
  transform: translateY(-4px);
}

.phase-number {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.roadmap-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.roadmap-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.roadmap-card ul {
  margin-top: 14px;
  padding-right: 18px;
  list-style-type: disc;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.roadmap-card ul li {
  margin-bottom: 6px;
}

/* Interactive Estimator Demo Box */
.calculator-box {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  box-shadow: var(--shadow-subtle);
}

.calc-control {
  margin-bottom: 20px;
}

.calc-control label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-white);
}

.calc-select, .calc-range {
  width: 100%;
  padding: 12px 16px;
  background: rgba(7, 17, 31, 0.7);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
}

.calc-result-card {
  background: rgba(7, 17, 31, 0.8);
  border: 1px solid rgba(25, 211, 243, 0.3);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-cyan-glow);
}

.calc-price {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin: 10px 0;
}

.lead-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10B981;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Footer */
.footer-wrapper {
  background: #040A12;
  border-top: 1px solid rgba(79, 140, 255, 0.1);
  padding: 60px 0 30px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 14px;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 18px;
  color: var(--text-white);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  text-align: center;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ==========================================================================
   Comprehensive Responsive System (Tablet & Mobile Optimized)
   ========================================================================== */

/* 1. الشاشات المتوسطة والتابلت (أقل من 992px) */
@media (max-width: 992px) {
  .hero {
    padding: 40px 0 30px;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  /* ترتيب ظهور العناصر: نصوص الـ Hero أولاً ثم الشات */
  .hero-content {
    order: 1;
    text-align: center;
  }

  .hero-widget {
    order: 2;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }

  .hero-title {
    font-size: 2.2rem;
    line-height: 1.35;
  }

  .hero-desc {
    margin: 0 auto 28px;
  }

  .hero-cta-btns,
  .hero-content div[style*="display: flex"] {
    justify-content: center;
  }

  /* المخططات والبطاقات */
  .nodes-diagram, 
  .roadmap-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .arch-flow-wrapper {
    padding: 24px;
  }

  /* محاكي التكلفة */
  .calculator-box {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }

  /* الفوتر */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

/* 2. شاشات الموبايل القياسية (أقل من 768px) */
@media (max-width: 768px) {
  .container {
    width: 92%;
    padding: 0;
  }

  .navbar {
    padding: 12px 0;
  }

  .nav-menu {
    display: none; /* إخفاء القائمة الأفقية لمنع كسر الهيدر */
  }

  .brand-logo .logo-text {
    font-size: 1.15rem;
  }

  .header-actions .btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .section {
    padding: 50px 0;
  }

  .section-title-wrap {
    margin-bottom: 30px;
  }

  .section-title-wrap h2 {
    font-size: 1.65rem;
  }
}

/* 3. شاشات الموبايل الصغيرة (أقل من 576px) */
@media (max-width: 576px) {
  .hero {
    padding: 25px 0 20px;
  }

  .hero-title {
    font-size: 1.6rem;
    line-height: 1.4;
  }

  .hero-desc {
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 20px;
  }

  /* جعل الأزرار تأخذ العرض الكامل لسهولة اللمس */
  .hero-cta-btns .btn,
  .hero-content div[style*="display: flex"] .btn {
    width: 100%;
  }

  /* إحصائيات الـ Hero على الموبايل */
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-top: 20px;
    margin-top: 24px;
  }

  .stat-item h4 {
    font-size: 1.2rem;
  }

  .stat-item p {
    font-size: 0.72rem;
  }

  /* صندوق الشات التفاعلي */
  .chat-container-card {
    height: 480px;
    border-radius: var(--radius-lg);
  }

  .chat-card-header {
    padding: 12px 14px;
  }

  .consultant-avatar {
    width: 36px;
    height: 36px;
  }

  .consultant-info h4 {
    font-size: 0.88rem;
  }

  .consultant-info span {
    font-size: 0.72rem;
  }

  .n8n-badge-pill {
    font-size: 0.68rem;
    padding: 3px 8px;
  }

  .chat-messages {
    padding: 12px;
    gap: 12px;
  }

  .msg {
    max-width: 90%;
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  .quick-suggestions {
    padding: 6px 12px;
    gap: 6px;
  }

  .quick-chip {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  .chat-input-box {
    padding: 10px 12px;
    gap: 8px;
  }

  .chat-input-box input {
    font-size: 0.82rem;
    padding: 10px 12px;
  }

  .chat-send-btn {
    width: 38px;
    height: 38px;
  }

  /* شبكات الأقسام تصبح عموداً واحداً */
  .nodes-diagram, 
  .roadmap-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .arch-flow-wrapper {
    padding: 16px 12px;
    border-radius: var(--radius-lg);
  }

  .node-box,
  .roadmap-card {
    padding: 18px 14px;
  }

  /* محاكي التسعير */
  .calculator-box {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
  }

  .calc-result-card {
    padding: 18px 14px;
  }

  .calc-price {
    font-size: 1.7rem;
  }

  .lead-score-pill {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  /* الفوتر */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .footer-brand p {
    margin: 12px auto 0;
  }

  .footer-brand .brand-logo {
    justify-content: center;
  }

  .footer-wrapper {
    padding: 40px 0 20px;
    margin-top: 40px;
  }
}
.currency-buttons-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.currency-btn {
  background: rgba(25, 211, 243, 0.1);
  border: 1px solid rgba(25, 211, 243, 0.4);
  color: #19D3F3;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.currency-btn:hover {
  background: linear-gradient(135deg, #19D3F3, #1d4ed8);
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-2px);
}