/* ============================================
   AviatorJob — Global Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
  --avred: #D32F2F;
  --avred-deep: #B71C1C;
  --avred-glow: rgba(211,47,47,0.45);
  --slate: #2C3E50;
  --slate-deep: #1A2530;
  --slate-soft: #3C5470;
  --grid-line: rgba(44,62,80,0.055);
}

/* --- Base / Reset --- */
* { -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
html, body { font-family: 'Manrope', sans-serif; background: #FAFAFC; color: var(--slate); }
::selection { background: var(--avred); color: #fff; }
.tnum { font-variant-numeric: tabular-nums; }

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 20%, black 40%, transparent 80%);
}

/* --- Tiles / Cards --- */
.tile {
  position: relative;
  background: #FFF;
  border: 1px solid rgba(44,62,80,0.08);
  border-radius: 28px;
  overflow: hidden;
  transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s cubic-bezier(.16,1,.3,1), border-color .3s;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(44,62,80,0.04), 0 4px 16px rgba(44,62,80,0.04);
}
.tile:hover {
  transform: translateY(-3px);
  border-color: rgba(44,62,80,0.18);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 8px 24px rgba(44,62,80,0.08), 0 24px 48px rgba(44,62,80,0.06);
}
.tile-dark {
  background: linear-gradient(135deg, #1A2530 0%, #2C3E50 100%);
  border: 1px solid rgba(255,255,255,0.06);
  color: #FFF;
}
.tile-dark:hover { border-color: rgba(211,47,47,0.35); }
.tile-red {
  background: radial-gradient(circle at 100% 0%, rgba(255,255,255,0.08) 0%, transparent 50%), linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
  border: 1px solid rgba(255,255,255,0.14);
  color: #FFF;
  box-shadow: 0 0 0 1px rgba(211,47,47,0.35), 0 12px 32px rgba(211,47,47,0.28), 0 24px 56px rgba(211,47,47,0.18);
}
.tile-red:hover {
  box-shadow: 0 0 0 1px rgba(211,47,47,0.55), 0 16px 40px rgba(211,47,47,0.35), 0 32px 72px rgba(211,47,47,0.22);
}
.tile-static:hover { transform: none; }

/* --- Glass Nav --- */
.glass {
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(44,62,80,0.08);
}

/* --- Header / Sticky Nav --- */
header { transition: box-shadow .3s, background .3s; }
header.scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 24px rgba(44,62,80,0.08), 0 1px 4px rgba(44,62,80,0.04);
}
header .status-bar { transition: max-height .3s, opacity .3s, padding .2s; max-height: 36px; overflow: hidden; }
header.scrolled .status-bar { max-height: 0; opacity: 0; padding: 0; }

/* --- Registration Marks (decorative corners) --- */
.reg-marks::before, .reg-marks::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--avred);
  opacity: .55;
  z-index: 2;
}
.reg-marks::before { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.reg-marks::after { bottom: 14px; right: 14px; border-left: none; border-top: none; }
.tile-dark .reg-marks::before, .tile-dark .reg-marks::after,
.tile-red .reg-marks::before, .tile-red .reg-marks::after { border-color: rgba(255,255,255,0.4); }

/* --- Buttons --- */
.btn-red {
  background: linear-gradient(180deg, #D32F2F 0%, #B71C1C 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 24px rgba(211,47,47,0.30), 0 16px 40px rgba(211,47,47,0.18);
  transition: transform .2s, box-shadow .25s;
  position: relative;
  overflow: hidden;
}
.btn-red:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 12px 32px rgba(211,47,47,0.42), 0 24px 56px rgba(211,47,47,0.22);
}
.btn-red::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 36%;
  height: 100%;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.28) 50%, transparent 100%);
  animation: shine 4s ease-in-out infinite;
}
.btn-ghost {
  background: #fff;
  color: var(--slate);
  border: 1px solid rgba(44,62,80,0.18);
  box-shadow: 0 2px 6px rgba(44,62,80,0.04);
  transition: transform .2s, border-color .25s;
}
.btn-ghost:hover { border-color: var(--slate); transform: translateY(-1px); }
.btn-dark {
  background: linear-gradient(180deg, #2C3E50 0%, #1A2530 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(44,62,80,0.20);
  transition: transform .2s, box-shadow .25s;
}
.btn-dark:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(44,62,80,0.30); }

/* --- Glows --- */
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 30%, rgba(211,47,47,0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 10%, rgba(44,62,80,0.06), transparent 65%);
}
.section-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211,47,47,0.06), transparent 70%);
  pointer-events: none;
}

