/* 
  ------------------------------------------------------
  0) CSS Variables for Light/Dark
  ------------------------------------------------------
*/
:root {
  /* Light mode defaults */
  --nav-bg: #ffffff;
  --body-bg: #ffffff;
  --text-color: #008080;
  --link-color: #008080;
  --underline-color: #008080;
  --container-bg: #ffffff;
}

:root[data-theme="dark"] {
  /* Dark mode overrides */
  --nav-bg: #001f3f;
  --body-bg: #000e1e;
  --text-color: #66ffff;
  --link-color: #66ffff;
  --underline-color: #66ffff;
  --container-bg: #002b49; /* a darker shade for main container */
}

/* 
  Dark-mode waves background
*/
:root[data-theme="dark"] #waves-bg {
  background: linear-gradient(
    to bottom,
    #002b49 0%,
    #001f3f 50%,
    #000e1e 90%,
    #000e1e 100%
  );
}

/* ----------------------------------
   BODY + BASIC RESETS
---------------------------------- */
body {
  font-family: 'Lexend Exa', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--body-bg);
  color: var(--text-color);
  width: 100%;
  height: 100%;
}

:focus,
:focus-visible,
a:hover,
button:hover {
  outline: none !important;
  box-shadow: none !important;
}

/* .header is unused */
.header {
  display: none;
}

/* 
  MAIN and MAIN-CONTAINER
  No top margin so banner is flush 
*/
.main {
  margin: 0;
  padding: 0;
}
.main-container {
  max-width: 1200px;
  margin: 0 auto;       /* flush at top */
  padding: 0 0 4rem 0; /* bottom padding only if you like */
  background-color: var(--container-bg);
}

/* ----------------------------------
  SIDEBAR MENU
---------------------------------- */

/* Hidden checkbox to toggle sidebar */
.openSidebarMenu {
  display: none;
}

/* 
  Sidebar: 
  - 350px wide
  - top:0 so it's flush
  - No padding-top
  ------------------------------------------------------
  UPDATE ① — Hide the scrollbar but keep scrolling
  ------------------------------------------------------
*/
#sidebarMenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 350px;
  height: 100%;
  background-color: var(--nav-bg);
  color: var(--text-color);
  transform: translateX(-350px);
  transition: transform 0.5s ease;
  overflow-y: auto;          /* allow scrolling */
  z-index: 9998; 

  /* visually hide the scrollbar */
  scrollbar-width: none;     /* Firefox */
  -ms-overflow-style: none;  /* IE / Edge */
}
#sidebarMenu::-webkit-scrollbar{display:none;} /* Chrome, Safari */

/* Nav list inside sidebar */
.sidebarMenuInner {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sidebarMenuInner li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
  font-weight: bold;
  padding: 15px 20px;
  cursor: pointer;
  color: var(--text-color);
}
:root[data-theme="dark"] .sidebarMenuInner li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Brand item.
   We add margin-top so it sits below the hamburger icon */
.brand-li {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: none;
  margin-top: 60px; /* push the brand/logo beneath the hamburger */
}
.sidebar-logo {
  height: 40px;
  width: auto;
  margin-right: 8px;
}
.brand-text-sidebar {
  color: var(--link-color);
  font-size: 1.3rem;
  text-transform: none;
}

/* Links inside the sidebar */
.sidebarMenuInner li a {
  color: var(--text-color);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
}
.sidebarMenuInner li a:hover {
  color: var(--link-color);
}

/* Submenu icons = 20px wide */
.nav-icon {
  width: 20px;
  height: auto;
  margin-right: 8px;
}

/* Submenu toggle + caret */
.has-submenu .submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.submenu-caret {
  font-size: 0.8rem;
  margin-left: 10px;
}

