/* ============================================
   OurCare Dashboard - Main Stylesheet
   Consolidated CSS for all dashboard pages
   ============================================ */

/* ============================================
   CSS VARIABLES / DESIGN TOKENS
   ============================================ */
:root {
    /* Primary Colors */
    --primary-blue: #4D5DD9;
    --primary-blue-light: #5669F7;
    --primary-purple-dark: #6550FF;
    
    /* Accent Colors */
    --accent-green: #6DF2B9;
    --accent-cyan: #01DBFF;
    --accent-pink: #FF4F8B;
    --accent-yellow: #FFC107;
    --accent-purple: #673AB7;
    --accent-orange: #FD7045;
    --accent-blue: #286EE2;
    --accent-lime: #86E749;
    --accent-magenta: #B150C2;
    
    /* Background Colors */
    --bg-light-purple: #F2F1FD;
    --bg-white: #FFFFFF;
    
    /* Text Colors */
    --text-dark: #000000;
    --text-light: #FFFFFF;
    --text-muted: #7F7C9D;
    --text-gray: #666666;
    
    /* Border Colors */
    --border-gray: #B5B4C8;
    
    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Outfit', sans-serif;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Layout */
    --nav-height: 72px;
    --nav-height-mobile: 60px;
    --sidebar-width: 301px;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.4;
}

/* ============================================
   NAVIGATION - SHARED STYLES
   ============================================ */
.nav,
.nav-bar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-gray);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    width: 100%;
    max-width: 100vw;
}

.nav-brand,
.nav-logo {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 32px;
    line-height: 102%;
    letter-spacing: -0.04em;
    color: var(--primary-blue);
    text-decoration: none;
    flex: 0 0 auto;
}

.nav-center {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex: 1;
    margin: 0 30px;
}

.nav-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    flex: 0 0 auto;
}

.nav-link {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.nav-link svg {
    width: 8px;
    height: 6px;
}

.nav-btn-outline,
.nav-button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    border: 1px solid var(--primary-blue);
    border-radius: 39px;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    color: var(--primary-blue);
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn-outline:hover,
.nav-button:hover {
    background: var(--primary-blue);
    color: var(--text-light);
}

/* ============================================
   SEARCH COMPONENT
   ============================================ */
.search-wrapper {
    position: relative;
    width: 680px;
    height: auto;
}

.nav-search,
.search-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 16px;
    gap: 11px;
    background: var(--bg-light-purple);
    border-radius: 40px;
    border: none;
    width: 680px;
    height: 35px;
}

.nav-search input,
.search-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-secondary);
    font-weight: 300;
    font-size: 14px;
    line-height: 102%;
    color: var(--text-dark);
    flex: 1;
}

.nav-search input::placeholder,
.search-input::placeholder {
    color: var(--text-dark);
    opacity: 1;
}

.nav-search svg {
    width: 16px;
    height: 16px;
}

/* Search Results Dropdown */
.search-results,
.search-results-dropdown {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 12px;
    position: absolute;
    width: 680px;
    left: 0;
    top: 46px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    max-height: 400px;
    overflow-y: auto;
}

.search-results.active,
.search-results-dropdown.show {
    display: flex;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 12px;
    width: 100%;
}

.search-result-item {
    width: 100%;
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 14px;
    line-height: 100%;
    color: var(--text-dark);
    text-decoration: none;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 4px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    color: var(--primary-blue);
    background-color: #f5f7ff;
}

.search-result-question-number {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 12px;
    color: var(--primary-blue);
    margin-bottom: 4px;
}

.search-result-title {
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.4;
}

.search-result-standard {
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.search-no-results {
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 14px;
    line-height: 100%;
    color: var(--text-gray);
    padding: 8px 0;
}

.search-result-highlight {
    background-color: #fff3cd;
    font-weight: 500;
}

/* ============================================
   EXPLORE STANDARDS DROPDOWN
   ============================================ */
.explore-dropdown-wrapper {
    position: relative;
}

.explore-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-dark);
    text-decoration: none;
}

