/*
 * Ch.AI Labs - Global Stylesheet
 * --------------------------------------------------
 * This file sets all brand-level defaults.
 */

/* 1. BRAND COLOR & FONT VARIABLES
 * -------------------------------------------------- */
:root {
  /* Brand Colors from Brand Book */
  --chai-clarity-blue: #4A86E8;
  --chai-insight-gold: #FFD966;
  --chai-deep-charcoal: #212529;
  --chai-canvas-white: #F8F9FA;
  --chai-action-red: #E06666;

  /* Font Families from Brand Book */
  --chai-font-heading: 'Roboto Slab', serif;
  --chai-font-body: 'Inter', sans-serif;

  /* Bootstrap 5 Variable Overrides */
  --bs-primary: var(--chai-clarity-blue);
  --bs-secondary: var(--chai-insight-gold);
  --bs-body-color: var(--chai-deep-charcoal);
  --bs-body-bg: var(--chai-canvas-white);
  --bs-body-font-family: var(--chai-font-body);
  --bs-link-color: var(--chai-clarity-blue);
  --bs-link-hover-color: #2a62bc; /* Darker shade of blue */
}

/* 2. GLOBAL TYPOGRAPHY
 * -------------------------------------------------- */
body {
  /* Set base font and color */
  font-family: var(--bs-body-font-family);
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
}

/* Headings use Roboto Slab */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--chai-font-heading);
  font-weight: 700; /* Per Brand Book */
  color: var(--chai-deep-charcoal);
}

/* 3. COMPONENT OVERRIDES
 * -------------------------------------------------- */

/* Buttons */
.btn-primary {
  /* Primary CTA Button */
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
  background-color: var(--bs-link-hover-color);
  border-color: var(--bs-link-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 134, 232, 0.3);
}

.btn-secondary {
  /* Secondary Accent Button */
  background-color: var(--bs-secondary);
  border-color: var(--bs-secondary);
  color: var(--chai-deep-charcoal);
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.btn-secondary:hover {
  background-color: #fdd240; /* Darker gold */
  border-color: #fdd240;
  color: var(--chai-deep-charcoal);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 217, 102, 0.4);
}

/* Navbar */
.navbar-nav .nav-link {
  font-weight: 600;
  color: var(--bs-body-color);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--bs-primary);
}

/* Footer */
footer .nav-link {
  color: var(--bs-body-color);
  transition: color 0.2s ease;
}

footer .nav-link:hover {
  color: var(--bs-primary);
}

/* 4. UTILITY CLASSES
 * -------------------------------------------------- */

/* The signature blue grid background */
.hero-grid-background {
  background-color: #FFFFFF; /* White background for hero */
  background-image: radial-gradient(
    var(--chai-clarity-blue) 1px, 
    transparent 1px
  );
  background-size: 20px 20px;
  background-position: -19px -19px;
  opacity: 0.15; /* Subtle texture */
}

/* Color helpers */
.text-primary { color: var(--bs-primary) !important; }
.text-secondary { color: var(--bs-secondary) !important; }
.text-charcoal { color: var(--chai-deep-charcoal) !important; }
.text-red { color: var(--chai-action-red) !important; }

.bg-canvas-white {
  background-color: rgba(248, 249, 250, 0) !important; /* fully transparent */
}

/* =========================================================
   Global Animated Grid Overlay (Ch.AI Labs brand layer)
   Applies site-wide via layouts/public.blade.php
   ========================================================= */

