/* ==========================
   Wrexham Psychology Technicians – Custom Styles
   Supports Light/Dark Mode
========================== */

/* -------- Light Mode (default rules) -------- */
body.quarto-light {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #ffffff;
  color: #151f35; /* Navy text */
  line-height: 1.6;
}

/* Navbar (light mode) */
body.quarto-light .navbar {
  background-color: #151f35 !important;
}
body.quarto-light .navbar a,
body.quarto-light .navbar-brand {
  color: #ffffff !important;
  font-weight: 500;
}
body.quarto-light .navbar a:hover {
  color: #50b9a8 !important;
  text-decoration: underline;
}

/* Dropdown menu visibility fix (light mode) */
body.quarto-light .navbar .dropdown-menu {
  background-color: #151f35 !important;
  border: none;
}
body.quarto-light .navbar .dropdown-item {
  color: #ffffff !important;
  font-weight: 500;
}
body.quarto-light .navbar .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #50b9a8 !important;
}

/* Headings */
body.quarto-light h1, body.quarto-light h2, body.quarto-light h3, body.quarto-light h4,
body.quarto-light h5, body.quarto-light h6 {
  font-family: "Segoe UI", Verdana, sans-serif;
  color: #151f35;
  font-weight: 600;
}

/* Links */
body.quarto-light a {
  color: #50b9a8;
  text-decoration: none;
}
body.quarto-light a:hover {
  color: #3b8d7f;
  text-decoration: underline;
}

/* Footer */
body.quarto-light footer {
  background-color: #151f35;
  color: #ffffff;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

/* Buttons */
body.quarto-light .btn-primary {
  background-color: #50b9a8;
  border-color: #50b9a8;
  color: #151f35;
  font-weight: 600;
}
body.quarto-light .btn-primary:hover {
  background-color: #3b8d7f;
  border-color: #3b8d7f;
  color: #ffffff;
}

/* Cards */
body.quarto-light .card {
  border-radius: 12px;
  border: 1px solid #e6e6e6;
  box-shadow: 0px 3px 6px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}
body.quarto-light .card-title {
  color: #151f35;
  font-weight: 600;
}

/* Accent areas */
body.quarto-light .accent {
  background-color: #50b9a8;
  color: #151f35;
  padding: 1rem;
  border-radius: 8px;
}

/* Accent block consistent dimensions */
body.quarto-light .accent,
body.quarto-dark .accent {
  padding: 1rem;        /* inner spacing */
  margin: 1rem 0;       /* spacing above/below block */
  border-radius: 8px;   /* rounded corners */
  line-height: 1.6;     /* consistent line height */
}

/* -------------------------
   Breadcrumbs
------------------------- */
.breadcrumb-container {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
body.quarto-light .breadcrumb-container {
  background-color: #f0f8ff;
  color: #151f35;
}
body.quarto-light .breadcrumb-container a {
  color: #151f35;
  text-decoration: none;
}
body.quarto-light .breadcrumb-container a:hover {
  text-decoration: underline;
  color: #50b9a8;
}
.breadcrumb-container .breadcrumb li {
  display: inline;
  margin-right: 0.5rem;
}
.breadcrumb-container .breadcrumb li::after {
  content: "›";
  margin-left: 0.5rem;
  color: #888;
}
.breadcrumb-container .breadcrumb li:last-child::after {
  content: "";
}

/* -------------------------
   Chat Widget
------------------------- */
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}

.chat-widget-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: none;
  position: relative;
  transition: transform 0.2s;
}

.chat-widget-button:hover {
  transform: scale(1.05);
}

.chat-widget-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Speech bubble on hover */
.chat-speech {
  position: absolute;
  bottom: 70px;
  right: 0;
  background-color: #50b9a8;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s ease;
  font-weight: 600;
}

.chat-widget-button:hover .chat-speech {
  opacity: 1;
  transform: translateY(0);
}



/* -------- Dark Mode Overrides -------- */
body.quarto-dark {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #121212; /* Dark base */
  color: #e0e0e0; /* Light text */
  line-height: 1.6;
}

/* Navbar dark mode */
body.quarto-dark .navbar {
  background-color: #0d1324 !important; /* Deeper navy */
}
body.quarto-dark .navbar a,
body.quarto-dark .navbar-brand {
  color: #ffffff !important;
}
body.quarto-dark .navbar a:hover {
  color: #50b9a8 !important;
}

/* Cards dark mode */
body.quarto-dark .card {
  background-color: #1e1e1e;
  border: 1px solid #2c2c2c;
  box-shadow: 0px 3px 6px rgba(0,0,0,0.5);
}
body.quarto-dark .card-title {
  color: #ffffff;
}