/* --- Decorative patterns --- */
.scan::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255,255,255,0.018) 3px, rgba(255,255,255,0.018) 4px);
  pointer-events: none;
}
.caution { background: repeating-linear-gradient(45deg, var(--avred) 0 10px, #1A2530 10px 20px); opacity: .18; }
.job-accent { width: 3px; border-radius: 6px; background: linear-gradient(180deg, var(--avred), transparent); }
.founder-accent { border-left: 3px solid var(--avred); }

/* --- Form Inputs --- */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(44,62,80,0.12);
  background: #FAFAFC;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  color: var(--slate);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus { border-color: var(--avred); box-shadow: 0 0 0 3px rgba(211,47,47,0.08); }
.form-input::placeholder { color: #7A8A99; }
textarea.form-input { resize: vertical; min-height: 100px; }

/* --- Scroll Reveal Animations --- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale { opacity: 0; transform: scale(0.92); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal-scale.visible { opacity: 1; transform: scale(1); }
.stagger-1 { transition-delay: .08s !important; }
.stagger-2 { transition-delay: .16s !important; }
.stagger-3 { transition-delay: .24s !important; }
.stagger-4 { transition-delay: .32s !important; }

/* --- Keyframe Animations --- */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--avred-glow); }
  50% { opacity: .65; box-shadow: 0 0 0 8px rgba(211,47,47,0); }
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--avred); animation: pulse-dot 1.8s infinite cubic-bezier(.66,0,0,1); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise .7s cubic-bezier(.16,1,.3,1) both; }

@keyframes shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(220%); } }

@keyframes count-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.count-anim { animation: count-up .6s cubic-bezier(.16,1,.3,1) both; }

@keyframes float-gentle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.float { animation: float-gentle 4s ease-in-out infinite; }
.float-delay { animation: float-gentle 4.5s ease-in-out infinite; animation-delay: 1.5s; }

