/* CISV USA Compass - Custom Theme */
/* Taking sample.css as a base and merging in the styles */
/* Then I want to consolidate the custom CSS from the other pages to create a final merged document */



/* ----------------------------------------------------------------
   CISV Official Colour Palette
   Source: CISV International Brand Guidelines (Pantone swatches)
   Each colour has 5 tint levels: 100% 75% 50% 25% 10%
   ---------------------------------------------------------------- */
:root {
    --navbar-height: 30px;

    /* --- Blue (Pantone 285C) --- */
    --cisv-blue:        #0072CE;
    --cisv-blue-75:     #5A90CC;
    --cisv-blue-50:     #97B3DD;
    --cisv-blue-25:     #CCD8EE;
    --cisv-blue-10:     #EBEFF8;

    /* --- Orange (Pantone 165C) --- */
    --cisv-orange:      #FF671F;
    --cisv-orange-75:   #F68D5D;
    --cisv-orange-50:   #FFB68D;
    --cisv-orange-25:   #FCD6C5;
    --cisv-orange-10:   #FEEEE7;

    /* --- Yellow (Pantone 123C) --- */
    --cisv-yellow:      #FFC72C;
    --cisv-yellow-75:   #FFD368;
    --cisv-yellow-50:   #FFE19A;
    --cisv-yellow-25:   #FFF0CC;
    --cisv-yellow-10:   #FFF8E9;

    /* --- Red / Warm Red (Pantone Warm Red) --- */
    --cisv-red:         #F9423A;
    --cisv-red-75:      #FF7C66;
    --cisv-red-50:      #FFA995;
    --cisv-red-25:      #FFD4C8;
    --cisv-red-10:      #FFEDE8;

    /* --- Pink / Magenta (Pantone 227C) --- */
    --cisv-pink:        #AA0061;
    --cisv-pink-75:     #C95485;
    --cisv-pink-50:     #DF8EAB;
    --cisv-pink-25:     #F2C6D3;
    --cisv-pink-10:     #FBE7EC;

    /* --- Dark Blue / Navy (Pantone 293C) --- */
    --cisv-dark-blue:       #003DA6;
    --cisv-dark-blue-75:    #4467BD;
    --cisv-dark-blue-50:    #8896D3;
    --cisv-dark-blue-25:    #C4C8E8;
    --cisv-dark-blue-10:    #E8E8F5;

    /* --- Light Blue / Sky (Pantone 290C) --- */
    --cisv-light-blue:      #B9D9EB;
    --cisv-light-blue-75:   #CBE1EF;
    --cisv-light-blue-50:   #DDEBF4;
    --cisv-light-blue-25:   #EEF4F9;
    --cisv-light-blue-10:   #F9FAFC;

    /* --- Green (Pantone 362C) --- */
    --cisv-green:       #509E2F;
    --cisv-green-75:    #7DB563;
    --cisv-green-50:    #A9CD95;
    --cisv-green-25:    #D4E6C8;
    --cisv-green-10:    #EEF4E8;
}

/* ----------------------------------------------------------------
   Rooming cabin cards (Domestic Events)
   Each cabin gets its OWN distinct colour so cabins are easy to tell
   apart at a glance; the age/gender category is shown as the text badge
   in the header, not by colour.  The template rotates cabins through
   .cabin-c0 … .cabin-c7 with {% cycle %}.  Every class colours the whole
   card: full brand hue on the header + left stripe, and the matching
   10 % tint (from the palette ladder) as a faint body wash.  Header text
   colour is chosen per hue for legibility.  `.card.` prefix keeps the
   body/border rules above Bootstrap's own `.card`.
   ---------------------------------------------------------------- */