/* ------------------------------------------------------
   Submenu (sliding list)
   ------------------------------------------------------
   UPDATE ② — remove final divider inside each submenu
   UPDATE ③ — smoother open / close transition
------------------------------------------------------ */
.submenu {
  list-style: none;
  padding-left: 1.5rem;
  padding-top: 5px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: 
    max-height 0.35s ease-in-out,
    opacity    0.35s ease-in-out;
}
.submenu li {
  text-transform: none;
  padding: 10px 0;
  font-weight: normal;
  border-bottom: 1px solid teal;
}
:root[data-theme="dark"] .submenu li {
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

/* 🔸 NEW — last divider hidden (works in both modes) */
.submenu li:last-child{
  border-bottom:none !important;
}

/* reveal the submenu */
.has-submenu.expanded .submenu{
  max-height:800px;   /* plenty of room */
  opacity:1;
}

.submenu li a {
  font-weight: normal;
  font-size: 0.95rem;
}
.submenu li a:hover {
  color: var(--link-color);
}

/* Open/close sidebar via checkbox */
.openSidebarMenu:checked ~ #sidebarMenu {
  transform: translateX(0);
}

/* Hamburger icon in top-left corner, above sidebar */
.sidebarIconToggle {
  position: fixed;
  top: 15px;
  left: 15px;
  width: 30px;
  height: 24px;
  z-index: 9999;
  cursor: pointer;
}

/* Lines for the hamburger (2px thick) */
.spinner {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--text-color);
  transition: all 0.5s ease;
}
.spinner.line1 {top: 0;}
.spinner.line2 {top: 8px;}
.spinner.line3 {top: 16px;}

/* Turn them into an X when open */
.openSidebarMenu:checked ~ .sidebarIconToggle > .line2 {opacity: 0;}
.openSidebarMenu:checked ~ .sidebarIconToggle > .line1 {
  transform: translateY(8px) rotate(45deg);
}
.openSidebarMenu:checked ~ .sidebarIconToggle > .line3 {
  transform: translateY(-8px) rotate(-45deg);
}

/* ----------------------------------
  WAVES BACKGROUND
---------------------------------- */
#waves-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    #004f4f 0%,
    #00cccc 50%,
    #d6ffff 90%,
    #d6ffff 100%
  );
}
.waves {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 35vh;
  margin-bottom: -7px;
  min-height: 120px;
  max-height: 400px;
}
.parallax > use:nth-child(1) {fill: rgba(0, 128, 128, 0.3);}
.parallax > use:nth-child(2) {fill: rgba(0, 128, 128, 0.2);}
.parallax > use:nth-child(3) {fill: rgba(0, 128, 128, 0.1);}
.parallax > use:nth-child(4) {fill: rgba(0, 128, 128, 0.4);}
.parallax > use {
  animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite;
}
.parallax > use:nth-child(1) {animation-delay: -2s;  animation-duration: 7s;}
.parallax > use:nth-child(2) {animation-delay: -3s;  animation-duration:10s;}
.parallax > use:nth-child(3) {animation-delay: -4s;  animation-duration:13s;}
.parallax > use:nth-child(4) {animation-delay: -5s;  animation-duration:20s;}
@keyframes move-forever{
  0%   {transform: translate3d(-90px,0,0);}
  100% {transform: translate3d(85px,0,0);}
}

/* ----------------------------------
  BANNER (VIDEO, TEXT)
---------------------------------- */
#banner {
  position: relative;
  width: 100%;
  height: 50vh;
  margin: 0;
  padding: 0;
  overflow: hidden; 
}
#banner-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
#bannertext {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #fff;
  z-index: 1;
}
#bannertext h1,
#bannertext p {
  margin: 0;
  color: #fff;
  z-index: 1;
}

