/* بات‌بان — Custom styles (Tailwind covers the rest) */

/* ── Scroll & Base ─────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  line-height: 1.8;
  direction: rtl;
  /* subtle dot-grid overlay */
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  /* Prevent horizontal scroll on mobile */
  overflow-x: hidden;
}

/* ── Mobile tap highlight removal ──────────────────────────── */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

a, button, label, summary {
  touch-action: manipulation;
}

/* ── Animated hero glow ────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 60vh;
  background: radial-gradient(ellipse at center,
    rgba(139,92,246,0.18) 0%,
    rgba(34,211,238,0.08) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.08); }
}

/* ── Glassmorphism ─────────────────────────────────────────── */
.glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s ease;
}

.glass-strong {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.3s ease;
}

.glass:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

/* On touch devices, remove the translateY hover — it can feel laggy */
@media (hover: none) {
  .glass:hover {
    transform: none;
  }
  .glass:active {
    transform: scale(0.98);
    border-color: rgba(255,255,255,0.18);
  }
}

/* ── Scroll reveal ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Float animation (phone mockup) ────────────────────────── */
.float-anim {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-15px); }
}

/* ── Pulsing online dot ─────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); }
  50%       { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}
.pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Custom scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: #070817; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8b5cf6, #22d3ee);
  border-radius: 3px;
}
* { scrollbar-width: thin; scrollbar-color: #8b5cf6 #070817; }

/* ── Selection color ────────────────────────────────────────── */
::selection {
  background: rgba(139,92,246,0.45);
  color: #fff;
}

/* ── RTL-safe form inputs ───────────────────────────────────── */
input, textarea, select {
  direction: rtl;
  text-align: right;
}

/* Override browser autofill yellow */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #11163a inset !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  caret-color: #e2e8f0;
  transition: background-color 9999s ease-in-out 0s;
}

/* ── Sticky Mobile CTA bar ──────────────────────────────────── */
#mobile-cta-bar {
  display: none;
}

@media (max-width: 767px) {
  #mobile-cta-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 60;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(7, 8, 23, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.08);
    align-items: center;
    gap: 10px;
    opacity: 1;
    transition: opacity 0.3s ease;
  }

  /* Extra bottom padding on pages to prevent the CTA bar covering content */
  body {
    padding-bottom: 72px;
  }
}

/* ── iOS safe-area insets ───────────────────────────────────── */
@supports (padding-top: env(safe-area-inset-top)) {
  #navbar > div {
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  }
}

/* ── Active tap animation for buttons ───────────────────────── */
.btn-tap {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-tap:active {
  transform: scale(0.95) !important;
}

/* ── Mobile-friendly FAQ summary tap area ───────────────────── */
details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  user-select: none;
}

/* ── No horizontal overflow anywhere (NOT nav — clips dropdown) ─ */
section, footer {
  max-width: 100vw;
  overflow-x: hidden;
}
/* nav must allow the dropdown panel to overflow downward */
nav { overflow: visible; }

/* ── Phone mockup: reduce float animation on mobile (perf) ─── */
@media (max-width: 767px) {
  .float-anim {
    animation-duration: 8s;
  }
}

/* ── Mobile hero text sizing ────────────────────────────────── */
@media (max-width: 479px) {
  .hero-title {
    font-size: 2.25rem !important;
    line-height: 1.25 !important;
  }
}

/* ── Industry card scroll offset (accounts for fixed nav) ────── */
[id^="industry-"], #schools, #industries {
  scroll-margin-top: 100px;
}

/* ── Industries dropdown ────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 480px;
  max-width: calc(100vw - 32px);
  background: rgba(11, 14, 37, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 1.25rem;
  padding: 1rem;
  z-index: 200;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(139,92,246,0.08);
}

.nav-dropdown.open .nav-dropdown-panel,
.nav-dropdown:hover .nav-dropdown-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 0;
}

.nav-dropdown-trigger svg.chevron {
  transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-trigger svg.chevron {
  transform: rotate(180deg);
}

.nav-dropdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.nav-industry-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 0.75rem;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  font-size: 0.8125rem;
  min-height: 44px;
}

.nav-industry-item:hover {
  background: rgba(255,255,255,0.06);
  color: #22d3ee;
}

.nav-industry-item .emoji {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.nav-industry-item .label {
  font-weight: 600;
  display: block;
  line-height: 1.3;
}

.nav-industry-item .desc {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.40);
  display: block;
  line-height: 1.3;
}

/* Mobile industries sub-toggle */
.mobile-industries-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 0.75rem;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mobile-industries-toggle:hover {
  background: rgba(255,255,255,0.05);
}

.mobile-industries-toggle svg.chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.mobile-industries-toggle.expanded svg.chevron {
  transform: rotate(180deg);
}

.mobile-industries-sub {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-right: 1rem;
  padding-bottom: 4px;
}

.mobile-industries-sub.open {
  display: flex;
}

/* ── Industry preview modal chat bubbles ───────────────────── */
.msg-bot, .msg-user {
  padding: 6px 10px;
  border-radius: 12px;
  max-width: 88%;
  line-height: 1.4;
  word-wrap: break-word;
}

.msg-bot {
  background: rgba(255,255,255,0.05);
  align-self: flex-start;
  border-top-right-radius: 4px;
}

.msg-user {
  background: linear-gradient(to left, #8b5cf6, #22d3ee);
  color: white;
  align-self: flex-end;
  border-top-left-radius: 4px;
  font-weight: 600;
}

.msg-btn {
  background: rgba(34, 211, 238, 0.15);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #22d3ee;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  display: inline-block;
}

/* ── Industry modal ensure above everything ─────────────────── */
#industry-modal {
  z-index: 9999;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
