/* ===================================================
   CyberMapSec – Main Stylesheet
   =================================================== */

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

html { scroll-behavior: smooth; }

body {
  background-color: #0B1121;
  color: #f1f5f9;
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0F172A; }
::-webkit-scrollbar-thumb { background: #2563EB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #38BDF8; }

/* ---- Selection ---- */
::selection { background: rgba(37, 99, 235, 0.4); color: #fff; }

/* ---- Focus ---- */
:focus-visible { outline: 2px solid #2563EB; outline-offset: 3px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
#navbar {
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

#navbar.scrolled {
  background: rgba(11, 17, 33, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 4px 24px rgba(0,0,0,0.4);
}

/* ============================================================
   REVEAL ANIMATIONS (scroll-triggered)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   HERO PARTICLES
   ============================================================ */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleDrift linear infinite;
}

@keyframes particleDrift {
  0% { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-100px) translateX(60px); opacity: 0; }
}

/* ============================================================
   GLOWING BUTTON EFFECT
   ============================================================ */
.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #2563EB, #38BDF8, #2563EB);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

.btn-glow:hover::before { opacity: 1; }

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   GRADIENT TEXT UTILITY
   ============================================================ */
.gradient-text {
  background: linear-gradient(135deg, #2563EB, #38BDF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   GLASSMORPHISM CARD
   ============================================================ */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================================
   ANIMATED COUNTER
   ============================================================ */
[data-count] {
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   SERVICE CARDS
   ============================================================ */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563EB, #38BDF8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card:hover::after { transform: scaleX(1); }

/* ============================================================
   METHODOLOGY SCANNING LINE ANIMATION
   ============================================================ */
@keyframes scan {
  0% { background-position: -200% center; }
  100% { background-position: 300% center; }
}

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.faq-trigger { cursor: pointer; }

.faq-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.faq-content.open {
  display: block;
}

.faq-icon.rotated { transform: rotate(180deg); }

/* ============================================================
   FORM INPUTS
   ============================================================ */
input, textarea, select {
  background-color: rgba(15, 23, 42, 0.8);
  color: #f1f5f9;
  border: 1px solid rgba(100, 116, 139, 0.4);
  border-radius: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

input::placeholder, textarea::placeholder { color: #475569; }

select option { background-color: #1e293b; }

/* ============================================================
   GRADIENT BORDER UTILITY
   ============================================================ */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, #2563EB, #38BDF8);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   LOADER
   ============================================================ */
#loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ============================================================
   ANIMATED GRADIENT BACKGROUND (subtle)
   ============================================================ */
.animated-bg {
  background: linear-gradient(-45deg, #0B1121, #0f1f3d, #0d2040, #0B1121);
  background-size: 400% 400%;
  animation: bgShift 12s ease infinite;
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================================
   SECTION DIVIDERS
   ============================================================ */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.3), transparent);
}

/* ============================================================
   TYPOGRAPHY REFINEMENTS
   ============================================================ */
h1, h2, h3, h4 {
  letter-spacing: -0.025em;
  line-height: 1.1;
}

p { line-height: 1.7; }

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: rgba(37, 99, 235, 0.1);
  padding: 0.125em 0.375em;
  border-radius: 0.25rem;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

/* ============================================================
   MOBILE MENU TRANSITION
   ============================================================ */
#mobileMenu {
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

/* ============================================================
   TECH BADGES
   ============================================================ */
.tech-badge {
  transition: all 0.2s ease;
  user-select: none;
}

.tech-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* ============================================================
   INDUSTRY CARDS
   ============================================================ */
.industry-card {
  cursor: default;
}

/* ============================================================
   VULNERABILITY CARDS
   ============================================================ */
.vuln-card {
  cursor: default;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

/* ============================================================
   REPORT MOCKUP CODE BLOCK
   ============================================================ */
.report-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ============================================================
   COOKIE BANNER SLIDE IN
   ============================================================ */
#cookieBanner {
  animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  #navbar, #cookieBanner, #backToTop, #loader { display: none !important; }
  body { background: white; color: black; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   PAGE-SPECIFIC HERO VARIANTS (for inner pages)
   ============================================================ */
.page-hero {
  background: linear-gradient(135deg, #0B1121 0%, #0d1829 50%, #0B1121 100%);
  padding-top: 8rem;
  padding-bottom: 5rem;
}

.page-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.1);
  color: #38BDF8;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

/* ============================================================
   PROSE STYLING (Blog/Policy pages)
   ============================================================ */
.prose-dark {
  color: #cbd5e1;
  max-width: 72ch;
}

.prose-dark h2 {
  color: #f1f5f9;
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.prose-dark h3 {
  color: #e2e8f0;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose-dark p { margin-bottom: 1.25rem; }

.prose-dark ul, .prose-dark ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose-dark li { margin-bottom: 0.5rem; }

.prose-dark a { color: #38BDF8; text-decoration: underline; }
.prose-dark a:hover { color: #7dd3fc; }

.prose-dark strong { color: #f1f5f9; font-weight: 600; }

.prose-dark code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  background: rgba(37, 99, 235, 0.1);
  padding: 0.125em 0.375em;
  border-radius: 0.25rem;
}

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */
@media (max-width: 640px) {
  h1 { font-size: 2.75rem !important; }
  h2 { font-size: 2rem !important; }

  .service-card { padding: 1.25rem; }
}

/* ============================================================
   ACCESSIBILITY – SKIP LINK
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: #2563EB;
  color: white;
  border-radius: 0 0 0.5rem 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus { top: 0; }

/* ============================================================
   ANIMATED GLOW RING (hero elements)
   ============================================================ */
.glow-ring {
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3),
              0 0 20px rgba(37, 99, 235, 0.15),
              0 0 40px rgba(56, 189, 248, 0.08);
}

.glow-ring-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3),
                0 0 20px rgba(37, 99, 235, 0.15);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6),
                0 0 40px rgba(37, 99, 235, 0.3),
                0 0 80px rgba(56, 189, 248, 0.15);
  }
}