/* ----------------------------------
  HEADINGS, FLIP CARDS, ETC
---------------------------------- */
h1, h2, h3 {
  color: var(--link-color);
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 700;
}
h2 {margin-top: 0rem;  margin-bottom: 1.5rem;}
.intro {text-align: center; color: #333; margin-bottom: 0rem;}

/* FLIP CARD STYLES */
.flip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.flip {
  position: relative;
  display: inline-block;
  width: 280px;
  height: 200px;
  margin: 1em 0.5em;
  cursor: pointer;
  perspective: 1000px;
}
.flip > .front,
.flip > .back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 0.5em;
  border-radius: 6px;
  backface-visibility: hidden;
  transition: transform 0.5s cubic-bezier(.175,.885,.32,1.275),
              opacity 0.5s;
}
.flip > .front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  transform: rotateY(0deg);
}
.flip > .front h3{
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
  line-height: 1.3;
  color: #fff !important;
}
.flip > .back {
  background-color: #333;
  color: #fff;
  transform: rotateY(-180deg);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.flip > .back h4{margin:0.5rem 0 0.5rem; font-size:1.1rem;}
.flip > .back p {margin:0.5rem 0 1rem; line-height:1.4em;}
.flip:hover > .front {transform: rotateY(180deg);}
.flip:hover > .back  {transform: rotateY(0deg); opacity:1;}
.flip-link {
  display: inline-block;
  padding: 0.3em 0.8em;
  border: 2px solid #fff;
  border-radius: 5px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
  position: relative;
  overflow: hidden;
}
.flip-link:hover {background-color:#fff; color:#333;}
.card-icon {width:60px; height:auto; margin-bottom:0.25rem;}
.flip.analytics  > .front{background:linear-gradient(135deg,#6086cd,#2c44af);}
.flip.seo       > .front{background:linear-gradient(135deg,#0c84a5,#084b6f);}
.flip.experiment> .front{background:linear-gradient(135deg,#09937c,#057a64);}
.flip.general   > .front{background:linear-gradient(135deg,#007b7b,#005f5f);}

/* RIPPLES ON BUTTONS */
.flip-link .wave{
  position:absolute;
  top:50%; left:50%;
  width:25px; height:25px;
  background:rgba(0,0,0,0.15);
  border-radius:50%;
  pointer-events:none;
  transform:translate(-50%,-50%) scale(0);
  opacity:0;
  transition:transform 0.6s ease, opacity 0.8s ease;
}
.flip-link:hover .wave{
  transform:translate(-50%,-50%) scale(10);
  opacity:1;
}

/* ----------------------------------
  FORM INPUTS & CARDS
---------------------------------- */
.form-control {
  background-color:#fff;
  color:#333;
  border:1px solid #ddd;
  border-radius:4px;
  transition:background-color 0.3s, color 0.3s;
}
.form-control::placeholder {color:#ccc; opacity:1;}
:root[data-theme="dark"] .form-control{
  background-color:#001f3f !important;
  color:#fff !important;
  border:1px solid #b0b0b0 !important;
}

/* Cards in light mode = white, dark text, light border */
.card,
.card-body{
  background-color:#fff;
  color:#333;
  border:1px solid #ddd;
  transition:background-color 0.3s, color 0.3s, border-color 0.3s;
}
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .card-body{
  background-color:#001f3f;
  color:var(--text-color);
  border:1px solid #444;
}

/* THEME TOGGLE: "vertical" view transition */
.theme-toggle{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:currentColor;
  width:48px; height:48px;
  background:transparent;
  border:none; border-radius:0.5rem;
  cursor:pointer;
  transition:background 0.2s;
}
.theme-toggle:hover,
.theme-toggle:focus-visible{background:rgba(0,0,0,0.1);}
.theme-toggle-li{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  border-bottom:none !important;
}

/* sr-only utility */
.sr-only{
  position:absolute !important;
  width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap; border-width:0;
}

/* View transition: vertical wipe */
[data-style="vertical"]::view-transition-new(root){
  animation:reveal 1s;
  clip-path:inset(100% 0 0 0);
  z-index:2;
}
[data-style="vertical"]::view-transition-old(root){
  animation:none; z-index:-1;
}
@keyframes reveal{
  from{clip-path:inset(100% 0 0 0);}
  to  {clip-path:inset(0 0 0 0);}
}

/* Underlines for any 'faq-link' if used outside side nav */
.faq-link{
  font-size:1.25rem;
  font-weight:500;
  color:var(--link-color);
  text-decoration:none;
  position:relative;
  transition:color 0.3s;
  padding:0.5rem 0;
}
.faq-link::after{
  content:"";
  position:absolute;
  left:0; bottom:-2px;
  width:0; height:3px;
  background-color:var(--underline-color);
  transition:width 0.3s ease;
}
.faq-link:hover::after{width:100%;}