@keyframes text-shimmer { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.shimmer-text {
  background: linear-gradient(90deg, var(--avred), #FF6B6B, var(--avred));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 4s linear infinite;
}

@keyframes ai-pulse {
  0% { box-shadow: 0 0 0 0 rgba(211,47,47,0.3); }
  70% { box-shadow: 0 0 0 12px rgba(211,47,47,0); }
  100% { box-shadow: 0 0 0 0 rgba(211,47,47,0); }
}
.ai-pulse { animation: ai-pulse 2s infinite; }

@keyframes connector-pulse { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
.connector-line {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(211,47,47,0.1), rgba(211,47,47,0.5), rgba(211,47,47,0.1));
  background-size: 200% 100%;
  animation: connector-pulse 2.5s linear infinite;
}

/* --- How It Works (index) --- */
.hiw-step { cursor: pointer; transition: all .35s cubic-bezier(.16,1,.3,1); }
.hiw-step.active { border-color: var(--avred) !important; box-shadow: 0 0 0 1px var(--avred), 0 8px 24px rgba(211,47,47,0.12) !important; transform: translateY(-4px) !important; }
.hiw-step .step-num { transition: all .3s; }
.hiw-step.active .step-num { background: var(--avred) !important; color: #fff !important; }
.hiw-detail { display: none; }
.hiw-detail.active { display: block; animation: rise .5s cubic-bezier(.16,1,.3,1) both; }

/* --- FAQ Accordion --- */
.faq-item { border-bottom: 1px solid rgba(44,62,80,0.08); }
.faq-item:last-child { border-bottom: none; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .4s cubic-bezier(.16,1,.3,1), padding .3s; }
.faq-item.open .faq-answer { max-height: 400px; }
.faq-item .faq-chevron { transition: transform .3s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-item.open .faq-icon { background: var(--avred) !important; border-color: var(--avred) !important; }
.faq-item.open .faq-icon .faq-chevron { color: #fff !important; }

/* --- FAQ Category Tabs (faq page) --- */
.cat-tab {
  cursor: pointer;
  transition: all .25s;
  border: 1px solid rgba(44,62,80,0.12);
  border-radius: 9999px;
  padding: 8px 20px;
}
.cat-tab.active { background: var(--avred); color: #fff; border-color: var(--avred); }
.cat-tab:not(.active):hover { border-color: var(--avred); color: var(--avred); }
.cat-section { display: none; }
.cat-section.active { display: block; }

/* --- Testimonial Tabs --- */
.test-tab { cursor: pointer; transition: all .25s; }
.test-tab.active { color: var(--avred) !important; border-color: var(--avred) !important; }

/* --- Testimonial Marquee --- */
.marquee-wrap {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 4%, black 96%, transparent);
}
@keyframes scroll-ltr { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scroll-rtl { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }
.marquee-track-ltr { display: flex; gap: 20px; animation: scroll-ltr 45s linear infinite; width: max-content; }
.marquee-track-rtl { display: flex; gap: 20px; animation: scroll-rtl 50s linear infinite; width: max-content; }
.marquee-track-ltr:hover, .marquee-track-rtl:hover { animation-play-state: paused; }
.testimonial-card {
  width: 380px;
  flex-shrink: 0;
  padding: 24px 28px;
  background: #fff;
  border: 1px solid rgba(44,62,80,0.08);
  border-radius: 20px;
  transition: border-color .25s, box-shadow .25s;
}
.testimonial-card:hover { border-color: rgba(211,47,47,0.2); box-shadow: 0 8px 24px rgba(44,62,80,0.06); }

/* --- Job Cards (jobs page) --- */
.job-card {
  background: #fff;
  border: 1px solid rgba(44,62,80,0.08);
  border-radius: 20px;
  overflow: hidden;
  transition: border-color .3s, box-shadow .3s;
}
.job-card:hover { border-color: rgba(44,62,80,0.15); box-shadow: 0 4px 16px rgba(44,62,80,0.06); }
.job-card.expanded { border-color: rgba(211,47,47,0.2); box-shadow: 0 8px 32px rgba(44,62,80,0.08); }
.job-header { cursor: pointer; padding: 20px 24px; display: flex; align-items: center; gap: 16px; transition: background .2s; }
.job-header:hover { background: rgba(44,62,80,0.015); }
.job-body { max-height: 0; overflow: hidden; transition: max-height .5s cubic-bezier(.16,1,.3,1); }
.job-card.expanded .job-body { max-height: 2000px; }
.job-chevron { transition: transform .3s; color: var(--slate-soft); }
.job-card.expanded .job-chevron { transform: rotate(180deg); color: var(--avred); }

/* --- Contact Role Tabs (contact page) --- */
.role-tab {
  cursor: pointer;
  transition: all .25s;
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 16px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 15px;
}
.role-tab.active-employer { background: var(--avred); color: #fff; }
.role-tab.active-candidate { background: var(--slate); color: #fff; }
.role-tab:not(.active-employer):not(.active-candidate) { background: transparent; color: var(--slate); border: 1px solid rgba(44,62,80,0.12); }
.role-tab:not(.active-employer):not(.active-candidate):hover { border-color: var(--avred); }

/* --- Chat Widget (index page) --- */
.chat-fab { position: fixed; bottom: 24px; right: 24px; z-index: 999; }
.chat-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D32F2F, #B71C1C);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(211,47,47,0.35), 0 0 0 0 rgba(211,47,47,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s, box-shadow .25s;
}
.chat-btn:hover { transform: scale(1.08); box-shadow: 0 12px 36px rgba(211,47,47,0.45); }
.chat-btn .badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #fff;
}
@keyframes chat-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.chat-fab.bounce .chat-btn { animation: chat-bounce .5s cubic-bezier(.36,.07,.19,.97); }
.chat-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 360px;
  max-height: 480px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(44,62,80,0.1);
  box-shadow: 0 24px 64px rgba(44,62,80,0.15), 0 8px 24px rgba(44,62,80,0.08);
  overflow: hidden;
  transform: scale(0.9) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .2s;
}
.chat-panel.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }
.chat-header { background: linear-gradient(135deg, #D32F2F, #B71C1C); padding: 20px; color: #fff; }
.chat-body { padding: 20px; max-height: 300px; overflow-y: auto; }
.chat-msg { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; margin-bottom: 8px; max-width: 85%; }
.chat-msg.bot { background: #f1f5f9; color: var(--slate); border-bottom-left-radius: 4px; }
.chat-msg.user { background: var(--avred); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-input-bar { padding: 12px 16px; border-top: 1px solid rgba(44,62,80,0.08); display: flex; gap: 8px; }
.chat-input {
  flex: 1;
  border: 1px solid rgba(44,62,80,0.12);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  font-family: 'Manrope', sans-serif;
}
.chat-input:focus { border-color: var(--avred); }
.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--avred);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.chat-send:hover { background: var(--avred-deep); }

/* --- Responsive Nav --- */
@media (max-width: 1023px) { .desk-nav { display: none; } .mob-menu { display: flex !important; } }
@media (min-width: 1024px) { .mob-menu { display: none !important; } }
@media (max-width: 480px) { .chat-panel { width: calc(100vw - 32px); right: -8px; } }