/* Accent areas dark mode */
body.quarto-dark .accent {
  background-color: #50b9a8;
  color: #121212;
}

/* Links dark mode */
body.quarto-dark a {
  color: #50b9a8;
}
body.quarto-dark a:hover {
  color: #3b8d7f;
}

/* Headings dark mode */
body.quarto-dark h1, body.quarto-dark h2, body.quarto-dark h3, body.quarto-dark h4,
body.quarto-dark h5, body.quarto-dark h6 {
  color: #ffffff;
}

/* -------------------------
   Light/Dark Mode Toggle
------------------------- */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
}

.theme-toggle:hover {
  transform: scale(1.2);
  transition: transform 0.2s;
}


/* -------------------------
   Scroll to Top Widget 
------------------------- */
#scroll-top-widget {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;

  /* Matches the "Secondary Button" feel but slightly larger */
  width: 56px;
  height: 56px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  background-color: #151f35;
  color: white;

  cursor: pointer;
  user-select: none;

  box-shadow: 0 4px 12px rgba(0,0,0,0.3);

  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);

  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s,
    background-color 0.2s ease;
}

/* Arrow styling — bold & optically centred */
#scroll-top-widget span {
  display: block;

  font-size: 1.8rem; 
  font-weight: 900;
  line-height: 1;

  /* Subtle shadow for depth */
  text-shadow:
    0 0 1px currentColor,
    0 2px 4px rgba(0,0,0,0.35);

  /* ADJUST THIS: -5px moves the arrow higher than -2px */
  transform: translateY(-10px);
}


/* Hover state for interaction feedback */
#scroll-top-widget:hover {
  background-color: #50b9a8;
  transform: scale(1.1);
}

/* Visible state */
#scroll-top-widget.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Make the footer a full section */
.full-page-footer {
  background-color: #151f35; /* Navy background */
  color: #ffffff;
  text-align: center;
  width: 100%;
  min-height: 50vh; /* covers half the viewport height; adjust as needed */
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center content */
  align-items: center;
  padding: 2em;
  box-sizing: border-box;
}

/* Footer content */
.full-page-footer h2 {
  margin: 0 0 0.5em 0;
  font-size: 1.8em;
}

.full-page-footer p {
  margin: 0.5em 0;
  font-size: 1.1em;
}

.full-page-footer a {
  color: #f0c040;
  text-decoration: none;
  margin: 0 0.5em;
}

.full-page-footer a:hover {
  text-decoration: underline;
}



/* -------------------------
   Remove Anchor
------------------------- */
/* Remove AnchorJS chain icons completely */
a.anchorjs-link {
    display: none !important;
}


/* -------------------------
   Smooth Scrolling
------------------------- */
/* Remove AnchorJS chain icons completely */

html {
    scroll-behavior: smooth;
}




/* -------------------------
   Sidebar TOC sticky 
---------------------------*/



#quarto-sidebar {
    position: sticky;
    top: 1rem; /* adjust offset */
}

/* -------------------------
   Transition Effects for links and buttons
---------------------------*/

a {
    transition: color 0.2s;
}

a:hover {
    color: #0077cc;
}
/* ==========================
   Floating Help Widget (REFINED SPACING)
   Left-only 90° radial menu
========================== */

#help-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
}

/* --------------------------
   Main Wrexham logo button
-------------------------- */
#help-main {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  position: relative;
  z-index: 10;
}

#help-main img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
}

#help-main:active img {
  transform: scale(0.92);
}

/* --------------------------
    Planetary Animations
-------------------------- */
@keyframes planet-float {
  0% { transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) translateY(0px); }
  50% { transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) translateY(-8px); }
  100% { transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) translateY(0px); }
}

@keyframes atmosphere-pulse {
  0%, 100% { box-shadow: 0 4px 10px rgba(0,0,0,0.3), 0 0 5px rgba(80, 185, 168, 0.2); }
  50% { box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 15px rgba(80, 185, 168, 0.5); }
}

/* --------------------------
    Secondary action buttons (The Icons)
-------------------------- */
.help-action {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #151f35;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; 
  opacity: 0;
  pointer-events: none;
  z-index: 99;

  /* Start at center, scale 0 */
  transform: translate(-50%, -50%) scale(0);

  /* Smoother transition for the pop-out */
  transition: 
    transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
    opacity 0.4s ease,
    filter 0.3s ease;

  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.help-action img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  border-radius: 50%;
  display: block; 
}

/* --------------------------
    Gravity-Aligned Keyframes
-------------------------- */

