/*
 * =================================================================
 * MAIN.CSS - Veritas Security B2B Website
 * =================================================================
 */

/* ---- Base Styles ---- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--surface);
  color: var(--text);
  /* NEW FONT APPLIED HERE (with system font fallbacks) */
  font-family:
    "Plus Jakarta Sans",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans",
    sans-serif;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* ---- Section Styling ---- */
.section-muted {
  background-color: var(--surface-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/*
 * =================================================================
 * THEME-AWARE HEADER STYLES
 * =================================================================
 */

/* Base variables for light/dark theme header backgrounds */
:root {
  --header-bg-color: rgba(255, 255, 255, 0.9);
  --topbar-bg-color: rgba(232, 232, 232, 0.5);
}

.dark {
  --header-bg-color: hsla(
    var(--primary-h),
    var(--primary-s),
    calc(var(--primary-l) - 24%),
    0.6
  );
  --topbar-bg-color: hsla(
    var(--primary-h),
    var(--primary-s),
    calc(var(--primary-l) - 24%),
    0.75
  );
}

/* Light Theme: Horizontal gradient effect */
.header-top-bar {
  background: linear-gradient(
    to right,
    rgba(232, 232, 232, 0) 0%,
    var(--topbar-bg-color) 50%,
    rgba(232, 232, 232, 0) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-nav {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    var(--header-bg-color) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Dark Theme: Subtle background and border for clear separation */
.dark .header-top-bar,
.dark .header-nav {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    var(--surface-muted) 50%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* Theme Toggle Icon Fix */
#theme-toggle {
  /* Forces a dark icon color in the light theme */
  color: var(--gray-800);
}

.dark #theme-toggle {
  /* Uses the default light text color in the dark theme */
  color: var(--text);
}

/* =================================================================
 * HERO BACKGROUND
 * ================================================================= */

.hero-dreamy-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--surface); /* Base background color */
  /* Overlay of multiple gradients */
  background-image:
    /* Layer 4: Subtle gray glow */
    radial-gradient(
      ellipse at 50% 0%,
      hsla(0, 0%, 50%, 0.15) 0%,
      transparent 50%
    ),
    /* Layer 3: Linear gradient to fade to surface color */
      linear-gradient(to bottom, transparent 70%, var(--surface) 100%),
    /* Layer 2: Primary (blue) glow */
      radial-gradient(
        ellipse at 80% 40%,
        hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.18) 0%,
        transparent 50%
      ),
    /* Layer 1: Secondary (red) glow */
      radial-gradient(
        ellipse at 20% 60%,
        hsla(var(--secondary-h), var(--secondary-s), var(--secondary-l), 0.15)
          0%,
        transparent 50%
      );
}

.hero-map-style {
  /* Filter for the light theme: very subtle, grayish, and light */
  filter: grayscale(1) brightness(1.5) opacity(0.25);
  transition: filter 0.3s ease-in-out;
}

.dark .hero-map-style {
  /* Filter for the dark theme: inverts color to white and keeps it super subtle */
  filter: grayscale(1) invert(1) brightness(1.2) opacity(0.08);
}

/* =================================================================
 * ANIMATIONS
 * ================================================================= */

/* Keyframes for the 'ping' animation (opacity pulse) */
@keyframes ping {
  0%,
  100% {
    opacity: 0.2; /* Starts and ends with low opacity */
  }
  50% {
    opacity: 1; /* Reaches max brightness in the middle */
  }
}

/* Base class that applies the animation */
.animate-ping-node {
  animation: ping 3s ease-in-out infinite;
}

/* Delay classes to de-synchronize the node animations */
.ping-delay-1 {
  animation-delay: 0.7s;
}
.ping-delay-2 {
  animation-delay: 1.4s;
}
.ping-delay-3 {
  animation-delay: 2.1s;
}

/* =================================================================
 * SERVICE ILLUSTRATION STYLES
 * ================================================================= */

.service-illustration {
  /* Filter for light theme: grayscale, with slight brightness/contrast adjustments */
  filter: grayscale(1) brightness(1.05) contrast(0.9) opacity(0.6);
  transition: filter 0.3s ease-in-out;
}

.dark .service-illustration {
  /* Filter for dark theme: a bit more subtle */
  filter: grayscale(1) brightness(0.9) contrast(0.9) opacity(0.4);
}

/* On hover, the illustration becomes colorful and vibrant */
.service-illustration:hover {
  filter: grayscale(0) brightness(1) contrast(1) opacity(1);
}

/* =================================================================
 * FORM STYLES
 * ================================================================= */

.form-input {
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.375rem; /* rounded-md */
  padding: 0.5rem 0.75rem;
  width: 100%;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px
    hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.2);
}

/*
 * =================================================================
 * UNIVERSAL UI COMPONENTS
 * =================================================================
 */

/* ---- Tabs Component Styles ---- */

/* Styles the currently active tab button (e.g., with a colored bottom border). */
.tab-button.active {
  color: var(--primary-accent);
  border-color: var(--primary-accent);
}

/* Hides all tab content panels by default. */
.tab-panel {
  display: none;
}

/* This class is toggled by JavaScript to show the active panel. */
.tab-panel.active {
  display: block;
}

/* ---- Accordion Component Styles ---- */

/* Defines the collapsible content area of the accordion. */
.accordion-content {
  max-height: 0; /* Initially hidden with zero height. */
  overflow: hidden;
  /* Creates a smooth slide-down/slide-up animation when opening/closing. */
  transition: max-height 0.3s ease-out;
}

/* Targets the chevron icon inside the accordion button for animation. */
.accordion-icon {
  transition: transform 0.3s ease-out;
}
