/* Google fonts import */
@import url('https://fonts.googleapis.com/css2?family=Shantell+Sans:ital,wght@0,300..800;1,300..800&display=swap');

/* CSS Variables */
:root {
  /* Typography */
  --primary-font: "Shantell Sans", sans-serif;

  /* Base surfaces & layout */
  --body-background-color: #c2e4d2;
  --secondary-color: #ffffff;
  --secondary-color-transparent: #ffffff8c;

  /* Brand & primary colours */
  --primary-color: #2a5e4f;
  --primary-color-hover: #234c41;

  /* Overlays & media */
  --video-overlay-color: #ffffff63;

  /* Hint text */
  --hint-text-color: #000000;

  /* Feedback & status colours */
  --error-color: #ff0000;
  --success-bg: #d6f5e3;
  --success-border: #a2d9c9;

  /* Shadows & depth */
  --shadow-color: rgba(0,0,0,0.10);
  --divider-border: rgba(0, 0, 0, 0.08);

  /* Entry / slider accents */
  --hue-gradient-start: #a5dfc6;
  --hue-gradient-end: #2a5e4f;  

  /* Accordion UI */
  --accordion-bg: #d8e9df;
  --accordion-bg-open: #c9e4d6;

  /* Sticky UI surfaces */
  --sticky-surface-bg: rgba(194, 228, 210, 0.85);
  --sticky-surface-bg-soft: rgba(194, 228, 210, 0.65);

  /* Disabled / locked UI states */
  --disabled-border: rgba(42, 94, 79, 0.35);
  --disabled-bg: rgba(255, 255, 255, 0.55);
  --disabled-text: rgba(42, 94, 79, 0.6);

  /* Layout offsets */
  --navbar-height: 96px;
}

/* ----------------------------------------
  GLOBAL STYLES
---------------------------------------- */

/* Ensure the whole page fills the full viewport height */
html, body {
  height: 100%;
  margin: 0;
}

/* The body background + global styling */
body {
  background-color: var(--body-background-color);
  font-family: var(--primary-font);
}

/* page-container acts as the parent flexbox */
.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Full viewport height */
}

/* Fills all remaining space between navbar and footer */
.content {
  flex: 1; /* This pushes the footer down */
  display: flex;
  justify-content: center; /* Centers auth pages horizontally */
  align-items: center;     /* Centers auth pages vertically */
  flex-direction: column;  /* Allows normal stacking of content */
}

/* main grows to fill space between navbar and footer */
main {
  flex: 1 0 auto;
}

/* ----------------------------------------
  GLOBAL LINK STYLES
---------------------------------------- */

a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
}

a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Custom themed link */
.custom-link {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: underline;
}

.custom-link:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.custom-link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

.alert-banner {
  background: var(--success-bg);
  color: var(--primary-color);
  border: 1px solid var(--success-border);
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  font-family: var(--primary-font);
  font-size: 1.05rem;
  width: 90%;
  text-align: center;
  box-shadow: 0 3px 8px var(--shadow-color);
  margin: 0 auto;
}

/* ----------------------------------------
  PLAN BANNER (ACCOUNT TYPE)
---------------------------------------- */

.plan-wrap {
  width: 100%;
  padding: 0 1rem 0;

  /* Sticky plan banner below sticky navbar */
  position: sticky;
  top: var(--navbar-height);
  z-index: 1040; /* below navbar, above page content */

  /* Helps prevent "scrolling behind" look */
  background: var(--sticky-surface-bg-soft);
  backdrop-filter: blur(12px);

  /* seam fix for blur/alpha layers */
  margin-top: -1px;
}

/* Matches site content width and keeps it centred */
.plan-inner {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.plan-banner {
  width: 100%;
  background: var(--secondary-color-transparent);
  color: var(--primary-color);
  padding: 0.55rem 1.2rem;
  border-radius: 14px;
  font-family: var(--primary-font);
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 10px 24px var(--shadow-color);
}

/* ----------------------------------------
  CARD STYLES
---------------------------------------- */

/* Wrapper to center form pages */
.form-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center; /* works with main.css centering */
  padding: 2rem 1rem;
}