/* This animation moves the planets along the vector from the center */
@keyframes gravity-float {
  0% { 
    transform: translate(-50%, -50%) translate(calc(var(--tx) * 1), calc(var(--ty) * 1)) scale(1); 
  }
  50% { 
    /* Moves the planet 8% further out along its unique radial path */
    transform: translate(-50%, -50%) translate(calc(var(--tx) * 1.08), calc(var(--ty) * 1.08)) scale(1.03); 
  }
  100% { 
    transform: translate(-50%, -50%) translate(calc(var(--tx) * 1), calc(var(--ty) * 1)) scale(1); 
  }
}

/* Optional: Make the Wrexham logo (the Sun) pulse to show it's the source of gravity */
#help-main img {
  animation: sun-glow 4s ease-in-out infinite;
}

@keyframes sun-glow {
  0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.35); transform: scale(1); }
  50% { box-shadow: 0 4px 25px rgba(80, 185, 168, 0.4); transform: scale(1.03); }
}

/* --------------------------
    Planet Movement & Hover Logic
-------------------------- */

/* When the widget is open, apply the radial gravity and pulse animations */
#help-widget.open .help-action {
  opacity: 1;
  pointer-events: auto;
  /* Use the gravity-float instead of planet-float */
  animation: 
    gravity-float 5s ease-in-out infinite,
    atmosphere-pulse 5s ease-in-out infinite;
}

/* Hover State: The "Planet" stabilizes and zooms in */
.help-action:hover {
  animation-play-state: paused !important; /* Stop the pulse so it's easy to click */
  /* We scale it slightly further out (1.1) so it feels like it's "leaping" toward the user */
  transform: translate(-50%, -50%) translate(calc(var(--tx) * 1.1), calc(var(--ty) * 1.1)) scale(1.3) !important;
  filter: brightness(1.2);
  box-shadow: 0 0 25px rgba(80, 185, 168, 0.8) !important;
  z-index: 100;
}

/* --------------------------
    Radial Fan Positions (Using Variables)
-------------------------- */

/* LAYER 1 */
.action-myuni { --tx: 41px; --ty: -92px; transition-delay: 0.05s; animation-delay: 0.1s !important; }
.action-digital-learning-skills { --tx: -17px; --ty: -100px; transition-delay: 0.1s; animation-delay: 0.3s !important; }
.action-email { --tx: -71px; --ty: -71px; transition-delay: 0.15s; animation-delay: 0.5s !important; }
.action-wris { --tx: -100px; --ty: -15px; transition-delay: 0.2s; animation-delay: 0.7s !important; }
.action-gorilla { --tx: -92px; --ty: 42px; transition-delay: 0.25s; animation-delay: 0.9s !important; }

/* LAYER 2 */
.action-osf { --tx: -63px; --ty: -124px; transition-delay: 0.3s; animation-delay: 0.2s !important; }
.action-itdesk { --tx: -130px; --ty: -60px; transition-delay: 0.35s; animation-delay: 0.4s !important; }
.action-jisc { --tx: -140px; --ty: 20px; transition-delay: 0.4s; animation-delay: 0.6s !important; }
.action-github { --tx: 20px; --ty: -140px; transition-delay: 0.45s; animation-delay: 0.8s !important; }

/* The Master Transform Rule (Initial State) */
#help-widget.open .help-action {
  transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(1);
}
/* ============================================================
   BRANDED MULTI-COLORED DROPDOWN SEQUENCE (9 COLORS)
   ============================================================ */

/* 1. Reset the menu container */
.navbar .dropdown-menu {
  background-color: #151f35 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  min-width: 220px; /* Ensures text has enough room */
}

/* 2. Color Mapping (Order: 1-9) */

/* 1: Deep Purple (#4c4394) */
.navbar .dropdown-menu li:nth-child(1) .dropdown-item {
  background-color: #4c4394 !important; color: #ffffff !important;
}

/* 2: Red (#e64550) */
.navbar .dropdown-menu li:nth-child(2) .dropdown-item {
  background-color: #e64550 !important; color: #ffffff !important;
}

/* 3: Pink (#eb5e95) */
.navbar .dropdown-menu li:nth-child(3) .dropdown-item {
  background-color: #eb5e95 !important; color: #ffffff !important;
}

/* 4: Orange (#e6881e) */
.navbar .dropdown-menu li:nth-child(4) .dropdown-item {
  background-color:  #50b9a8!important; color: #151f35 !important;
}

/* 5: Yellow (#fdc400) */
.navbar .dropdown-menu li:nth-child(5) .dropdown-item {
  background-color: #fdc400 !important; color: #151f35 !important;
}

/* 6: Black (#020203) */
.navbar .dropdown-menu li:nth-child(6) .dropdown-item {
  background-color: #020203 !important; color: #ffffff !important;
}

