/* Contains: CSS variables, resets, body, img, a, ul, .container

/* 
  Theme Colours 
  Primary Green: #1e4d2b
  Secondary Green (Hover/Accent): #2a6639
  Accent Lime: #a4c639
  Dark Text: #1a1a1a
  Light Grey: #f4f4f4
*/

:root {
    --color-primary: darkgreen;
    --color-primary-dark: #153820;
    --color-secondary: #2a6639;
    --color-accent: #a4c639;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-background: #fcfcfc;
    --color-background-light: #fefefe;
    --color-white: #ffffff;

    --font-main: 'Outfit', sans-serif;

    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 32px;
    --spacing-xl: 64px;

    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-background);
    padding-top: 60px;
    /* Account for fixed header - reduced from 100px */
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* This overrides the attribute hidden */
[hidden] {
    /* biome-ignore lint: Needing explicit override for hidden modifier */
    display: none !important;
}

/* This defines a class called 'hidden' */
.hidden {
    /* biome-ignore lint: Needing explicit override for hidden modifier */
    display: none !important;
}

/* Hides the item, but keeps it for layouts in e.g. grid */
.invisible {
    visibility: hidden;
}


/*
 * Spinner definition.
 */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6);
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #005fb8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/*
 * Login dialog
 */
.login-dialog {
    all: initial;
    display: flex;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.login-dialog-content {
    background-color: #fefefe;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.login-dialog-header {
    text-align: left;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.login-dialog-header h3 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
    flex-grow: 1;       
    min-width: 0;       
    overflow-wrap: break-word; 
    word-break: break-word;    
}

.login-dialog-logo {
    height: 40px;
    flex-shrink: 0;
}

.login-dialog-body {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #fcfcfc;
}

.login-dialog-grid {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 12px 20px;
    align-items: center;
}

.login-dialog-grid label {
    text-align: left;
}

.login-dialog-grid input {
    font-size: 1rem;
    padding-top: 5px;
    padding-bottom: 5px
}

.login-dialog-actions {
    grid-column: 1 / -1;
    /* Spans full width */
    display: flex;
    /* Flexbox for side-by-side buttons */
    gap: 16px;
    justify-content: flex-end;
    /* Right aligned */
    margin-top: 16px;
}

.login-error {
    color: #d32f2f;
    font-size: 0.875rem;
    margin-top: 4px;
    display: block;
}

.login-dialog-footer {
    text-align: right;
    margin-top: 10px;
}

.login-dialog-footer-link {
    color: #005fb8;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
}

/* Popup Menu styles */
.menu-shield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent; /* Invisible but absorbs the click */
    z-index: 999;
}
.menu-popup {
    position: absolute;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    z-index: 1000;
}

.menu-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    font-size: 10pt;
    color: black;
    cursor: pointer;
    user-select: none;
}

.menu-option span {
    pointer-events: none;
}

.menu-option:not(:last-child) {
    border-bottom: 1px solid #d3d3d3;
}

.menu-option:hover {
    background-color: #f5f5f5;
}

.menu-image {
    width: 20px; /* Adjust as needed */
    height: 20px; /* Adjust as needed */
    object-fit: contain;
    flex-shrink: 0;
}

/* --- Banner styles --- */
.banner-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: darkgreen;
    color: white;
    padding: 0.75rem 1rem;
    position: relative;
    height: 3rem;
    width: 100%;
}

.banner-section-logo {
    position: absolute;
    left: 1rem;
    height: 2.9rem;
    width: auto;
    object-fit: contain;
}

.banner-section-title {
    font-size: clamp(1rem, 6vw, 1.8rem);
    /* Increased font size */
    font-weight: bold;
    margin: 0;
    text-align: center;
}

/* Not used - this style is for normal select boxes! */
.banner-section-select-normal {
    border: 0.125rem solid white;
    border-radius: 0.3rem;
    padding: 0.5rem;
    background-color: darkgreen;
    color: white;
    font-size: 1rem;
    font-weight: bold;
}

.banner-section-select-wrapper {
    position: relative;
    width: 60%;
    max-width: 300px;
}

.banner-section-select {
    position: relative;
    cursor: pointer;
}

/* The Main Box (Bold and Large) */
.banner-section-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background: darkgreen;
    border: 0.125rem solid white;
    border-radius: 0.3rem;
}

.banner-org-select-chevron {
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
    display: block;
}

.banner-section-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    display: block;
    width: 100%;
}


/* The Dropdown Pop-up (Smaller Text) */
.banner-section-options {
    box-sizing: border-box;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: darkgreen;
    border: 0.125rem solid white;
    border-radius: 0.3rem;
    display: none;
    z-index: 10;
}

.banner-section-select.open .banner-section-options {
    display: block;
    /* Show on click */
}

.banner-select-option-container {
    display: grid;
    grid-template-columns: 5% 95%;
    align-items: center;
    gap: 0.1rem;
    overflow:hidden;
}

.banner-select-option-container:hover {
    background: #a77d1b;
    border-radius: 0.3rem;
} 

.banner-org-option-tick {
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
    display: block;
}

.banner-section-option {
    display: block;
    padding: 0.5rem;
    font-size: 0.9rem;    /* Smaller than the main box */
    font-weight: normal;
    /* Not bold */
    color: white;
}

.banner-menu {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%); /* Perfectly centers it vertically */
    
    background: none;
    border: none;
    font-size: 1.75rem;
    color: white;
    cursor: pointer;
    font-weight: bold; 
    line-height: 1;
    padding: 0.5rem;
}

.validation-error {
    background-color: lightgoldenrodyellow;
    font-size: 1rem;
    font-weight: normal;
    color: black;
    z-index: 500;
    margin-top: 4px; /* Tiny gap beneath the input field */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 4px 0 4px;
}