.explore-dropdown-toggle:hover {
    color: var(--primary-blue);
}

.explore-dropdown-toggle svg {
    transition: transform 0.2s ease;
}

.explore-dropdown-toggle.active svg {
    transform: rotate(180deg);
}

.explore-standards-menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 48px 102px;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--nav-height);
    background: var(--bg-white);
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    z-index: 999;
}

.explore-standards-menu.active {
    display: flex;
}

.standards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 28px 53px;
    width: 100%;
    max-width: 1236px;
}

.standard-menu-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
}

.standard-menu-number {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding-top: 4px;
    flex-shrink: 0;
}

.standard-menu-number span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-dark);
    border-radius: 50%;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 16px;
    line-height: 120%;
    text-align: center;
    color: var(--text-dark);
}

.standard-menu-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 4px;
    gap: 12px;
    flex: 1;
}

.standard-menu-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.standard-menu-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 18px;
    line-height: 120%;
    color: var(--text-dark);
    margin: 0;
}

.standard-menu-desc {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 16px;
    line-height: 140%;
    color: var(--text-dark);
    margin: 0;
}

.standard-menu-link {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 102%;
    color: var(--primary-blue);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.standard-menu-link:hover {
    gap: 8px;
}

.standard-menu-link svg {
    width: 13px;
    height: 13px;
}

.explore-dropdown-overlay {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 998;
}

.explore-dropdown-overlay.active {
    display: block;
}

/* ============================================
   EXPLORE MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.explore-modal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 48px;
    gap: 32px;
    position: relative;
    width: 866px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--bg-white);
    box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
}

.explore-modal-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 28px;
    line-height: 120%;
    color: var(--text-dark);
    margin: 0;
}

.explore-modal-close {
    position: absolute;
    width: 32px;
    height: 32px;
    right: 16px;
    top: 16px;
    background: var(--bg-white);
    border-radius: 36px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.explore-modal-close:hover {
    transform: scale(1.1);
}

.explore-modal-close svg {
    width: 18px;
    height: 18px;
}

.explore-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    width: 100%;
}

.explore-modal-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
}

.explore-modal-number {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding-top: 4px;
    flex-shrink: 0;
}

.explore-modal-number span {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-dark);
    border-radius: 50%;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 16px;
    line-height: 120%;
    text-align: center;
    color: var(--text-dark);
}

.explore-modal-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 4px;
    gap: 12px;
    flex: 1;
}

.explore-modal-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.explore-modal-item-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 18px;
    line-height: 120%;
    color: var(--text-dark);
    margin: 0;
}

.explore-modal-item-desc {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 16px;
    line-height: 140%;
    color: var(--text-dark);
    margin: 0;
}

.explore-modal-link {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 102%;
    color: var(--primary-blue);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.explore-modal-link:hover {
    gap: 8px;
}

.explore-modal-link svg {
    width: 13px;
    height: 13px;
}

/* ============================================
   SIDE NAVIGATION (Question/Standard Pages)
   ============================================ */
.side-nav {
    position: fixed;
    width: var(--sidebar-width);
    height: 100vh;
    left: 0;
    top: 0;
    background: var(--bg-light-purple);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
    padding-top: calc(var(--nav-height) + 32px);
    isolation: isolate;
    overflow-y: auto;
    z-index: 150;
    box-sizing: border-box;
}

.side-nav-select {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    gap: 16px;
    width: 253px;
    height: 44px;
    background: var(--primary-blue);
    border-radius: 39px;
    margin-bottom: 32px;
}

.side-nav-select-text {
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 14px;
    line-height: 102%;
    color: var(--text-light);
    flex: 1;
}

.side-nav-item,
.nav-item {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 14px;
    line-height: 102%;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.side-nav-item:hover,
.nav-item:hover {
    color: var(--primary-blue);
}

.side-nav-item.active,
.nav-item.active {
    font-weight: 600;
    color: var(--primary-blue);
}

.nav-sub-items {
    margin-left: 16px;
    margin-top: 8px;
    padding-left: 16px;
    border-left: 2px solid var(--border-gray);
}

.nav-sub-item {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 13px;
    line-height: 110%;
    color: var(--text-gray);
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.2s ease;
}

.nav-sub-item:hover,
.nav-sub-item.active {
    color: var(--primary-blue);
}

.nav-sub-item.active {
    font-weight: 600;
}

.menu-header-heading {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 120%;
    color: var(--primary-blue);
    margin-top: 16px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.demographic-group {
    margin-bottom: 32px;
}

.demographic-heading {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 16px;
    line-height: 120%;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-gray);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--nav-height);
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--nav-height));
    padding: 24px 12px;
    padding-bottom: 60px;
    background: var(--bg-white);
    box-sizing: border-box;
    overflow-x: hidden;
}