/* 7: White (#ffffff) */
.navbar .dropdown-menu li:nth-child(7) .dropdown-item {
  background-color: #ffffff !important; color: #151f35 !important;
}

/* 8: Teal (#50b9a8) */
.navbar .dropdown-menu li:nth-child(8) .dropdown-item {
  background-color: #e6881e!important; color: #151f35 !important;
}

/* 9: Navy (#151f35) */
.navbar .dropdown-menu li:nth-child(9) .dropdown-item {
  background-color: #151f35 !important; color: #ffffff !important;
}

/* 3. Global Item Styles */
.navbar .dropdown-item {
  padding: 12px 20px !important;
  margin: 0 !important;
  font-weight: 600 !important;
  display: block;
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Subtle separation */
}

/* 4. Interaction */
.navbar .dropdown-item:hover {
  filter: brightness(0.85); /* Dims the color slightly on hover */
  text-decoration: none !important;
}


/* ============================================================
   SMOOTH ROLL-OUT ANIMATION FOR DROPDOWN MENUS
   ============================================================ */

@media (min-width: 992px) {
  /* 1. Set the initial "hidden" state */
  .navbar .dropdown-menu {
    display: block !important; /* Keep it in the DOM */
    visibility: hidden;         /* But hide it from view */
    opacity: 0;                /* Start transparent */
    transform: translateY(-15px); /* Start slightly higher up */
    transition: 
      opacity 0.3s ease, 
      transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
      visibility 0.3s;
    pointer-events: none;       /* Prevent clicking while hidden */
  }

  /* 2. Set the "active/open" state */
  .navbar .nav-item.dropdown:hover > .dropdown-menu,
  .navbar .nav-item.dropdown .dropdown-menu.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);   /* Slide down to original position */
    pointer-events: auto;       /* Re-enable clicking */
  }
}


/* ============================================================
   CARPET ROLL-OUT ANIMATION FOR DROPDOWN MENUS
   ============================================================ */

@media (min-width: 992px) {
  /* 1. The "Rolled Up" State */
  .navbar .dropdown-menu {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    
    /* The Secret Sauce: Anchor the transformation to the top */
    transform-origin: top;
    /* Flatten the menu vertically to 0 */
    transform: scaleY(0); 
    
    /* Smooth transition for the "unrolling" feel */
    transition: 
      transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
      opacity 0.3s ease,
      visibility 0.4s;
    
    pointer-events: none;
  }

  /* 2. The "Unrolled" State */
  .navbar .nav-item.dropdown:hover > .dropdown-menu,
  .navbar .nav-item.dropdown .dropdown-menu.show {
    visibility: visible;
    opacity: 1;
    /* Stretch back to 100% vertical size */
    transform: scaleY(1);
    pointer-events: auto;
  }
}

/* --- 1. Animation for the MAIN LOGO (Scale based) --- */
@keyframes logo-pulse-main {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(80, 185, 168, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
}

/* --- 2. Animation for ORBIT BUTTONS (Glow based - No Transform) --- */
@keyframes orbit-pulse-glow {
  0% {
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 20px rgba(80, 185, 168, 0.8);
    filter: brightness(1.3);
  }
  100% {
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    filter: brightness(1);
  }
}

/* --- 3. Applying the animations to the Hover states --- */

/* Main Logo Hover */
#help-widget:not(.open) #help-main:hover img {
  animation: logo-pulse-main 1.2s infinite ease-in-out;
}

/* Secondary Orbit Buttons Hover */
#help-widget.open .help-action:hover {
  animation: orbit-pulse-glow 1s infinite ease-in-out;
  z-index: 100;
  cursor: pointer;
}


/* =========================================
   REPLACE SEARCH WITH CHAT FORM + NAVBAR ALIGNMENT FIX
   ========================================= */

/* 1. Hide the REAL Quarto search button & container */
.quarto-search-toggle, 
#quarto-search,
.quarto-navbar-tools .bi-search,
.quarto-navbar-tools .quarto-search-toggle {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
}

/* 2. Fix Alignment of Navbar Tools (Chat & Dark Mode Toggle) */
.quarto-navbar-tools {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important; /* Centers vertical alignment */
  gap: 15px !important;           /* Adds perfect space between icons */
}

/* Ensure the Dark Mode Toggle behaves nicely in the flex container */
.quarto-color-scheme-toggle {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
}

/* 3. Style our NEW custom chat icon (Injected via JS) */
#custom-chat-trigger {
  cursor: pointer;
  font-size: 1.4rem;
  padding: 0 10px;
  margin: 0 !important; /* Reset margin, let flex-gap handle spacing */
  line-height: 1 !important; /* Ensures vertical centering */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease;
  color: #50b9a8; /* Brand Teal */
  z-index: 1002;   /* Ensure it sits above navbar background */
}