/* Frosted glass card layout */
.form-card {
  width: 95%;
  max-width: 420px;
  background: var(--secondary-color-transparent);
  backdrop-filter: blur(6px);
  padding: 2rem;
  border-radius: 14px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

/* Form title */
.form-title {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-style: italic;
  font-size: 1.8rem;
}

/* Labels */
.form-card label {
  display: block;
  margin-top: 1rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* Inputs */
.form-card input,
.form-card textarea {
  width: 100%;
  padding: 0.7rem;
  margin-top: 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--primary-color);
  font-family: var(--primary-font);
}

/* Focus outline */
.form-card input:focus,
.form-card textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 4px var(--shadow-color);
}

/* Wider layout for info pages (FAQ / Crisis & Support) */
.info-card {
  width: 100%;
  max-width: 520px; /* keeps current mobile size */
}

.form-error {
  color: var(--error-color);
  text-align: center;
  margin-bottom: 1rem;
  font-weight: 600;
}

.form-info {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 500;
}

.select-btn {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.8rem;
  border-radius: 8px;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  font-weight: bold;
  border: none;
  cursor: pointer;
  font-family: var(--primary-font);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.select-btn:hover {
  background-color: var(--primary-color-hover);
  text-decoration: none;
}

/* ----------------------------------------
  FREE PLAN LOCK (DISABLED UI)
---------------------------------------- */

.select-btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* In case anchors/buttons get the class too */
.select-btn.is-disabled:hover {
  background-color: var(--primary-color);
  text-decoration: none;
}

/* Used under the disabled button copy */
.small-text {
  font-size: 0.95rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* ----------------------------------------
  NAVBAR
---------------------------------------- */
.nav-logo {
  height: 80px;
  width: auto;
}

.nav-title {
  color: var(--primary-color);
  font-style: italic;
  font-weight: 700;
}

.navbar-brand:hover .nav-title {
  color: var(--primary-color);
}

/* Sticky navbar */
.regulate-navbar {
  backdrop-filter: blur(15px);
  position: sticky;
  top: 0;
  z-index: 1050; /* above plan banner */
  background: var(--sticky-surface-bg-soft); /* prevents content looking like it slides underneath */
}

.regulate-btn {
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.regulate-btn:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border-color: var(--primary-color);
}

.regulate-dropdown {
  background: var(--secondary-color);
  border: 1px solid var(--primary-color);
}

.regulate-dropdown .dropdown-item {
  color: var(--primary-color);
}

.regulate-dropdown .dropdown-item:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color)
}

/* ----------------------------------------
  HERO SECTION
---------------------------------------- */

/* Wraps the entire hero section and keeps it centred */
.hero-wrapper {
  width: 95%;
  display: flex;
  justify-content: center;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.video-container video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Soft white overlay with transparency */
.video-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--video-overlay-color);
  pointer-events: none;
}

/* Logo positioned over the video */
.logo-overlay {
  position: absolute;
  top: 70%;
  left: 78%;
  transform: translate(-50%, -50%);
  width: 45%;
  pointer-events: none;
}

.logo-overlay img {
  width: 100%;
  height: auto;
}

/* ----------------------------------------
  INTRO SECTION
---------------------------------------- */

.intro-section {
  width: 95%;
  max-width: 1000px;
  margin: 2rem auto 4rem auto;
  padding: 2rem;
  text-align: center;
  background: var(--secondary-color-transparent);
  border-radius: 12px;
}

.intro-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-style: italic;
}

