:root {
    /* Core Primary Variables */
    --bs-primary: #8e9300;
    --bs-primary-rgb: 142, 147, 0; /* RGB equivalent for backgrounds with opacity */

    /* Override standard link colors */
    --bs-link-color: #8e9300;
    --bs-link-hover-color: #787c00; /* Slightly darker for hover */
}

/* * BOOTSTRAP UTILITY OVERRIDES 
 * Ensures background and text utilities use the exact hex code
 */
.bg-primary {
    background-color: var(--bs-primary) !important;
}
.text-primary {
    color: var(--bs-primary) !important;
}
.border-primary {
    border-color: var(--bs-primary) !important;
}

/* * SOLID BUTTON OVERRIDES (.btn-primary)
 * We set the specific button variables to handle hover, active, and focus states natively.
 */
.btn-primary {
    --bs-btn-color: #ffffff;
    --bs-btn-bg: #8e9300;
    --bs-btn-border-color: #8e9300;
    
    /* Hover state (approx 15% darker) */
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: #787c00;
    --bs-btn-hover-border-color: #727600;
    
    /* Focus glow ring */
    --bs-btn-focus-shadow-rgb: 164, 169, 38; 
    
    /* Active/Clicked state (approx 20% darker) */
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: #727600;
    --bs-btn-active-border-color: #636700;

    /* Disabled state */
    --bs-btn-disabled-color: #ffffff;
    --bs-btn-disabled-bg: #8e9300;
    --bs-btn-disabled-border-color: #8e9300;
}

/* * OUTLINE BUTTON OVERRIDES (.btn-outline-primary)
 */
.btn-outline-primary {
    --bs-btn-color: #8e9300;
    --bs-btn-border-color: #8e9300;
    
    /* When hovered, it fills with the primary color */
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: #8e9300;
    --bs-btn-hover-border-color: #8e9300;
    
    --bs-btn-focus-shadow-rgb: 142, 147, 0;
    
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: #8e9300;
    --bs-btn-active-border-color: #8e9300;
}

/* * ALERT BOX OVERRIDES (.alert-primary) 
 * Creates a soft tinted background with dark readable text for flash messages
 */
.alert-primary {
    --bs-alert-color: #474a00; 
    --bs-alert-bg: #f4f5cc; 
    --bs-alert-border-color: #d1d466; 
}

/*
 * ALTERNATIVE PRIMARY THEME (#004151)
 */

/* Utilities */
.bg-primary-alt {
    background-color: #004151 !important;
}
.text-primary-alt {
    color: #004151 !important;
}
.border-primary-alt {
    border-color: #004151 !important;
}

/* Solid Button */
.btn-primary-alt {
    --bs-btn-color: #ffffff;
    --bs-btn-bg: #004151;
    --bs-btn-border-color: #004151;

    /* Hover state */
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: #003542;
    --bs-btn-hover-border-color: #002a35;

    /* Focus glow ring */
    --bs-btn-focus-shadow-rgb: 0, 65, 81;

    /* Active/Clicked state */
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: #002a35;
    --bs-btn-active-border-color: #002028;

    /* Disabled state */
    --bs-btn-disabled-color: #ffffff;
    --bs-btn-disabled-bg: #004151;
    --bs-btn-disabled-border-color: #004151;
}

/* Outline Button */
.btn-outline-primary-alt {
    --bs-btn-color: #004151;
    --bs-btn-border-color: #004151;

    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: #004151;
    --bs-btn-hover-border-color: #004151;

    --bs-btn-focus-shadow-rgb: 0, 65, 81;

    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: #004151;
    --bs-btn-active-border-color: #004151;
}

/* * HOUSE TEAM BADGES
 * Custom badges for each house team to ensure correct branding colors.
 */
.badge-tantalus {
    background-color: #dc3545; /* Red */
    color: #fff;
}
.badge-elaho {
    background-color: #198754; /* Green */
    color: #fff;
}
.badge-skookum {
    background-color: #0d6efd; /* Blue */
    color: #fff;
}
.badge-skypilot {
    background-color: #212529; /* Black */
    color: #fff;
}
.badge-uncertain {
    background-color: #6c757d; /* Grey */
    color: #fff;
}

/* Strikethrough for unlink icon */
.icon-unlink {
    position: relative;
}

.icon-unlink::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 1.5px;
    background-color: currentColor;
    transform: rotate(45deg);
}

/* Hover effect for main navigation links in the page header */
header .nav-link {
    transition: background-color 0.2s ease-in-out;
}

header .nav-link:hover,
header .nav-link.active {
    background-color: #f0f0f0; /* A very light grey */
    border-radius: var(--bs-border-radius);
}

/* Bootstrap Icon Sizing */
.btn .bi,
.sidebar .nav-link .bi {
    font-size: 1.1rem;
}
.sidebar .nav-link .bi{
    margin-right: 0.4rem;
}

.widgets .bi {
    font-size: 2rem;
    margin-left: -2rem;
}

#usermenuicon{
    margin-right: 1rem;
}

/* Sticky Footer Setup */
html, body {
    height: 100%;
}
body {
    display: flex;
    flex-direction: column;
}

/*
 * CUSTOM FORM VALIDATION STYLES
 * Highlights invalid fields using the native :invalid pseudo-class, but only
 * after a form submission has been attempted (by adding .was-validated to the form).
 */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: #dc3545; /* Bootstrap's $danger color */
}

.was-validated .form-control:invalid:focus,
.was-validated .form-select:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}