#custom-chat-trigger:hover {
  transform: scale(1.1);
}

/* 4. The "Need Help?" Label */
#custom-chat-trigger::after {
  content: 'Need Help?';
  position: absolute;
  top: 45px;
  right: 0;
  background-color: #50b9a8;
  color: #151f35;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#custom-chat-trigger:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* 5. The Dropdown Chat Box */
#chat-box {
  display: none; /* Toggled by JS */
  position: fixed !important;
  top: 70px !important;
  right: 20px !important;
  width: 320px !important;
  background: white !important;
  border: 2px solid #50b9a8 !important;
  border-radius: 12px !important;
  padding: 20px !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
  z-index: 999999 !important;
}

/* Dark Mode support */
html[data-bs-theme="dark"] #chat-box { 
  background: #151f35 !important; 
  color: white !important; 
}



/* ============================================================
   BRANDED ACCENTS & ACCESSIBLE MULTI-COLORED CARDS
   ============================================================ */

/* 1. Teal Accent Block */
.accent {
  background-color: #50b9a8 !important;
  color: #151f35 !important; /* Navy text for best contrast on teal */
  padding: 1.5rem !important;
  border-radius: 12px !important;
  margin: 1.5rem 0 !important;
  font-weight: 600;
}

/* 2. Base Card Styling */
.card {
  border: none !important;
  border-radius: 12px !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  height: 100%;
}

.card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
  filter: brightness(1.05);
}

.card-title {
  font-weight: 800 !important;
  margin-bottom: 10px !important;
  text-transform: uppercase;
}

/* 3. Specific Color & Text Contrast Rules */

/* --- WHITE TEXT CARDS (Dark Backgrounds) --- */