.intro-text {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.intro-actions {
  margin-top: 1.5rem;
}

.intro-actions .btn {
  font-size: 0.8rem;
  padding: 0.6rem 1.8rem;
}

/* ----------------------------------------
  FOOTER
---------------------------------------- */

.reg-footer {
  padding: 1.5rem 1rem;
  background: var(--primary-color);
  backdrop-filter: blur(6px);
  text-align: center;
  color: var(--secondary-color);
}

.reg-footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.reg-footer-brand {
  font-size: 1.2rem;
  font-weight: bold;
}

.reg-footer-note,
.reg-footer-disclaimer {
  font-size: 0.9rem;
  margin: 0.3rem 0;
  opacity: 0.85;
}

.reg-footer-links {
  margin-top: 0.8rem;
}

.reg-footer-links a {
  color: var(--secondary-color);
  font-weight: 600;
  text-decoration: none;
}

.reg-footer-links a:hover {
  text-decoration: underline;
}

/* ----------------------------------------
  DASHBOARD – ACCORDION & FILTER
----------------------------------------- */

/* Wrapper for the accordion block */
.dashboard-accordion {
  width: 100%;
  margin-top: 1.5rem;
}

/* Each accordion group (date) */
.accordion-item {
  border: 1px solid var(--primary-color);
  border-radius: 10px !important;
  margin-bottom: 1rem;
  overflow: hidden;
  background: var(--secondary-color-transparent);
  backdrop-filter: blur(4px);
  box-shadow: 0 3px 8px var(--shadow-color);
}

/* Header button */
.accordion-button {
  background: var(--accordion-bg);
  font-family: var(--primary-font);
  font-size: 1.05rem;
  color: var(--primary-color);
  padding: 1rem 1.2rem;
  border: none;
}

.accordion-button:not(.collapsed) {
  background: var(--accordion-bg-open);
  color: var(--primary-color);
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: 0 0 0 2px var(--shadow-color);
}

/* Inside the accordion */
.accordion-body {
  background: var(--secondary-color);
  padding: 1.2rem 1.4rem;
  border-top: 1px solid var(--divider-border);
  font-family: var(--primary-font);
  color: var(--primary-color);
}

/* Individual entry container */
.entry-card {
  background: var(--secondary-color-transparent);
  backdrop-filter: blur(4px);
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.2rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px var(--shadow-color);
}

/* Inline action links */
.entry-actions a {
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 1rem;
  color: var(--primary-color);
  text-decoration: none;
}

.entry-actions a:hover {
  text-decoration: underline;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.entry-actions form {
  display: inline;
}

.entry-delete-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--error-color);
  cursor: pointer;
  text-decoration: none;
}

.entry-delete-link:hover {
  text-decoration: underline;
}

/* Disabled action pills (used when free plan is locked) */
.disabled-action {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--disabled-border);
  background: var(--disabled-bg);
  color: var(--disabled-text);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: not-allowed;
  user-select: none;
}

/* Wider card layout just for the dashboard */
.dashboard-card {
  max-width: 900px;
  width: 100%;
}

/* Centered filter form under the title – flex row so input + button align */
.dashboard-filter-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

/* New: wrapper blocks so each filter can flex cleanly without overflow */
.dashboard-filter-form .filter-field {
  flex: 1 1 auto;

  /* Prevents inputs from overflowing the card in narrow viewports */
  min-width: 0;
}

/* New: keeps the action button from shrinking */
.dashboard-filter-form .filter-actions {
  flex: 0 0 auto;
}

/* Tweak spacing for search input when used in filter row */
.dashboard-filter-form .search-input {
  margin-bottom: 0;
}

/* Tweak spacing for small button in filter row */
.dashboard-filter-form .select-btn-small {
  margin-top: 0;
}

/* Smaller button for the dashboard search form */
.select-btn-small {
  width: auto;
  max-width: 150px;
}

/* Container for entry action links */
.entry-actions {
  margin-top: 0.8rem;
}

/* Delete link styled as destructive but still inline with other actions */
.entry-actions .entry-delete {
  color: var(--error-color);
}

/* Empty state message styling on dashboard */
.empty-state {
  margin-top: 1rem;
}

/* ----------------------------------------
  SUPPORTIVE PHRASES CARD
---------------------------------------- */