.content-section {
    width: 100%;
    margin: 0;
    padding: 0 48px 0 32px;
}

/* ============================================
   QUESTION/STANDARD PAGE HEADERS
   ============================================ */
.question-header {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 16px;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    margin-top: var(--nav-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-gray);
    overflow-x: hidden;
}

.question-breadcrumb {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 16px;
    line-height: 140%;
    color: var(--primary-blue);
    flex-wrap: wrap;
    max-width: 100%;
}

.question-breadcrumb-item {
    color: var(--text-dark);
}

.question-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 36px;
    line-height: 102%;
    color: var(--text-dark);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Header Section (Standard Pages) */
.header-section {
    margin-top: 51px;
    margin-bottom: 24px;
}

.header-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 6px 12px;
    gap: 7px;
    width: 140px;
    height: 26px;
    background: var(--accent-green);
    border-radius: 34px;
    margin-bottom: 20px;
}

.header-badge-text {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    line-height: 102%;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dark);
}

.header-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 36px;
    line-height: 115%;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.header-subtitle-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.header-standard-number {
    display: none;
}

.header-subtitle {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 16px;
    line-height: 102%;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    margin-left: 40px;
}

.section-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 28px;
    line-height: 120%;
    color: var(--text-dark);
    margin-top: 44px;
    margin-bottom: 40px;
}

.section-subtitle {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 16px;
    line-height: 102%;
    color: var(--text-dark);
}

/* ============================================
   KEY FINDING SECTION
   ============================================ */
.key-finding-section {
    margin-top: 24px;
    margin-bottom: 24px;
}

.key-finding-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    gap: 40px;
    width: 100%;
    min-height: 62px;
    margin-top: 16px;
}

.key-finding-text {
    flex: 1;
    min-height: 62px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 24px;
    line-height: 120%;
    color: var(--text-dark);
}

.key-finding-button {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    gap: 4px;
    width: 124px;
    height: 36px;
    border: 1px solid var(--primary-blue);
    border-radius: 39px;
    background: transparent;
    color: var(--primary-blue);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
}

/* ============================================
   QUESTION SECTION STYLES
   ============================================ */
.question-section {
    margin-bottom: 60px;
}

.question-section .question-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 20px;
    line-height: 120%;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.question-subtitle {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 14px;
    line-height: 140%;
    color: var(--text-gray);
    margin-bottom: 16px;
}

/* ============================================
   CHART COMPONENTS
   ============================================ */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-bottom: 40px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
}

.chart-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 400px;
    margin: 24px 0;
    margin-left: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.chart-wrapper-container {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
}

.chart-wrapper-container .legend {
    align-self: flex-start;
    margin-top: 0;
}

.demographic-section .chart-wrapper-container .legend {
    margin-top: 40px;
}

/* Percentile Grid */
.percentile-grid {
    position: relative;
    width: 100%;
    max-width: 1014px;
    height: 270px;
    margin-bottom: 24px;
}