/* Purple Card */
.grid .card:nth-child(1), .grid .card.purple-card { 
  background-color: #4c4394 !important; 
}
.grid .card:nth-child(1) .card-title, .grid .card:nth-child(1) p { color: #ffffff !important; }

/* Red Card */
.grid .card:nth-child(2), .grid .card.red-card { 
  background-color: #e64550 !important; 
}
.grid .card:nth-child(2) .card-title, .grid .card:nth-child(2) p { color: #ffffff !important; }

/* Pink Card */
.grid .card:nth-child(3), .grid .card.pink-card { 
  background-color: #eb5e95 !important; 
}
.grid .card:nth-child(3) .card-title, .grid .card:nth-child(3) p { color: #ffffff !important; }

/* --- BLACK TEXT CARDS (Bright Backgrounds) --- */

/* Orange Card */
.grid .card:nth-child(4), .grid .card.orange-card { 
  background-color: #e6881e !important; 
}
.grid .card:nth-child(4) .card-title, .grid .card:nth-child(4) p { color: #000000 !important; }

/* Yellow Card (If you add more) */
.grid .card.yellow-card { 
  background-color: #fdc400 !important; 
}
.grid .card.yellow-card .card-title, .grid .card.yellow-card p { color: #000000 !important; }

/* Teal Card (If you add more) */
.grid .card.teal-card { 
  background-color: #50b9a8 !important; 
}
.grid .card.teal-card .card-title, .grid .card.teal-card p { color: #000000 !important; }


/* ==========================
   Wrexham Psychology Technicians – Custom Styles
   Supports Light/Dark Mode
========================== */

/* -------- Light Mode (default rules) -------- */
body.quarto-light {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #ffffff;
  color: #151f35; /* Navy text */
  line-height: 1.6;
}

/* Navbar (light mode) */
body.quarto-light .navbar {
  background-color: #151f35 !important;
}
body.quarto-light .navbar a,
body.quarto-light .navbar-brand {
  color: #ffffff !important;
  font-weight: 500;
}
body.quarto-light .navbar a:hover {
  color: #50b9a8 !important;
  text-decoration: underline;
}

/* Dropdown menu visibility fix (light mode) */
body.quarto-light .navbar .dropdown-menu {
  background-color: #151f35 !important;
  border: none;
}
body.quarto-light .navbar .dropdown-item {
  color: #ffffff !important;
  font-weight: 500;
}
body.quarto-light .navbar .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #50b9a8 !important;
}

/* Headings */
body.quarto-light h1, body.quarto-light h2, body.quarto-light h3, body.quarto-light h4,
body.quarto-light h5, body.quarto-light h6 {
  font-family: "Segoe UI", Verdana, sans-serif;
  color: #151f35;
  font-weight: 600;
}

/* Links */
body.quarto-light a {
  color: #50b9a8;
  text-decoration: none;
}
body.quarto-light a:hover {
  color: #3b8d7f;
  text-decoration: underline;
}

/* Footer */
body.quarto-light footer {
  background-color: #151f35;
  color: #ffffff;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

/* Buttons */
body.quarto-light .btn-primary {
  background-color: #50b9a8;
  border-color: #50b9a8;
  color: #151f35;
  font-weight: 600;
}
body.quarto-light .btn-primary:hover {
  background-color: #3b8d7f;
  border-color: #3b8d7f;
  color: #ffffff;
}

/* Cards */
body.quarto-light .card {
  border-radius: 12px;
  border: 1px solid #e6e6e6;
  box-shadow: 0px 3px 6px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}
body.quarto-light .card-title {
  color: #151f35;
  font-weight: 600;
}

/* Accent areas */
body.quarto-light .accent {
  background-color: #50b9a8;
  color: #151f35;
  padding: 1rem;
  border-radius: 8px;
}

/* Accent block consistent dimensions */
body.quarto-light .accent,
body.quarto-dark .accent {
  padding: 1rem;        /* inner spacing */
  margin: 1rem 0;       /* spacing above/below block */
  border-radius: 8px;   /* rounded corners */
  line-height: 1.6;     /* consistent line height */
}

/* -------------------------
   Breadcrumbs
------------------------- */
.breadcrumb-container {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
body.quarto-light .breadcrumb-container {
  background-color: #f0f8ff;
  color: #151f35;
}
body.quarto-light .breadcrumb-container a {
  color: #151f35;
  text-decoration: none;
}
body.quarto-light .breadcrumb-container a:hover {
  text-decoration: underline;
  color: #50b9a8;
}
.breadcrumb-container .breadcrumb li {
  display: inline;
  margin-right: 0.5rem;
}
.breadcrumb-container .breadcrumb li::after {
  content: "›";
  margin-left: 0.5rem;
  color: #888;
}
.breadcrumb-container .breadcrumb li:last-child::after {
  content: "";
}

/* -------------------------
   Chat Widget
------------------------- */
.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
}

.chat-widget-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: none;
  position: relative;
  transition: transform 0.2s;
}

.chat-widget-button:hover {
  transform: scale(1.05);
}

.chat-widget-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Speech bubble on hover */
.chat-speech {
  position: absolute;
  bottom: 70px;
  right: 0;
  background-color: #50b9a8;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s ease;
  font-weight: 600;
}

.chat-widget-button:hover .chat-speech {
  opacity: 1;
  transform: translateY(0);
}

/* -------- Dark Mode Overrides -------- */
body.quarto-dark {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #121212; /* Dark base */
  color: #e0e0e0; /* Light text */
  line-height: 1.6;
}

/* Navbar dark mode */
body.quarto-dark .navbar {
  background-color: #0d1324 !important; /* Deeper navy */
}
body.quarto-dark .navbar a,
body.quarto-dark .navbar-brand {
  color: #ffffff !important;
}
body.quarto-dark .navbar a:hover {
  color: #50b9a8 !important;
}

/* Cards dark mode */
body.quarto-dark .card {
  background-color: #1e1e1e;
  border: 1px solid #2c2c2c;
  box-shadow: 0px 3px 6px rgba(0,0,0,0.5);
}
body.quarto-dark .card-title {
  color: #ffffff;
}

/* Accent areas dark mode */
body.quarto-dark .accent {
  background-color: #50b9a8;
  color: #121212;
}

/* Links dark mode */
body.quarto-dark a {
  color: #50b9a8;
}
body.quarto-dark a:hover {
  color: #3b8d7f;
}

/* Headings dark mode */
body.quarto-dark h1, body.quarto-dark h2, body.quarto-dark h3, body.quarto-dark h4,
body.quarto-dark h5, body.quarto-dark h6 {
  color: #ffffff;
}

/* -------------------------
   Light/Dark Mode Toggle
------------------------- */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
}

.theme-toggle:hover {
  transform: scale(1.2);
  transition: transform 0.2s;
}

/* -------------------------
   Scroll to Top Widget 
------------------------- */
#scroll-top-widget {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #151f35;
  color: white;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background-color 0.2s ease;
}

#scroll-top-widget span {
  display: block;
  font-size: 1.8rem; 
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 1px currentColor, 0 2px 4px rgba(0,0,0,0.35);
  transform: translateY(-10px);
}

#scroll-top-widget:hover {
  background-color: #50b9a8;
  transform: scale(1.1);
}

#scroll-top-widget.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* -------------------------
   Remove Anchor
------------------------- */
a.anchorjs-link {
    display: none !important;
}

/* -------------------------
   Smooth Scrolling
------------------------- */
html {
    scroll-behavior: smooth;
}

/* -------------------------
   Sidebar TOC sticky 
---------------------------*/
#quarto-sidebar {
    position: sticky;
    top: 1rem; /* adjust offset */
}