.card.cabin-c0 { border-left: 8px solid var(--cisv-blue, #0072CE);      background: var(--cisv-blue-10, #EBEFF8); }
.card.cabin-c1 { border-left: 8px solid var(--cisv-orange, #FF671F);    background: var(--cisv-orange-10, #FEEEE7); }
.card.cabin-c2 { border-left: 8px solid var(--cisv-green, #509E2F);     background: var(--cisv-green-10, #EEF4E8); }
.card.cabin-c3 { border-left: 8px solid var(--cisv-pink, #AA0061);      background: var(--cisv-pink-10, #FBE7EC); }
.card.cabin-c4 { border-left: 8px solid var(--cisv-yellow, #FFC72C);    background: var(--cisv-yellow-10, #FFF8E9); }
.card.cabin-c5 { border-left: 8px solid var(--cisv-dark-blue, #003DA6); background: var(--cisv-dark-blue-10, #E8E8F5); }
.card.cabin-c6 { border-left: 8px solid var(--cisv-red, #F9423A);       background: var(--cisv-red-10, #FFEDE8); }
.card.cabin-c7 { border-left: 8px solid var(--cisv-light-blue, #B9D9EB); background: var(--cisv-light-blue-10, #F9FAFC); }

/* The `.main-panel` prefix out-specifies sidebar.css's
   `.main-panel .card-header { background: navy }`, which otherwise forces
   every sidebar card header to dark blue and would mask these hues. */
.main-panel .cabin-c0 > .card-header { background: var(--cisv-blue, #0072CE);      color: #fff; }
.main-panel .cabin-c1 > .card-header { background: var(--cisv-orange, #FF671F);    color: #212529; }
.main-panel .cabin-c2 > .card-header { background: var(--cisv-green, #509E2F);     color: #fff; }
.main-panel .cabin-c3 > .card-header { background: var(--cisv-pink, #AA0061);      color: #fff; }
.main-panel .cabin-c4 > .card-header { background: var(--cisv-yellow, #FFC72C);    color: #212529; }
.main-panel .cabin-c5 > .card-header { background: var(--cisv-dark-blue, #003DA6); color: #fff; }
.main-panel .cabin-c6 > .card-header { background: var(--cisv-red, #F9423A);       color: #fff; }
.main-panel .cabin-c7 > .card-header { background: var(--cisv-light-blue, #B9D9EB); color: #212529; }

/* Category pill in the cabin header — coloured by gender (male blue,
   female pink, any grey).  A faint white ring keeps it legible even when
   the pill sits on a same-hue cabin header. */
.badge-gender-male   { background: var(--cisv-blue, #0072CE); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55); }
.badge-gender-female { background: var(--cisv-pink, #AA0061); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55); }
.badge-gender-any    { background: #6c757d;                   color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55); }

/* Global Styles */
body {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    /* Reduced font size */
    background-color: #F8F9FA;
    color: #333;
    /* padding-top: calc(var(--navbar-height) + 8px);*/

}


.logo-img {
    height: 60px;
    /* Adjust as needed */
    width: auto;
    /* Keeps aspect ratio */
    margin-right: 10px;
    /* Adds spacing between logo and text */
    vertical-align: middle;
    /* Aligns with text */
}


/* Navbar */
.navbar {
    background-color: var(--cisv-blue) !important;
}

.navbar a {
    color: white !important;
}

.navbar a:hover {
    color: var(--cisv-yellow) !important;
}

/* Sidebar - Fixed Full Height Below Navbar */
.sidebar {
    background-color: var(--cisv-dark-blue);
    width: 225px;
    position: fixed;
    top: 80px;
    /* Pushes sidebar below navbar */
    left: 0;
    bottom: 0;
    height: calc(100vh - 56px);
    /* Full height minus navbar */
    padding-top: 20px;
    overflow-y: auto;
    /* Enables scrolling if needed */
}

.sidebar a {
    color: white;
    padding: 10px;
    display: block;
    z-index: 1000;

}

.sidebar a:hover {
    background-color: #003B80;
    /* Slightly darker hover */
}

/* Main Content - Adjusted to Sidebar */
.main-content {
    margin-left: 115px;
    /* Sidebar width */
    padding: 10px;
    margin-top: 0;
    /* Pushes content down below navbar */
}

/* Main Content - No Sidebar */

.main-content-no-side {
    margin-left: 25px;
    /* Sidebar width */
    padding: 10px;
    margin-top: 50px;
    /* Pushes content down below navbar */
}


/* Buttons */
.btn-primary {
    background-color: var(--cisv-blue);
    border-color: var(--cisv-blue);
}

.btn-primary:hover {
    background-color: var(--cisv-dark-blue);
    border-color: var(--cisv-dark-blue);
}

.btn-secondary {
    background-color: var(--cisv-yellow);
    border-color: var(--cisv-yellow);
    color: black;
}

.btn-secondary:hover {
    background-color: #D38A00;
    border-color: #D38A00;
}

/* Table Headers */
.table th {
    background-color: var(--cisv-blue);
    color: white;
}

/* Table Styles */
.table td {
    border: 1px solid #dee2e6;
}

.table {
    border-radius: 8px;
    overflow: hidden;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #E0E0E0;
}

/* Footer */
.footer {
    background-color: var(--cisv-blue);
    color: white;
    text-align: center;
    padding: 10px 0;
    position: absolute;
    width: 100%;
    bottom: 0;
}


/* Forms */
.form-control {
    border-radius: 5px;
    border: 1px solid #ccc;
}

.form-control:focus {
    border-color: #0057B8;
    box-shadow: 0 0 5px rgba(0, 87, 184, 0.5);
}

th.rotate {
    writing-mode: vertical-rl;
    /* Vertical text */
    transform: rotate(180deg);
    /* Optional: Flip text direction */
    text-align: center;
    vertical-align: middle;
    height: 100px;
    /* Adjust based on content */
    padding: 10px;
}


/* Secondary Navigation Bar */
.secondary-nav {
    background-color: orange;
    /* ✅ Ensure background is orange */
    padding: 10px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

/* Navigation Links */
.secondary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.secondary-nav ul li {
    margin: 0 15px;
}

.secondary-nav ul li a {
    color: white;
    /* ✅ Ensure text is white */
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px;
    transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
    border-radius: 5px;
}

/* Hover Effect */
.secondary-nav ul li a:hover {
    background-color: white;
    /* ✅ Ensure hover background is white */
    color: orange;
    /* ✅ Text changes to orange */
}

/* Active Link Styling */
.secondary-nav ul li a.active {
    background-color: white;
    /* ✅ Active tab background */
    color: orange;
    /* ✅ Text color for active tab */
    border-radius: 5px;
}

/* Custom Orange Background for Navbar */
.bg-orange {
    background-color: orange !important;
    /* ✅ Ensures proper background color */
}

/* Navbar Text */
.navbar .navbar-nav .nav-link {
    color: white !important;
    /* ✅ Ensures text is visible */
    font-weight: bold;
    transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
    padding: 10px 15px;
    border-radius: 5px;
}

/* Hover Effect */
.navbar .navbar-nav .nav-link:hover {
    background-color: white !important;
    /* ✅ Hover effect */
    color: orange !important;
    /* ✅ Text changes to orange */
}

/* Active State */
.navbar .navbar-nav .nav-link.active {
    background-color: white !important;
    color: orange !important;
    border-radius: 5px;
}

/* Fix dropdown item styles in navbar */
.navbar .dropdown-menu .dropdown-item {
    color: #0072CE !important;
    /* CISV blue */
    background-color: white !important;
}

.navbar .dropdown-menu .dropdown-item:hover {
    background-color: #e6f2fb !important;
    /* light blue hover */
    color: #0072CE !important;
    /* keep the text blue on hover */
    font-weight: bold;
}

.navbar .dropdown-menu .dropdown-item.active {
    background-color: #cce6ff !important;
    font-weight: bold;
}


/* Dashboard Cards */
.card {
    border-radius: 10px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    border: none;
}

.card-header {
    background-color: var(--cisv-blue);
    color: white;
    font-weight: bold;
}

/* When bg-light overrides the blue background, the text must be dark
   so it remains readable on the light grey background. */
.card-header.bg-light,
.card-header.bg-info-subtle,
.card-header.bg-success-subtle,
.card-header.bg-warning-subtle,
.card-header.bg-danger-subtle,
.card-header.bg-primary-subtle,
.card-header.bg-secondary-subtle {
    color: #333 !important;
}

/* Ensure Navbar Sticks to the Top */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.chart-container {
    width: 40%;
    height: 200px;
    /* Adjust this value as needed */
    position: relative;
}

.canvas-generic {
    width: 80% !important;
    height: 50% !important;
    max-width: 450px;
    max-height: 450px;
    display: block;
    margin: auto;
}

/* Chart.js canvases must fill the container (override global canvas sizing) */
.chart-container-sm canvas,
.chart-container-lg canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}

@media (max-width: 991px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .sidebar a {
        display: inline-block;
        padding: 10px 15px;
    }
}

/* Make sortable table header links visible on colored headers */
.table thead th a,
.table thead th a:visited {
    color: #fff !important;
    text-decoration: none;
}

.table thead th a:hover,
.table thead th a:focus {
    color: #fff !important;
    text-decoration: underline;
}

/* Optional: nicer focus ring for accessibility */
.table thead th a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    border-radius: .25rem;
}

/* Optional: dim the sort caret a bit */
.table thead th a .sort-caret,
.table thead th a span.opacity-75 {
    opacity: .75;
    margin-left: .25rem;
}

/* Link visibility policy:
   Inside table bodies we keep the surrounding text color (so a row of
   chapter names doesn't turn into a wall of blue) BUT we always render
   a visible underline so users can tell the text is clickable.  On
   hover/focus the link snaps to CISV blue for extra emphasis.

   To opt out for a specific link (e.g. a clickable badge or icon where
   the visual is the cue), add Bootstrap's `text-decoration-none` class
   on the <a>. */
.table tbody a,
.table tbody a:visited {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-underline-offset: 2px;
}


.table tbody a:hover,
.table tbody a:focus {
    color: var(--cisv-blue);
    /* or var(--cisv-dark-blue) if you prefer */
    text-decoration: underline;
    text-decoration-color: currentColor;
}

/* keep control block from stretching; let text wrap naturally */
.question-card .col-auto {
    flex: 0 0 auto;
}

.question-card .min-w-0 {
    min-width: 0;
}

/* prevents flex overflow */

/* normalize rich HTML inside question_text */
.question-text p,
.question-text ul,
.question-text ol {
    margin-bottom: 0;
}

.question-text ul,
.question-text ol {
    padding-left: 1.25rem;
    list-style-position: outside;
}

/* prevent giant headings inside question_text from changing layout */
.question-text h1,
.question-text h2,
.question-text h3 {
    font: inherit;
    margin: 0;
}

/* handle very long words/URLs */
.question-text {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* make buttons a consistent size so the rail is stable */
.question-card .btn {
    min-width: 5.5rem;
}

/* Bootstrap-like utility so we can just add a class */
.bg-cisv-dark-blue-50 {
    background-color: var(--cisv-dark-blue-50, #8896D3) !important;
    color: #fff !important;
}

.bg-cisv-orange {
    background-color: var(--cisv-orange) !important;
    color: #fff !important;
    /* ensure readable text */
}

/* If buttons/links ever appear in orange headers, keep them white too */
.bg-cisv-orange a,
.bg-cisv-orange .btn-link {
    color: #fff !important;
    text-decoration-color: rgba(255, 255, 255, .6);
}

/* Keeps CKEditor output readable inside compact table cells */
.helptext-preview p {
    margin: 0 0 .25rem;
}

.helptext-preview p:last-child {
    margin-bottom: 0;
}

.helptext-preview ul,
.helptext-preview ol {
    margin: 0 0 .25rem;
    padding-left: 1.25rem;
}

.helptext-preview li {
    margin-bottom: .125rem;
}

/* Optional: prevent one row from becoming enormous */
.helptext-preview {
    max-height: 6rem;
    overflow: auto;
}

.helptext-preview p {
    margin: 0 0 .5rem;
}

.helptext-preview p:last-child {
    margin-bottom: 0;
}

.helptext-preview ul,
.helptext-preview ol {
    margin: 0 0 .5rem;
    padding-left: 1.25rem;
}

/* Compact dashboard sizing */
.chart-container-sm {
    position: relative;
    height: 125px;
    /* donuts */
    width: 100%;
}

.chart-container-lg {
    position: relative;
    height: 170px;
    /* bar chart */
    width: 100%;
}


/* Optional: keeps card body from feeling too tall */
.card-body .chart-container-sm,
.card-body .chart-container-lg {
    margin-top: 8px;
}

.chart-card .card-body {
    padding: .75rem;
    /* smaller than default */
}

.chart-card .fs-3 {
    font-size: 1.5rem !important;
    /* the 7/9 and 3/9 */
    line-height: 1.1;
    margin-bottom: .25rem;
}

.badge-programme-village {
    background-color: #2e7d32;
}

.badge-programme-youth {
    background-color: #f9a825;
    color: #000;
}

.badge-programme-stepup {
    background-color: #c62828;
}

.badge-programme-seminar {
    background-color: #ef6c00;
}

/* --- programme header colors (match your screenshot) --- */
.programme-village {
    background: #4f8f2f;
    color: #000;
}

.programme-youth-meeting {
    background: #f2c230;
    color: #000;
}

.programme-step-up {
    background: #e33b2f;
    color: #000;
}

.programme-seminar-camp {
    background: #e7772b;
    color: #000;
}

/* header cells */
.programme-head {
    width: 38px;
    min-width: 38px;
    padding: 0;
    font-weight: 700;
    border: 2px solid #000;
}


/* vertical text like Excel */
.programme-vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: inline-block;
    line-height: 1;
    padding: 4px 0;
    /* tighter */
    font-size: 0.9rem;
    /* slightly smaller */
    letter-spacing: 0.02em;
}


/* year header stronger borders */
.year-head {
    border: 3px solid #000;
}

/* plan vs offers row tints */
.row-plan {
    background: #c9a6ff;
}

/* purple-ish */
.row-offers {
    background: #fff7ad;
}

/* pale yellow */


.ip-region-col {
    width: 260px;
    /* adjust to taste */
    min-width: 260px;
    max-width: 260px;
    white-space: normal;
}

/* =========================================================
   International Planning — Year Grid (single source of truth)
   ========================================================= */

table.intl-grid {
    border-collapse: collapse;
    width: 100%;
}

table.intl-grid th,
table.intl-grid td {
    padding: 6px 8px;
    text-align: center;
    border: 1px solid #d0d0d0;
    /* light gridlines */
}

/* Region column sizing */
table.intl-grid .region-col {
    text-align: left;
    font-weight: 600;
    min-width: 320px;
    white-space: nowrap;
}

/* Year header (blue band) */
table.intl-grid thead th.year-head {
    background: var(--cisv-blue) !important;
    color: #fff !important;
    font-weight: 800;
    border-left: 3px solid #000 !important;
    border-right: 3px solid #000 !important;
}

/* Programme header cells — COLORS MUST WIN over `.table th` */
table.intl-grid thead th.programme-head {
    padding: 0 !important;
    width: 38px;
    min-width: 38px;
    background: #fff !important;
    color: #000 !important;
}

/* Programme palette (match spreadsheet) */
table.intl-grid thead th.programme-head.programme-village {
    background: #4f8f2f !important;
}

table.intl-grid thead th.programme-head.programme-youth-meeting {
    background: #f2c230 !important;
}

table.intl-grid thead th.programme-head.programme-step-up {
    background: #e33b2f !important;
}

table.intl-grid thead th.programme-head.programme-seminar-camp {
    background: #e7772b !important;
}

/* Vertical text labels */
table.intl-grid thead th.programme-head .programme-vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: inline-block;
    line-height: 1;
    padding: 6px 0;
    font-size: 0.9rem;
    font-weight: 800;
}

/* Thick year separators (no black boxes around every programme) */
table.intl-grid .year-start {
    border-left: 3px solid #000 !important;
}

table.intl-grid .year-end {
    border-right: 3px solid #000 !important;
}

/* Horizontal separators between region blocks */
table.intl-grid tr.region-top td {
    border-top: 2px solid #000 !important;
}

table.intl-grid tr.region-bottom td {
    border-bottom: 2px solid #000 !important;
}

/* Totals stronger */
table.intl-grid tr.totals-row td {
    border-top: 3px solid #000 !important;
    font-weight: 800;
}

/* Row banding like the sheet */
table.intl-grid tr.plan-row td {
    background: #d6e6ff;
}

/* light blue */
table.intl-grid tr.offers-row td {
    background: #fff3cd;
}

/* light yellow */

/* =========================================================
   Chapter Hosting — Summary rows (USA Plan / Commitment / Diff)
   ========================================================= */

/* Common: all three summary rows get a heavy top border */
table.intl-grid tr.summary-usa-plan td,
table.intl-grid tr.summary-intl-commitment td,
table.intl-grid tr.summary-difference td {
    font-weight: 800;
    border-left: 1px solid #999;
    border-right: 1px solid #999;
}

/* Current USA Plan — CISV blue tint with heavy top border */
table.intl-grid tr.summary-usa-plan td {
    background: #cce0f5 !important;          /* light cisv-blue wash */
    border-top: 3px solid var(--cisv-blue) !important;
    border-bottom: 1px solid var(--cisv-blue);
    color: #003DA6;
}

/* Intl USA Commitment — CISV orange tint */
table.intl-grid tr.summary-intl-commitment td {
    background: #ffe4cc !important;          /* light cisv-orange wash */
    border-top: 2px solid var(--cisv-orange) !important;
    border-bottom: 1px solid var(--cisv-orange);
    color: #b34700;
}

/* Difference — CISV yellow tint with heavy bottom border */
table.intl-grid tr.summary-difference td {
    background: #fff4cc !important;          /* light cisv-yellow wash */
    border-top: 2px solid var(--cisv-yellow) !important;
    border-bottom: 3px solid var(--cisv-dark-blue) !important;
}

table.intl-grid tr.summary-difference td.text-success {
    color: var(--cisv-green) !important;
    font-weight: 800;
}

table.intl-grid tr.summary-difference td.text-danger {
    color: var(--cisv-red) !important;
    font-weight: 800;
}