.percentile-grid-lines {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    gap: 52px;
    position: absolute;
    left: 22px;
    right: 23px;
    top: 0;
    bottom: 24px;
}

.percentile-line {
    margin: 0 auto;
    width: 246px;
    height: 0;
    opacity: 0.5;
    border: 1px solid var(--border-gray);
    transform: rotate(90deg);
    flex: none;
}

.percentile-labels {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.percentile-label {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 14px;
    line-height: 102%;
    text-align: center;
    color: var(--text-dark);
}

/* Answer Bars */
.answer-bars {
    margin-top: 28px;
}

.answer-bar-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.answer-label {
    width: 59px;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 102%;
    text-align: right;
    color: var(--text-dark);
    margin-right: 18px;
}

.answer-bar {
    height: 58px;
    display: flex;
    align-items: center;
}

.answer-bar.yes {
    background: var(--accent-green);
}

.answer-bar.no {
    background: var(--primary-blue);
}

.answer-bar.dont-know {
    background: var(--accent-green);
}

/* ============================================
   DEMOGRAPHIC CHARTS
   ============================================ */
.demographic-section {
    margin-bottom: 60px;
}

.demographic-title,
.demographic-chart-title {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 18px;
    line-height: 120%;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    padding: 0;
}

.demographic-chart {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
}

.demographic-label {
    position: absolute;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 102%;
    text-align: right;
    color: var(--text-dark);
}

.demographic-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    height: 47px;
}

.demographic-bar-label {
    width: 200px;
    text-align: right;
    padding-right: 16px;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 12px;
    line-height: 120%;
    color: var(--text-dark);
}

.demographic-bar-container {
    flex: 1;
    height: 47px;
    display: flex;
    align-items: center;
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.demographic-bar-segment {
    height: 47px;
    display: inline-block;
    transition: all 0.3s ease;
}

.demographic-bar-segment:hover {
    opacity: 0.8;
}

/* Shared demographic legend - hidden on desktop, shown on mobile */
.shared-demographic-legend {
    display: none;
}

/* ============================================
   LEGEND
   ============================================ */
.legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 200px;
    flex-shrink: 0;
    margin-top: 0;
}

.legend-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
}

.legend-color {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.legend-label {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 102%;
    color: var(--text-dark);
}

/* Bar Chart Colors */
.bar-color-1 { background: var(--primary-purple-dark); }
.bar-color-2 { background: var(--accent-green); }
.bar-color-3 { background: var(--accent-pink); }
.bar-color-4 { background: var(--accent-yellow); }
.bar-color-5 { background: var(--accent-purple); }
.bar-color-6 { background: var(--accent-orange); }
.bar-color-7 { background: var(--accent-blue); }
.bar-color-8 { background: var(--accent-lime); }
.bar-color-9 { background: var(--accent-magenta); }
.bar-color-10 { background: var(--accent-cyan); }

/* ============================================
   TOOLTIP
   ============================================ */
.tooltip {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 19px 0;
    gap: 10px;
    position: absolute;
    background: var(--bg-white);
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    z-index: 1000;
}

.tooltip-content {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 102%;
    text-align: right;
    color: var(--text-dark);
}

.tooltip-arrow {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--bg-white);
    transform: rotate(-90deg);
}

/* ============================================
   DIVIDER
   ============================================ */
.divider-line {
    width: 100%;
    height: 0;
    border: 1px solid var(--border-gray);
    margin: 40px 0;
}

/* ============================================
   LOADING & ERROR STATES
   ============================================ */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
    font-family: var(--font-primary);
    color: var(--primary-blue);
}

.error-message {
    padding: 24px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-family: var(--font-primary);
    margin: 24px 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    gap: 4px;
    background: var(--text-dark);
    border-radius: 39px;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: #333333;
    transform: translateY(-1px);
}

.btn-primary svg {
    width: 13px;
    height: 13px;
}

