/* ============================================================
   CoreX Ai — New Features CSS
   ============================================================ */

/* ---------- Reading Progress Bar ---------- */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #06b6d4, #a855f7);
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ---------- Search ---------- */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-toggle-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--color-text-secondary, #94a3b8);
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  transition: all 0.2s;
}
.search-toggle-btn:hover { background: rgba(124,58,237,0.15); color: #a78bfa; }
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 8888;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5rem;
  backdrop-filter: blur(4px);
}
.search-overlay.active { display: flex; }
.search-box {
  background: #1e1535;
  border: 1px solid rgba(124,58,237,0.4);
  border-radius: 1rem;
  width: min(90%, 600px);
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.search-input-wrap svg { color: #7c3aed; flex-shrink: 0; }
.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-size: 1rem;
  font-family: 'Cairo', sans-serif;
  direction: rtl;
}
.search-input-wrap input::placeholder { color: #64748b; }
.search-results { max-height: 380px; overflow-y: auto; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.search-result-item:hover { background: rgba(124,58,237,0.15); }
.search-result-icon {
  width: 36px; height: 36px;
  background: rgba(124,58,237,0.2);
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #a78bfa;
}
.search-result-title { font-weight: 600; font-size: 0.9rem; }
.search-result-desc { font-size: 0.78rem; color: #94a3b8; margin-top: 0.1rem; }
.search-empty { padding: 2rem; text-align: center; color: #64748b; font-size: 0.9rem; }
.search-close-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #94a3b8;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
}

/* ---------- Back to Top ---------- */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 46px; height: 46px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border: none;
  border-radius: 50%;
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(124,58,237,0.5); }

/* ---------- Sticky CTA ---------- */
#sticky-cta {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 998;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  pointer-events: none;
}
#sticky-cta.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.sticky-cta-btn {
  display: flex; align-items: center; gap: 0.5rem;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  border: none;
  border-radius: 2rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 25px rgba(124,58,237,0.45);
  transition: all 0.25s;
  white-space: nowrap;
}
.sticky-cta-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(124,58,237,0.6); }
.sticky-cta-dismiss {
  position: absolute;
  top: -8px; left: -8px;
  width: 22px; height: 22px;
  background: #1e1535;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #94a3b8;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.sticky-cta-dismiss:hover { color: white; background: #7c3aed; }

/* ---------- Comparison Section ---------- */
.comparison-section {
  padding: 5rem 0;
  position: relative;
}
.comparison-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.comparison-table-wrap {
  overflow-x: auto;
  border-radius: 1.25rem;
  border: 1px solid rgba(124,58,237,0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Cairo', sans-serif;
  min-width: 560px;
}
.comparison-table thead tr {
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(6,182,212,0.15));
}
.comparison-table th {
  padding: 1.1rem 1.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #e2e8f0;
  text-align: right;
}
.comparison-table th.col-corex {
  color: #a78bfa;
  background: rgba(124,58,237,0.15);
}
.comparison-table th.col-direct { color: #94a3b8; }
.comparison-table tbody tr {
  border-top: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s;
}
.comparison-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.comparison-table td {
  padding: 0.95rem 1.5rem;
  font-size: 0.88rem;
  color: #cbd5e1;
  text-align: right;
}
.comparison-table td.feature-col { font-weight: 600; color: #e2e8f0; }
.comparison-table td.yes { color: #4ade80; font-weight: 600; }
.comparison-table td.no  { color: #f87171; }
.comparison-table td.mid { color: #fbbf24; }
.comparison-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.comparison-verdict {
  margin-top: 2rem;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(6,182,212,0.08));
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.comparison-verdict-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.comparison-verdict-text h4 { color: #a78bfa; font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.comparison-verdict-text p { color: #94a3b8; font-size: 0.85rem; }

/* ---------- Video Demo Section ---------- */
.video-demo-section {
  margin: 3rem 0 0;
  padding: 2rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 1.25rem;
  text-align: center;
}
.video-demo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.video-play-icon {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  animation: pulse-glow 2.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.4); }
  50%      { box-shadow: 0 0 0 16px rgba(124,58,237,0); }
}
.video-demo-badge {
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.4);
  color: #a78bfa;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.video-demo-title { color: #e2e8f0; font-size: 1.1rem; font-weight: 700; }
.video-demo-sub   { color: #94a3b8; font-size: 0.85rem; }

/* ---------- FAQ Section ---------- */
.faq-section {
  padding: 5rem 0;
  position: relative;
}
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2.5rem;
}
.faq-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.875rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item.open { border-color: rgba(124,58,237,0.4); }
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  text-align: right;
  transition: color 0.2s;
}
.faq-item.open .faq-question { color: #a78bfa; }
.faq-chevron {
  flex-shrink: 0;
  transition: transform 0.3s;
  color: #64748b;
}
.faq-item.open .faq-chevron { transform: rotate(180deg); color: #a78bfa; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s;
  padding: 0 1.5rem;
}
.faq-item.open .faq-answer { max-height: 400px; padding: 0 1.5rem 1.25rem; }
.faq-answer p { color: #94a3b8; font-size: 0.9rem; line-height: 1.7; }
.faq-submit-section {
  margin-top: 2.5rem;
  background: rgba(124,58,237,0.07);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
.faq-submit-text h4 { color: #e2e8f0; font-size: 0.95rem; font-weight: 700; }
.faq-submit-text p  { color: #94a3b8; font-size: 0.82rem; margin-top: 0.25rem; }
.faq-submit-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.faq-submit-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0.5rem;
  color: #e2e8f0;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  min-width: 200px;
}
.faq-submit-input:focus { border-color: #7c3aed; }
.faq-submit-btn {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white; border: none;
  border-radius: 0.5rem;
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.faq-submit-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ---------- Partner Form / Collab Section ---------- */
.collab-section {
  padding: 5rem 0;
  position: relative;
}
.collab-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(6,182,212,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.collab-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.5rem;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 768px) {
  .collab-card { grid-template-columns: 1fr; gap: 2rem; }
}
.collab-info-badge {
  background: rgba(6,182,212,0.15);
  border: 1px solid rgba(6,182,212,0.3);
  color: #06b6d4;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.collab-info h2 { color: #e2e8f0; font-size: 1.75rem; font-weight: 800; margin-bottom: 0.75rem; line-height: 1.3; }
.collab-info p  { color: #94a3b8; font-size: 0.9rem; line-height: 1.7; margin-bottom: 1.5rem; }
.collab-types {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.collab-type-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #cbd5e1;
}
.collab-type-dot {
  width: 8px; height: 8px;
  background: #06b6d4;
  border-radius: 50%;
  flex-shrink: 0;
}
.collab-form {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 1.25rem;
  padding: 2rem;
}
.collab-form h3 {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.4rem;
}
.form-group label span.req { color: #f87171; margin-right: 2px; }
.form-control {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.625rem;
  color: #e2e8f0;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  font-family: 'Cairo', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.form-control:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.form-control::placeholder { color: #475569; }
select.form-control option { background: #1e1535; }
textarea.form-control { resize: vertical; min-height: 90px; }
.collab-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.collab-submit-btn:hover { opacity: 0.92; transform: translateY(-2px); box-shadow: 0 8px 25px rgba(124,58,237,0.4); }
.collab-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.form-success {
  display: none;
  text-align: center;
  padding: 2rem;
  color: #4ade80;
}
.form-success svg { margin-bottom: 0.75rem; }
.form-success h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.form-success p  { color: #94a3b8; font-size: 0.88rem; }
.form-error-msg {
  display: none;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: 0.5rem;
  padding: 0.65rem 1rem;
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* ---------- Coming Soon Features ---------- */
.coming-soon-features {
  padding: 4rem 0;
}
.coming-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.coming-feature-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.coming-feature-card:hover { border-color: rgba(124,58,237,0.25); }
.coming-feature-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(124,58,237,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.coming-feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  color: #fbbf24;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.coming-feature-icon {
  width: 40px; height: 40px;
  background: rgba(124,58,237,0.15);
  border-radius: 0.625rem;
  display: flex; align-items: center; justify-content: center;
  color: #a78bfa;
  margin-bottom: 0.75rem;
}
.coming-feature-card h4 { color: #e2e8f0; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.coming-feature-card p  { color: #64748b; font-size: 0.82rem; line-height: 1.6; }

/* ---------- Scroll-spy nav highlight ---------- */
.nav-link.active-section,
.nav-link.active-section svg { color: #a78bfa !important; }

/* ---------- Dashboard pages ---------- */
body.dashboard-page {
  background: #0f0a1e;
  color: #e2e8f0;
  font-family: 'Cairo', sans-serif;
  min-height: 100vh;
}

/* ============================================================
   MOBILE RESPONSIVE FIXES
   ============================================================ */

/* --- Comparison Table — new clean layout --- */

/* Header inner wrapper */
.comparison-table .th-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* Feature column — icon + label */
.feat-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 0.4rem;
  color: #a78bfa;
  flex-shrink: 0;
}

/* Yes / No / Mid cell wrapper */
.cmp-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
}

/* Icon badges */
.cmp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cmp-yes {
  background: rgba(74,222,128,0.18);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.35);
}
.cmp-no {
  background: rgba(248,113,113,0.15);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.3);
}
.cmp-mid {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
}

/* --- Comparison Table Mobile --- */
@media (max-width: 640px) {
  .comparison-table-wrap {
    overflow-x: unset;
    border-radius: 0.875rem;
  }
  .comparison-table { min-width: 0; width: 100%; }
  .comparison-table thead { display: none; }
  .comparison-table tbody { display: flex; flex-direction: column; gap: 0.625rem; }
  .comparison-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.75rem;
    overflow: hidden;
  }
  .comparison-table tbody tr:hover { background: rgba(255,255,255,0.04); }
  .comparison-table td {
    padding: 0.65rem 0.875rem;
    border: none;
    font-size: 0.83rem;
  }
  .comparison-table td.feature-col {
    grid-column: 1 / -1;
    background: rgba(124,58,237,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-weight: 700;
    color: #e2e8f0;
    font-size: 0.85rem;
  }
  .comparison-table td.yes,
  .comparison-table td.no,
  .comparison-table td.mid {
    font-size: 0.78rem;
    border-top: none;
  }
  .comparison-table td.yes::before {
    content: 'CoreX Ai ';
    display: block;
    font-size: 0.65rem;
    color: #7c3aed;
    font-weight: 700;
    margin-bottom: 0.2rem;
  }
  .comparison-table td.no::before,
  .comparison-table td.mid::before {
    content: 'API مباشر ';
    display: block;
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 0.2rem;
  }
  .comparison-verdict {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
    gap: 0.875rem;
  }
  .comparison-verdict-icon { margin: 0 auto; }
  .comparison-verdict a { margin: 0 auto !important; }
}

/* --- Collab Section Mobile --- */
@media (max-width: 640px) {
  .collab-section { padding: 3rem 0; }
  .collab-card { padding: 1.5rem; gap: 1.5rem; }
  .collab-form { padding: 1.25rem; }
  .collab-info h2 { font-size: 1.35rem; }
  .collab-submit-btn { font-size: 0.88rem; }
}

/* --- Coming-soon Features Mobile --- */
@media (max-width: 480px) {
  .coming-features-grid { grid-template-columns: 1fr; }
}

/* --- Video Demo Mobile --- */
@media (max-width: 480px) {
  .video-demo-section { padding: 1.5rem 1rem; }
  .video-play-icon { width: 56px; height: 56px; }
  .video-demo-title { font-size: 0.95rem; }
}

/* --- FAQ Mobile --- */
@media (max-width: 480px) {
  .faq-submit-section { flex-direction: column; gap: 1rem; }
  .faq-submit-form { width: 100%; }
  .faq-submit-input { width: 100%; }
  .faq-question { font-size: 0.88rem; padding: 1rem; }
}

/* --- Sticky CTA Mobile --- */
@media (max-width: 480px) {
  #sticky-cta { bottom: 1rem; right: 1rem; }
  .sticky-cta-btn { padding: 0.65rem 1rem; font-size: 0.82rem; }
  #back-to-top { bottom: 1rem; left: 1rem; width: 40px; height: 40px; }
}

/* --- Search Mobile --- */
@media (max-width: 480px) {
  .search-box { border-radius: 0.75rem; }
  .search-toggle-btn span { display: none; }
}