/* The overlay */
.global-grid-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  z-index: 0;               /* stays behind all content */
  pointer-events: none;     /* never blocks clicks */

  /* Base white canvas */
  background-color: #FFFFFF;

  /* Your clarity grid lines using brand blue token */
  background-image:
      linear-gradient(var(--chai-clarity-blue, #4A86E8) 1px, transparent 1px),
      linear-gradient(to right, var(--chai-clarity-blue, #4A86E8) 1px, transparent 1px);

  background-size: 40px 40px;
  opacity: 0.1;

  /* Gentle drift motion */
  animation: global-grid-pan 60s linear infinite;

  /* Slight softening so it doesn’t look like harsh pixel lines on retina */
  filter: blur(0.3px);

  /* Make sure it doesn't blend weirdly with content */
  mix-blend-mode: normal;
}

/* Content wrapper sits above the grid */
.site-shell {
  position: relative;
  z-index: 1;
  /* no bg-color here on purpose; sections can still have white bg */
}

/* Same motion profile you used on hero, made global */
@keyframes global-grid-pan {
  0% {
      background-position: 0 0;
  }
  100% {
      background-position: 400px 400px;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .global-grid-background {
      animation: none !important;
      background-position: 0 0 !important;
  }
}

footer {
  background-color: var(--chai-canvas-white);
  color: var(--chai-deep-charcoal);
  border-top: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.03);
  font-size: 0.95rem;
  line-height: 1.5;
}

footer h5[style*="Roboto Slab"] {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--chai-deep-charcoal);
  margin-bottom: 0.75rem !important;
}

footer p.fst-italic {
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(0,0,0,0.7);
}

footer .list-unstyled li {
  line-height: 1.4;
  margin-bottom: 0.4rem !important;
}

footer .nav-link.p-0 {
  color: rgba(0,0,0,0.75);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0 !important;
  transition: color 0.15s linear;
}
footer .nav-link.p-0:hover,
footer .nav-link.p-0:focus {
  color: var(--chai-clarity-blue);
  text-decoration: none;
}

footer .py-3 {
  background-color: transparent;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
}

footer [style*="font-size: 0.9rem;"] {
  font-size: 0.8rem !important;
  color: rgba(0,0,0,0.6);
  line-height: 1.4;
  margin-bottom: 0;
}

footer .fs-4 .nav-link.d-inline-block {
  color: var(--chai-deep-charcoal);
  transition: color 0.15s linear;
  padding: 0;
}
footer .fs-4 .nav-link.d-inline-block:hover,
footer .fs-4 .nav-link.d-inline-block:focus {
  color: var(--chai-clarity-blue);
}

footer .fs-4 i {
  font-size: 1.25rem;
  line-height: 1;
}
@media (max-width: 576px) {
  footer .fs-4 {
      font-size: 1.1rem !important;
  }
}

header.sticky-top {
  background-color: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 10; /* keep it above content + grid */
}

.navbar.bg-white {
  background-color: #fff !important;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.navbar-brand img {
  max-height: 40px;
  height: auto;
  display: block;
}

/* nav links */
.navbar-nav .nav-link {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  padding: 0.5rem 0.75rem;
  color: var(--chai-deep-charcoal);
  transition: color 0.15s linear;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
  color: var(--chai-clarity-blue);
  text-decoration: none;
}

/* dropdown menu */
.navbar-nav .dropdown-menu {
  border-radius: 0.5rem;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 16px 40px rgba(0,0,0,0.07);
  padding: 0.5rem 0;
  font-size: 0.9rem;
}
.navbar-nav .dropdown-menu .dropdown-item {
  font-weight: 500;
  padding: 0.5rem 1rem;
  color: var(--chai-deep-charcoal);
}
.navbar-nav .dropdown-menu .dropdown-item:hover,
.navbar-nav .dropdown-menu .dropdown-item:focus {
  background-color: rgba(74,134,232,0.08); /* clarity blue tint */
  color: var(--chai-clarity-blue);
}

/* header CTA button ("Book a Session") */
.navbar-nav .btn.btn-primary {
  border-radius: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(74,134,232,0.3);
  white-space: nowrap;
  padding: 0.6rem 1rem;
}
.navbar-nav .btn.btn-primary:hover,
.navbar-nav .btn.btn-primary:focus {
  box-shadow: 0 6px 16px rgba(74,134,232,0.4);
  transform: translateY(-2px);
}

/* mobile spacing */
@media (max-width: 991px) {
  #mainNav {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
  }

  .navbar-nav .btn.btn-primary {
    width: 100%;
    text-align: center;
  }
}

/* === Navbar toggler (mobile) === */
.navbar-toggler {
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 0.5rem;
  padding: 0.5rem 0.6rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.navbar-toggler:focus {
  outline: 2px solid var(--chai-clarity-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(74,134,232,0.2);
}

.navbar-toggler-icon {
  width: 1.5rem;
  height: 1.5rem;
  background-image:
    linear-gradient(var(--chai-deep-charcoal) 0 0),
    linear-gradient(var(--chai-deep-charcoal) 0 0),
    linear-gradient(var(--chai-deep-charcoal) 0 0);
  background-size: 24px 2px, 24px 2px, 24px 2px;
  background-position:
    center calc(50% - 6px),
    center,
    center calc(50% + 6px);
  background-repeat: no-repeat;
}

/* navbar background & logo treatment */
header.sticky-top {
  background: linear-gradient(#ffffff 0%, #fdfdfd 60%, #fafafa 100%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

/* make logo feel like a brand stamp, more visible */
.navbar .navbar-brand {
  background-color: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  display: flex;
  align-items: center;
}
.navbar-brand img {
  max-height: 48px;
  height: 48px;
  width: auto;
}
@media (max-width: 576px) {
  .navbar-brand img {
    max-height: 40px;
    height: 40px;
  }
}

/* nav links spacing */
.navbar.bg-white {
  background-color: transparent !important; /* we handle bg on header.sticky-top now */
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.navbar-nav .nav-link {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  padding: 0.5rem 0.75rem;
  color: var(--chai-deep-charcoal);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
  color: var(--chai-clarity-blue);
  text-decoration: none;
}

/* dropdown menu styling stays but add subtle brand top border */
.navbar-nav .dropdown-menu {
  position: absolute;
  border-radius: 0.5rem;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 16px 40px rgba(0,0,0,0.07);
  padding: 0.5rem 0;
  font-size: 0.9rem;
  overflow: hidden;
}
.navbar-nav .dropdown-menu::before {
  content: "";
  display: block;
  height: 3px;
  background-color: var(--chai-insight-gold);
}
.navbar-nav .dropdown-menu .dropdown-item {
  font-weight: 500;
  padding: 0.5rem 1rem;
  color: var(--chai-deep-charcoal);
}
.navbar-nav .dropdown-menu .dropdown-item:hover,
.navbar-nav .dropdown-menu .dropdown-item:focus {
  background-color: rgba(74,134,232,0.08);
  color: var(--chai-clarity-blue);
}

/* CTA in header */
.navbar-nav .btn.btn-primary {
  border-radius: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(74,134,232,0.3);
  white-space: nowrap;
  padding: 0.6rem 1rem;
  border-width: 1px;
}
.navbar-nav .btn.btn-primary:hover,
.navbar-nav .btn.btn-primary:focus {
  box-shadow: 0 6px 16px rgba(74,134,232,0.4);
  transform: translateY(-2px);
}

/* footer top bar accent + tighter columns */
footer {
  position: relative;
  background-color: var(--chai-canvas-white);
  border-top: 2px solid var(--chai-clarity-blue); /* brand color usage */
  box-shadow: 0 -8px 24px rgba(0,0,0,0.03);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--chai-deep-charcoal);
  padding-top: 2rem;
}
footer h5[style*="Roboto Slab"] {
  position: relative;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--chai-deep-charcoal);
  margin-bottom: 0.75rem !important;
}
footer h5[style*="Roboto Slab"]::after {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--chai-insight-gold); /* bring in gold */
  border-radius: 2px;
  margin-top: 0.4rem;
}

footer p.fst-italic {
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(0,0,0,0.7);
  max-width: 260px;
}

/* link lists */
footer .list-unstyled li {
  line-height: 1.4;
  margin-bottom: 0.4rem !important;
}
footer .nav-link.p-0 {
  color: rgba(0,0,0,0.75);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0 !important;
  transition: color 0.15s linear;
}
footer .nav-link.p-0:hover,
footer .nav-link.p-0:focus {
  color: var(--chai-clarity-blue);
  text-decoration: none;
}

/* copyright row (shorter) */
footer .py-3 {
  background-color: transparent;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}
footer [style*="font-size: 0.9rem;"] {
  font-size: 0.8rem !important;
  color: rgba(0,0,0,0.6);
  line-height: 1.4;
  margin-bottom: 0;
}

/* social icons row */
footer .fs-4 .nav-link.d-inline-block {
  color: var(--chai-deep-charcoal);
  transition: color 0.15s linear;
  padding: 0;
}
footer .fs-4 .nav-link.d-inline-block:hover,
footer .fs-4 .nav-link.d-inline-block:focus {
  color: var(--chai-clarity-blue);
}
footer .fs-4 i {
  font-size: 1.25rem;
  line-height: 1;
}
@media (max-width: 576px) {
  footer .fs-4 {
    font-size: 1.1rem !important;
  }
}

/* navbar toggler stays visually consistent */
.navbar-toggler {
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 0.5rem;
  padding: 0.5rem 0.6rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.navbar-toggler:focus {
  outline: 2px solid var(--chai-clarity-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(74,134,232,0.2);
}
.navbar-toggler-icon {
  width: 1.5rem;
  height: 1.5rem;
  background-image:
    linear-gradient(var(--chai-deep-charcoal) 0 0),
    linear-gradient(var(--chai-deep-charcoal) 0 0),
    linear-gradient(var(--chai-deep-charcoal) 0 0);
  background-size: 24px 2px, 24px 2px, 24px 2px;
  background-position:
    center calc(50% - 6px),
    center,
    center calc(50% + 6px);
  background-repeat: no-repeat;
}

/* Transparent header default + scrolled state */
header.sticky-top{
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
  z-index: 10;
}
header.sticky-top.header-scrolled{
  background-color: #fff;
  border-bottom-color: rgba(0,0,0,0.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}

/* Ensure navbar itself stays transparent */
.navbar.bg-white{ background-color: transparent !important; }

/* Remove logo pill/background */
.navbar .navbar-brand{
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}
.navbar-brand img{
  max-height: 48px;
  height: 48px;
}
@media (max-width:576px){
  .navbar-brand img{ max-height: 40px; height: 40px; }
}

/* Logo prominence (bigger at top, tidier on scroll) */
header.sticky-top .navbar {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  transition: padding .2s ease;
}
header.sticky-top.header-scrolled .navbar {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.navbar .navbar-brand {
  display: flex;
  align-items: center;
}

header.sticky-top .navbar-brand img {
  height: 56px;
  max-height: 56px;
  width: auto;
  transition: height .2s ease;
}
header.sticky-top.header-scrolled .navbar-brand img {
  height: 44px;
  max-height: 44px;
}

@media (max-width: 576px) {
  header.sticky-top .navbar-brand img { height: 44px; max-height: 44px; }
  header.sticky-top.header-scrolled .navbar-brand img { height: 38px; max-height: 38px; }
}

/* Gold underline on hover/active */
.navbar-nav .nav-link{ position:relative; }
.navbar-nav .nav-link::after{
  content:"";
  position:absolute;
  left:0.75rem; right:0.75rem; bottom:0.2rem;
  height:2px; border-radius:2px;
  background: var(--chai-insight-gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .18s ease;
}
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link:focus::after,
.navbar-nav .nav-link.active::after{
  transform: scaleX(1);
}

/* Mobile: slimmer navbar so header sits cleaner over grid */
@media (max-width: 576px) {
  header.sticky-top .navbar { padding-top: 0.35rem; padding-bottom: 0.35rem; }
  .navbar-nav .nav-link { padding: 0.45rem 0.6rem; }
}

/* Footer: fully transparent base */
footer { background-color: transparent !important; }

/* Logo: large + glow at top; shrink + no glow on scroll */
header.sticky-top .navbar-brand img{
  height: 72px;
  max-height: 72px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(255,217,102,.35)) drop-shadow(0 3px 10px rgba(74,134,232,.18));
  transition: height .2s ease, filter .2s ease;
}
header.sticky-top.header-scrolled .navbar-brand img{
  height: 44px;
  max-height: 44px;
  filter: none;
}

@media (max-width:576px){
  header.sticky-top .navbar-brand img{ height: 56px; max-height: 56px; }
  header.sticky-top.header-scrolled .navbar-brand img{ height: 38px; max-height: 38px; }
}

/* Subtle brand-yellow cues */
.btn:focus {
  outline: 2px solid var(--chai-insight-gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255,217,102,.25) !important;
}
.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(74,134,232,.35), 0 0 0 2px rgba(255,217,102,.5) inset;
}
main a:hover {
  text-decoration-color: var(--chai-insight-gold);
}

/* Header logo: prevent global max-width from shrinking it */
.navbar-brand img { max-width: none !important; }

/* Smooth logo scaling via transform (no layout jump) */
header.sticky-top .navbar-brand img {
  /*height: 40px !important;      /* fixed box; we only scale visually */
  margin-left: 25%;
  max-height: none !important;
  width: auto;
  transform-origin: left center;
  transition: transform .5s ease, filter .5s ease;
}

/* At top: larger with subtle glow */
header.sticky-top.is-at-top .navbar-brand img {
  transform: scale(1.18);
  filter: drop-shadow(0 4px 14px rgba(74,134,232,.25));
}

/* After scroll: neat shrink, no glow */
header.sticky-top.is-scrolled .navbar-brand img {
  transform: scale(0.92);
  filter: none;
}

/* Logo: no fixed max-height */
header.sticky-top .navbar-brand img {
  max-height: none !important;
  width: auto;
}

/* Smooth transform-based scaling only (no fixed height) */
header.sticky-top .navbar-brand img {
  transform-origin: left center;
  transition: transform .24s ease, filter .24s ease;
}

/* Brand anchor offsets at top; reset on scroll */
@media (min-width: 992px) { /* avoid breaking mobile */
  header.sticky-top .navbar-brand {
    transition: margin .24s ease;
  }
  header.sticky-top.is-at-top .navbar-brand {
    margin-left: 20%;
    margin-top: 1em;
  }
  header.sticky-top.is-scrolled .navbar-brand {
    margin-left: 0;
    margin-top: 0;
  }
}