.view-more-button {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    gap: 4px;
    border: 1px solid var(--primary-blue);
    border-radius: 39px;
    background: transparent;
    color: var(--primary-blue);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-more-button:hover {
    background: var(--primary-blue);
    color: var(--text-light);
}

/* Arrow Icon */
.arrow-icon {
    display: inline-block;
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* ============================================
   FOOTER
   ============================================ */
.footer,
.data-footer {
    background: var(--text-dark);
    padding: 39px 48px 39px 32px;
    box-sizing: border-box;
}

.data-footer {
    position: relative;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 323px;
    margin-top: 0;
}

.footer-container,
.footer-content {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 37px;
}

.footer-links {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0;
    gap: 108px;
    width: 100%;
}

.footer-links-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-link {
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 14px;
    line-height: 102%;
    color: var(--primary-blue-light);
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    margin-bottom: 16px;
}

.footer-link:hover {
    color: #8090ff;
}

.footer-logos {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.footer-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-divider {
    width: 100%;
    height: 1px;
    background: var(--text-light);
    opacity: 0.3;
    border: none;
}

.footer-copyright {
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 14px;
    line-height: 140%;
    letter-spacing: 0.06em;
    color: var(--text-light);
}

/* Footer Links - Desktop/Mobile visibility */
.footer-links-mobile {
    display: none;
}

.footer-links-desktop {
    display: flex;
}

/* ============================================
   RESPONSIVE: TABLET (max-width: 1200px)
   ============================================ */
@media (max-width: 1200px) {
    .search-wrapper {
        width: 400px;
    }
    
    .nav-search,
    .search-box {
        width: 100%;
    }
    
    .search-results,
    .search-results-dropdown {
        width: 400px;
    }
    
    .nav-center {
        margin: 0 20px;
    }
    
    .explore-standards-menu {
        padding: 40px 60px;
    }
    
    .standards-grid {
        gap: 24px 40px;
    }
}

/* ============================================
   RESPONSIVE: SMALL TABLET (max-width: 992px)
   ============================================ */
@media (max-width: 992px) {
    .standards-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, auto);
    }
    
    .explore-standards-menu {
        padding: 32px 40px;
    }
}

/* ============================================
   RESPONSIVE: MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }
    
    /* Navigation */
    .nav,
    .nav-bar {
        padding: 12px 24px;
        height: var(--nav-height-mobile);
    }
    
    .nav-brand,
    .nav-logo {
        font-size: 28px;
    }
    
    .nav-center {
        display: none;
    }
    
    .nav-right {
        display: none;
    }
    
    /* Hide side nav on mobile */
    .side-nav {
        display: none;
    }
    
    /* Main Content */
    .main-content,
    .question-header {
        width: 100%;
        max-width: 100vw;
        margin-left: 0;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .main-content {
        margin-top: var(--nav-height-mobile);
    }
    
    .content-section {
        padding: 0 10px;
    }
    
    /* Standards Grid */
    .standards-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .explore-standards-menu {
        top: var(--nav-height-mobile);
        padding: 24px;
        max-height: calc(100vh - var(--nav-height-mobile));
        overflow-y: auto;
    }
    
    .explore-dropdown-overlay {
        top: var(--nav-height-mobile);
    }
    
    /* Footer */
    .footer,
    .data-footer {
        margin-left: 0;
        width: 100%;
        padding: 37px 26px;
        min-height: 725px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 37px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 48px;
    }
    
    .footer-logos {
        flex-direction: column;
        align-items: flex-start;
        gap: 37px;
    }
    
    .footer-logo {
        height: auto;
        max-width: 244px;
    }
    
    /* Header Section */
    .header-section {
        margin-top: 24px;
        margin-bottom: 20px;
    }
    
    .header-title {
        font-size: 24px;
        line-height: 120%;
        margin-bottom: 16px;
    }
    
    .header-standard-number {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 22px;
        height: 22px;
        border: 2px solid var(--text-muted);
        border-radius: 50%;
        font-family: var(--font-primary);
        font-weight: 500;
        font-size: 16px;
        line-height: 120%;
        text-align: center;
        color: var(--text-muted);
        flex-shrink: 0;
    }
    
    .header-subtitle {
        font-size: 14px;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 24px;
        line-height: 120%;
        margin-top: 32px;
        margin-bottom: 24px;
    }
    
    /* Key Finding */
    .key-finding-section {
        margin-top: 16px;
        margin-bottom: 16px;
    }
    
    .key-finding-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        min-height: auto;
    }
    
    .key-finding-text {
        font-size: 18px;
        line-height: 120%;
        min-height: auto;
        width: 100%;
    }
    
    /* Question Section */
    .question-section {
        margin-bottom: 40px;
    }
    
    .question-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .question-section .question-title {
        font-size: 16px;
        line-height: 140%;
        margin-bottom: 0;
    }
    
    .question-subtitle {
        font-size: 14px;
        line-height: 140%;
    }
    
    /* Chart wrapper mobile */
    .chart-wrapper {
        max-width: 100%;
        height: 180px;
        margin: 16px 0;
    }
    
    /* Answer bars */
    .answer-bar-row {
        margin-bottom: 12px;
    }
    
    .answer-label {
        width: auto;
        min-width: 80px;
        font-size: 12px;
        margin-right: 12px;
    }
    
    .answer-bar {
        height: 20px;
    }
    
    /* Divider line */
    .divider-line {
        margin: 32px 0;
    }
    
    /* Modal */
    .explore-modal {
        width: 95vw;
        padding: 32px;
        gap: 24px;
    }
    
    .explore-modal-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .explore-modal-close {
        right: 8px;
        top: 8px;
    }
    
    /* Footer Links Visibility */
    .footer-links-mobile {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        order: -1;
    }
    
    .footer-links-desktop {
        display: none;
    }
    
    /* Shared Legend - Show on mobile */
    .shared-demographic-legend {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px 16px;
        padding: 0 0 24px 0;
        margin: 0;
    }
    
    .shared-demographic-legend .legend-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        width: calc(50% - 8px);
        min-width: 140px;
    }
    
    .shared-demographic-legend .legend-color {
        width: 14px;
        height: 14px;
        border-radius: 2px;
        flex-shrink: 0;
    }
    
    .shared-demographic-legend .legend-label {
        font-family: var(--font-primary);
        font-weight: 500;
        font-size: 12px;
        line-height: 102%;
        color: var(--text-dark);
    }
    
    /* Hide individual chart legends on mobile - only show the shared legend at the top */
    .demographic-section .legend {
        display: none !important;
    }
}