.supportive-card {
  margin-top: 1rem;
}

/* Inner quote box inside the supportive card */
.supportive-quote-box {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--secondary-color);
  border: 4px solid var(--primary-color);
  padding: 0.9rem 1rem;
  border-radius: 10px;
  min-height: 3.5rem;
  font-style: italic;
}

.supportive-quote-box p {
  margin-bottom: 0.25rem;
}

/* Make the author line a bit softer */
.supportive-quote-box #supportive-quote-author {
  font-style: normal;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ----------------------------------------
  SEARCH BOX STYLES
----------------------------------------- */

/* Search box */
.search-input {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  font-family: var(--primary-font);
  font-size: 0.95rem;
  background: var(--secondary-color);
  color: var(--primary-color);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 4px var(--shadow-color);
}

/* ----------------------------------------
  REVISION HISTORY (ENTRY DETAIL PAGE)
----------------------------------------- */

.revision-section {
  margin-top: 2rem;
}

/* Slightly smaller than main page title */
.revision-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* Scrollable list of revision cards */
.revision-list {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 0.25rem; /* small breathing room from scrollbar */
}

/* Extra spacing between revision cards inside the list */
.revision-list .entry-card {
  margin-bottom: 1rem;
}

/* ----------------------------------------
  SUCCESS MESSAGE STYLES
---------------------------------------- */

.messages {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.alert-success {
  background: var(--success-bg);
  color: var(--primary-color);
  border: 1px solid var(--success-border);
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  font-family: var(--primary-font);
  font-size: 1.05rem;
  max-width: 800px;
  width: 90%;
  text-align: center;
  box-shadow: 0 3px 8px var(--shadow-color);
  animation: fadeSlideIn 0.4s ease-out;
}

/* Fade-slide-in animation */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade-out animation for success messages */
.fade-out {
    animation: fadeOut 1s ease forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ----------------------------------------
  INTRO SECTION – MOBILE SCROLL VERSION
---------------------------------------- */

@media (max-width: 767px) {
  .intro-section {
    max-height: 55vh;          /* Shorter so it *has* to overflow */
    overflow-y: scroll;        /* Always show a scrollable area   */
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  /* Make text a bit smaller + tighter */
  .intro-text {
    font-size: 0.8rem;
    line-height: 1;
  }

  /* Smaller buttons on mobile */
  .intro-actions .btn {
    font-size: 0.5em;
  }

  /* Smaller footer innards on mobile */
  .reg-footer {
    padding: 0.2rem 0.1rem;
  }

  .reg-footer-brand {
    font-size: 0.8rem;
  }

  .reg-footer-note,
  .reg-footer-disclaimer {
    font-size: 0.5rem;
    margin: 0.1rem 0;
  }

  .reg-footer-links {
    margin-top: 0.3rem;
  }

  .reg-footer-links a {
    font-weight: 200;
    font-size: 0.8rem;
  }
}

/* Stack entry search filters on mobile */
@media (max-width: 767.98px) {

  /* Stack filter controls to prevent keyword field overflow */
  .dashboard-filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  /* Make the search button easier to tap on mobile */
  .dashboard-filter-form .select-btn-small {
    width: 100%;
    max-width: none;
  }
}

/* Wider layout for info pages (FAQ / Crisis & Support) */
@media (min-width: 768px) {
  .info-card {
    max-width: 820px; /* tablet / small laptop */
  }
}

@media (min-width: 1200px) {
  .info-card {
    max-width: 980px; /* desktop */
  }
}

@media (max-width: 320px) {
  .nav-logo {
    height: 48px;
  }
}

@media (min-width: 425px) {
  .regulate-navbar-logo {
    text-align: center;
  }
}

/* Sign in / Sign up buttons to adapt to smaller screens */
@media (max-width: 424px) {
  .navbar {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  /* slightly smaller buttons */
  .regulate-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.55rem;
  }

  /* tiny gap between buttons */
  .navbar .d-flex {
    gap: 0.1rem;
  }
}