/* -------------------------
   Transition Effects for links and buttons
---------------------------*/
a {
    transition: color 0.2s;
}

/* ==========================
   Floating Help Widget
   Right-only 90° radial menu
========================== */
#help-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  overflow: visible !important; 
}

#help-main {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  position: relative;
  z-index: 10;
}

#help-main img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
}

#help-main:active img {
  transform: scale(0.92);
}

.help-action {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #151f35;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; 
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.help-action img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  border-radius: 50%;
  display: block; 
}

#help-widget.open .help-action {
  opacity: 1;
  pointer-events: auto;
}

/* Radial Fan Positions */
#help-widget.open .action-myuni { transform: translate(-50%, -50%) translate(41px, -92px) scale(1); transition-delay: 0.05s; }
#help-widget.open .action-digital-learning-skills { transform: translate(-50%, -50%) translate(-17px, -100px) scale(1); transition-delay: 0.1s; }
#help-widget.open .action-email { transform: translate(-50%, -50%) translate(-71px, -71px) scale(1); transition-delay: 0.15s; }
#help-widget.open .action-wris { transform: translate(-50%, -50%) translate(-100px, -15px) scale(1); transition-delay: 0.2s; }
#help-widget.open .action-gorilla { transform: translate(-50%, -50%) translate(-92px, 42px) scale(1); transition-delay: 0.25s; }
#help-widget.open .action-osf { transform: translate(-50%, -50%) translate(-63px, -124px) scale(1); transition-delay: 0.3s; }
#help-widget.open .action-itdesk { transform: translate(-50%, -50%) translate(-130px, -60px) scale(1); transition-delay: 0.35s; }
#help-widget.open .action-jisc { transform: translate(-50%, -50%) translate(-140px, 20px) scale(1); transition-delay: 0.4s; }
#help-widget.open .action-github { transform: translate(-50%, -50%) translate(20px, -140px) scale(1); transition-delay: 0.45s; }