/* ============================================
   MOBILE MENU - HIDDEN BY DEFAULT
   ============================================ */
.mobile-menu-btn,
.mobile-menu-toggle {
    display: none;
}

.mobile-menu-overlay {
    display: none;
}

.mobile-menu-panel,
.mobile-menu {
    display: none;
}

.mobile-filter-section {
    display: none;
}

/* ============================================
   RESPONSIVE: MOBILE (max-width: 768px) - MOBILE MENU
   ============================================ */
@media (max-width: 768px) {
    /* Mobile hamburger menu button */
    .mobile-menu-btn,
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    
    .mobile-menu-btn svg,
    .mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
    }
    
    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
    
    /* Full-screen mobile menu panel */
    .mobile-menu-panel,
    .mobile-menu {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--bg-white);
        z-index: 9999;
        overflow-y: auto;
    }
    
    .mobile-menu-panel.active,
    .mobile-menu.active {
        display: block;
    }
    
    /* Mobile menu header */
    .mobile-menu-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 24px;
        height: var(--nav-height-mobile);
        box-sizing: border-box;
        border-bottom: 1px solid var(--border-gray);
    }
    
    .mobile-menu-logo {
        font-family: var(--font-primary);
        font-weight: 700;
        font-size: 28px;
        line-height: 102%;
        letter-spacing: -0.04em;
        color: var(--primary-blue);
        text-decoration: none;
    }
    
    .mobile-menu-close {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
    }
    
    .mobile-menu-close svg {
        width: 22px;
        height: 22px;
    }
    
    /* Mobile menu toolbar */
    .mobile-menu-toolbar {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 24px;
        margin-top: 23px;
        gap: 16px;
    }
    
    .mobile-menu-search {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px 8px 16px;
        width: 233px;
        height: 36px;
        background: var(--bg-light-purple);
        border-radius: 40px;
        box-sizing: border-box;
        flex-shrink: 0;
    }
    
    .mobile-menu-search-input {
        flex: 1;
        border: none;
        background: transparent;
        font-family: var(--font-primary);
        font-weight: 400;
        font-size: 14px;
        line-height: 102%;
        color: var(--text-dark);
        outline: none;
        min-width: 0;
    }
    
    .mobile-menu-search-input::placeholder {
        color: var(--text-dark);
    }
    
    /* OurCare.ca button in toolbar */
    .mobile-menu-toolbar-btn {
        box-sizing: border-box;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 10px 16px;
        gap: 4px;
        width: 93px;
        height: 36px;
        border: 1px solid var(--primary-blue);
        border-radius: 39px;
        background: transparent;
        text-decoration: none;
        flex-shrink: 0;
    }
    
    .mobile-menu-toolbar-btn span {
        font-family: var(--font-primary);
        font-weight: 500;
        font-size: 14px;
        line-height: 102%;
        color: var(--primary-blue);
    }
    
    .mobile-menu-toolbar-btn:hover {
        background: var(--primary-blue);
    }
    
    .mobile-menu-toolbar-btn:hover span {
        color: var(--text-light);
    }
    
    /* Mobile menu standards list */
    .mobile-menu-standards {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0 24px;
        gap: 24px;
        margin-top: 31px;
    }
    
    .mobile-menu-standard-item {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        padding: 0;
        gap: 16px;
        width: 100%;
        text-decoration: none;
    }
    
    .mobile-menu-standard-number {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 4px 0 0 0;
        width: 22px;
        flex-shrink: 0;
    }
    
    .mobile-menu-standard-number span {
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 22px;
        height: 22px;
        border: 2px solid var(--text-dark);
        border-radius: 50%;
        font-family: var(--font-primary);
        font-weight: 500;
        font-size: 16px;
        line-height: 120%;
        color: var(--text-dark);
    }
    
    .mobile-menu-standard-content {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex: 1;
        gap: 12px;
    }
    
    .mobile-menu-standard-title {
        font-family: var(--font-primary);
        font-weight: 600;
        font-size: 16px;
        line-height: 140%;
        color: var(--text-dark);
    }
    
    .mobile-menu-standard-arrow {
        width: 13px;
        height: 13px;
        flex-shrink: 0;
    }
    
    .mobile-menu-standard-item:hover .mobile-menu-standard-title {
        color: var(--primary-blue);
    }
    
    .mobile-menu-standard-item:hover .mobile-menu-standard-number span {
        border-color: var(--primary-blue);
        color: var(--primary-blue);
    }
    
    /* Mobile menu bottom section */
    .mobile-menu-bottom {
        display: none;
    }
    
    /* Mobile menu search results */
    .mobile-search-results {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        padding: 0 24px;
        gap: 16px;
        margin-top: 31px;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .mobile-search-results.active {
        display: flex;
    }
    
    .mobile-search-result-item {
        width: 100%;
        font-family: var(--font-secondary);
        font-weight: 400;
        font-size: 16px;
        line-height: 100%;
        color: var(--text-dark);
        cursor: pointer;
        padding: 0;
        border: none;
    }
    
    .mobile-search-result-item:hover {
        color: var(--primary-blue);
    }
    
    .mobile-menu-panel.search-active .mobile-menu-standards {
        display: none;
    }
    
    .mobile-menu-panel.search-active .mobile-search-results {
        display: flex;
    }
    
    .mobile-menu-panel.search-active .mobile-menu-bottom {
        display: none;
    }
    
    /* Mobile Filter Section */
    .mobile-filter-section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 21px 24px;
        gap: 13px;
        position: fixed;
        top: var(--nav-height-mobile);
        left: 0;
        right: 0;
        width: 100%;
        height: 90px;
        background: var(--bg-light-purple);
        z-index: 999;
        box-sizing: border-box;
    }
    
    .mobile-select-primary {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 10px 16px;
        gap: 16px;
        width: 100%;
        max-width: 336px;
        height: 44px;
        background: var(--primary-blue);
        border-radius: 39px;
        border: none;
        cursor: pointer;
    }
    
    .mobile-select-primary .select-text {
        flex: 1;
        font-family: var(--font-secondary);
        font-weight: 500;
        font-size: 14px;
        line-height: 102%;
        color: var(--text-light);
        text-align: left;
    }
    
    .mobile-select-secondary,
    .mobile-question-select {
        box-sizing: border-box;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 10px 16px;
        gap: 16px;
        width: 100%;
        max-width: 336px;
        height: 48px;
        border: 1px solid var(--primary-blue);
        border-radius: 39px;
        background: var(--bg-white);
        cursor: pointer;
        position: relative;
    }
    
    .mobile-select-secondary .select-text,
    .mobile-question-select .select-text {
        flex: 1;
        font-family: var(--font-secondary);
        font-weight: 300;
        font-size: 14px;
        line-height: 102%;
        color: var(--text-dark);
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .mobile-dropdown,
    .mobile-question-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        max-height: 300px;
        overflow-y: auto;
        z-index: 100;
        margin-top: 8px;
    }
    
    .mobile-dropdown.active,
    .mobile-question-dropdown.active {
        display: block;
    }
    
    .mobile-dropdown-item,
    .mobile-question-dropdown-item {
        padding: 12px 16px;
        font-family: var(--font-secondary);
        font-size: 14px;
        color: var(--text-dark);
        cursor: pointer;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-dropdown-item:last-child,
    .mobile-question-dropdown-item:last-child {
        border-bottom: none;
    }
    
    .mobile-dropdown-item:hover,
    .mobile-dropdown-item.selected,
    .mobile-question-dropdown-item:hover {
        background: var(--bg-light-purple);
        color: var(--primary-blue);
    }
    
    /* Adjust main content when filter is visible */
    .main-content.with-filter {
        margin-top: calc(var(--nav-height-mobile) + 90px);
    }
}

/* ============================================
   RESPONSIVE: SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .mobile-menu-search {
        width: 100%;
        flex: 1;
    }
    
    .mobile-menu-toolbar {
        flex-wrap: wrap;
    }
    
    /* Question Header */
    .question-header {
        margin-top: 150px;
        padding: 24px 27px;
    }
    
    .question-title {
        font-size: 24px;
        line-height: 120%;
    }
    
    /* Demographics */
    .demographic-bar-label {
        width: 100px;
        font-size: 12px;
    }
    
    .demographic-chart-title {
        font-size: 16px;
        line-height: 140%;
        margin: 0 0 16px 0;
    }
    
    /* Mobile Legend - 2 column grid */
    .legend {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px 24px;
        padding: 16px 0;
        width: 100%;
        margin: 0;
    }
    
    .legend-item {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 6px;
        width: calc(50% - 12px);
        min-width: 140px;
    }
    
    /* Mobile chart wrapper */
    .chart-wrapper-container {
        flex-direction: column;
    }
    
    .chart-wrapper {
        width: 100%;
        height: auto;
        min-height: 300px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.hidden { display: none; }
.visible { display: block; }

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