/* ============================================================
   BRANDED MULTI-COLORED DROPDOWN SEQUENCE
============================================================ */
.navbar .dropdown-menu {
  background-color: #151f35 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  min-width: 220px;
}
.navbar .dropdown-item {
  padding: 12px 20px !important;
  margin: 0 !important;
  font-weight: 600 !important;
  display: block;
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.navbar .dropdown-item:hover { filter: brightness(0.85); text-decoration: none !important; }

/* Dropdown Colors */
.navbar .dropdown-menu li:nth-child(1) .dropdown-item { background-color: #4c4394 !important; color: #ffffff !important; }
.navbar .dropdown-menu li:nth-child(2) .dropdown-item { background-color: #e64550 !important; color: #ffffff !important; }
.navbar .dropdown-menu li:nth-child(3) .dropdown-item { background-color: #eb5e95 !important; color: #ffffff !important; }
.navbar .dropdown-menu li:nth-child(4) .dropdown-item { background-color: #50b9a8 !important; color: #151f35 !important; }
.navbar .dropdown-menu li:nth-child(5) .dropdown-item { background-color: #fdc400 !important; color: #151f35 !important; }
.navbar .dropdown-menu li:nth-child(6) .dropdown-item { background-color: #020203 !important; color: #ffffff !important; }
.navbar .dropdown-menu li:nth-child(7) .dropdown-item { background-color: #ffffff !important; color: #151f35 !important; }
.navbar .dropdown-menu li:nth-child(8) .dropdown-item { background-color: #e6881e !important; color: #151f35 !important; }
.navbar .dropdown-menu li:nth-child(9) .dropdown-item { background-color: #151f35 !important; color: #ffffff !important; }

/* ============================================================
   DROPDOWN ANIMATIONS
============================================================ */
@media (min-width: 992px) {
  .navbar .dropdown-menu {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transform-origin: top;
    transform: scaleY(0); 
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease, visibility 0.4s;
    pointer-events: none;
  }
  .navbar .nav-item.dropdown:hover > .dropdown-menu,
  .navbar .nav-item.dropdown .dropdown-menu.show {
    visibility: visible;
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
  }
}

/* ============================================================
   BRANDED ACCENTS & GRID CARDS BASE
============================================================ */
.accent {
  background-color: #50b9a8 !important;
  color: #151f35 !important;
  padding: 1.5rem !important;
  border-radius: 12px !important;
  margin: 1.5rem 0 !important;
  font-weight: 600;
}
.card {
  border: none !important;
  border-radius: 12px !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  height: 100%;
}
.card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
  filter: brightness(1.05);
}
.card-title {
  font-weight: 800 !important;
  margin-bottom: 10px !important;
  text-transform: uppercase;
}

/* Specific Card Colors */
.grid .card:nth-child(1) { background-color: #4c4394 !important; } /* Purple */
.grid .card:nth-child(2) { background-color: #e64550 !important; } /* Red */
.grid .card:nth-child(3) { background-color: #eb5e95 !important; } /* Pink */
.grid .card:nth-child(4) { background-color: #e6881e !important; } /* Orange */
.grid .card:nth-child(5) { background-color: #fdc400 !important; } /* Yellow */

/* ============================================================
   UPDATED FOOTER & CARD CONTRAST (Theme Aware)
============================================================ */

/* 1. Full-Width Footer Light/Dark Mode Fix */
.full-width-footer {
  width: 100%;
  padding: 4rem 2rem;
  text-align: center;
  margin-top: 3rem;
  transition: background-color 0.3s ease;
}

body.quarto-light .full-width-footer {
  background-color: #151f35; /* Navy */
  color: #ffffff;
}

body.quarto-dark .full-width-footer {
  background-color: #0a0e1a; /* Deeper Navy */
  color: #e0e0e0;
  border-top: 1px solid #50b9a8;
}

.full-width-footer h2 {
  color: #50b9a8 !important; 
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.full-width-footer a {
  color: #ffffff !important;
  text-decoration: none;
  margin: 0 10px;
}

body.quarto-dark .full-width-footer a {
  color: #50b9a8 !important; 
}

.full-width-footer a:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* 2. Specific Contrast Rules for Grid Cards */
/* WHITE TEXT CARDS (Purple, Red, Pink) */
.grid .card:nth-child(1) .card-title, .grid .card:nth-child(1) p,
.grid .card:nth-child(2) .card-title, .grid .card:nth-child(2) p,
.grid .card:nth-child(3) .card-title, .grid .card:nth-child(3) p {
  color: #ffffff !important;
}

/* BLACK TEXT CARDS (Orange, Yellow, Teal) */
.grid .card:nth-child(4) .card-title, .grid .card:nth-child(4) p,
.grid .card:nth-child(5) .card-title, .grid .card:nth-child(5) p,
.grid .card.yellow-card .card-title, .grid .card.yellow-card p,
.grid .card.teal-card .card-title, .grid .card.teal-card p {
  color: #000000 !important;
}

/* 3. Dark Mode Specific Title Overrides */
body.quarto-dark .grid .card:nth-child(4) .card-title,
body.quarto-dark .grid .card:nth-child(5) .card-title {
  color: #000000 !important;
}




/* ============================================================
   TECHY PATTERN
============================================================ */
/* Styling for the Technical Nodes (Circles) */
.tech-node {
  fill: #151f35; /* Navy center */
  stroke: #50b9a8; /* Teal border */
  stroke-width: 1;
  filter: drop-shadow(0 0 3px #50b9a8);
  animation: node-pulse 3s ease-in-out infinite;
}

/* Make the nodes breathe slightly */
@keyframes node-pulse {
  0%, 100% { 
    r: 3; 
    filter: drop-shadow(0 0 3px #50b9a8); 
  }
  50% { 
    r: 4.5; 
    filter: drop-shadow(0 0 8px #50b9a8); 
  }
}

/* Ensure the background lines still function as intended */
.tech-line {
  fill: none;
  stroke-width: 2;
}

.tech-line.pulse {
  stroke: #50b9a8;
  stroke-dasharray: 150, 1000;
  stroke-dashoffset: 1150;
  animation: electricity 7s linear infinite;
  filter: drop-shadow(0 0 5px #50b9a8);
}


<style>
  /* 1. Base Container Styling (Consistent for both modes) */
  details {
    border: 2px solid #005A8C; /* Navy border remains constant */
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
  }

  /* 2. Light Mode: Text is Navy */
  summary {
    cursor: pointer;
    font-weight: 700;
    color: #005A8C; /* Navy text */
    font-size: 1.1em;
    list-style: none;
  }

  /* Arrow remains Navy in light mode */
  summary::after {
    content: ' ▼';
    float: right;
    color: #005A8C;
  }

  details[open] summary::after {
    content: ' ▲';
  }

  /* 3. Dark Mode: Text turns Teal */
  .quarto-dark summary,
  .quarto-dark summary::after {
    color: #008080 !important; /* Teal text in dark mode */
  }

  /* Optional: Keep the container background dark but don't change the border */
  .quarto-dark details {
    background-color: #1f1f1f; 
  }
</style>