﻿/* ==========================================
   GLOBAL STYLES + RESETS
========================================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: #333;
}

/* ==========================================
   LAYOUT CONSTANTS  (do not override per tenant)
========================================== */
:root {
    --sidebar-width: 220px;
    --header-height: 64px;
    --logo-box-height: 48px;
    --footer-height: 64px;
}

/* ==========================================
   HEADER + LOGO (do not override per tenant)
========================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--header-height); /* 64px */
    background-color: var(--bg-white);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient( to right, var(--primary-color), var(--primary-color-light) ) 1;
    /* mobile gutter */
    padding: 0 1.5rem;
}

/* offset by sidebar-width on desktop so the logo lines up to content */
@media (min-width: 992px) {
    .header {
        padding-right: 1.5rem;
    }
}

.logo-desktop {
    width: var(--sidebar-width);
    display: flex;
    justify-content: flex-start; /* force child to the left */
    align-items: center; /* center vertically in the header */
}

/* ─── only constrain height, keep aspect ratio, no skew ─── */
.logo-img {
    display: block;
    max-height: var(--logo-box-height); /* e.g. 48px */
    height: auto;
    width: auto;
    object-fit: contain; /* preserve proportions */
}

.modal-header {
    background: var(--primary-color);
    color: var(--text-color-light);
    padding: 2rem 1.5rem;
    border-bottom: none;
}

.icon-primary {
    color: var(--primary-color);
}

.dropdown-item.active,
.dropdown-item:active {
    color: var(--primary-color);
    background-color: var(--primary-color-lighter);
}

.user-dropdown:hover,
.sidebar-toggle:hover {
    background-color: rgba(0, 114, 188, 0.08);
    border-radius: 0.5rem;
}

.user-dropdown {
    background: transparent;
    border: none;
    color: var(--bg-white);
    padding: 0.5rem;
}

    .user-dropdown:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

/* ==========================================
   SIDEBAR
========================================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-white);
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    z-index: 1010;
    box-shadow: var(--box-shadow);
    transition: width var(--transition-speed) ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-nav-divider {
    border-top: 1px solid var(--border-color-light);
    margin: 0.75rem 1.5rem;
}

.sidebar .nav-link {
    color: var(--text-color-dark);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
}

    .sidebar .nav-link i {
        font-size: 1.25rem;
        margin-right: 1rem;
        min-width: 24px;
        text-align: center;
    }

    .sidebar .nav-link:hover {
        color: var(--primary-color-dark);
        background-color: var(--primary-color-lighter);
    }

    .sidebar .nav-link.active {
        color: var(--primary-color-dark);
        background-color: var(--primary-color-lighter);
        border-left-color: var(--primary-color);
    }

/* 
    FOCUS STYLES IN accessibility.css
    Navigation focus management handled in accessibility.css
    */

.sidebar-logout {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-color-dark);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border-left: 3px solid transparent;
}

    .sidebar-logout i {
        font-size: 1.25rem;
        margin-right: 1rem;
        min-width: 24px;
        text-align: center;
    }

    .sidebar-logout:hover {
        color: var(--primary-color);
        background-color: var(--primary-color-lighter);
    }

/* 
    FOCUS STYLES IN accessibility.css
    Sidebar logout focus management handled in accessibility.css
    */

/* ==========================================
   WELCOME
========================================== */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-light) 100%);
    color: var(--bg-white);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.welcome-text {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* ==========================================
   CARDS
========================================== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.5rem;
}

.card-title {
    color: var(--dark);
    font-weight: 600;
}

/* ==========================================
   AUTHENTICATION LOGO
   (used on registration confirmation message)
========================================== */
.auth-logo {
    text-align: center;
}

.auth-logo-img {
    max-height: 60px;
    max-width: 180px;
    height: auto;
    width: auto;
    margin: 0 auto;
    display: inline-block;
}

/* ==========================================
   AVATAR
========================================== */
.avatar-lg {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* ==========================================
   BACKGROUND - CUSTOM COLOR
========================================== */
.bg-light-primary {
    background-color: var(--primary-color-lighter);
}

/* ==========================================
   TEXT - CUSTOM COLOR
========================================== */
.text-primary {
    color: var(--primary-color) !important;
}

/* ==========================================
   TABS (NAV-TABS)
========================================== */
.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: var(--bg-white);
    border-color: var(--primary-color) var(--primary-color) transparent;
    font-weight: 600;
}

.nav-tabs .nav-link {
    color: var(--text-color-dark);
    background-color: transparent;
    border: 1px solid transparent;
}

    .nav-tabs .nav-link:hover {
        color: var(--primary-color);
        background-color: var(--primary-color-lighter);
        border-color: var(--primary-color-lighter);
    }

/* 
    FOCUS STYLES IN accessibility.css
    Tab focus management handled in accessibility.css
    */

/* ==========================================
   ACCORDION
========================================== */
.accordion-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

    .accordion-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

.accordion-button {
    padding: 1.25rem 1.5rem;
    background-color: var(--bg-white);
    box-shadow: none;
    border-radius: var(--border-radius) !important;
}

    .accordion-button:not(.collapsed) {
        color: var(--primary);
        background-color: var(--primary-color-lighter);
        box-shadow: none;
    }

/* 
    FOCUS STYLES IN accessibility.css
    Accordion focus management handled in accessibility.css
    */

.accordion-body {
    padding: 1.5rem;
    background-color: var(--bg-white);
}

/* ==========================================
   POLICY
========================================== */
.policy-info {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem; /* space between number & date */
}

    .policy-info small {
        font-size: 1rem;
        color: var(--text-color-medium);
        line-height: 1.2;
        margin: 0;
    }

.policy-detail-item {
    padding: 0.5rem;
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        transition: left var(--transition-speed) ease;
        z-index: 1030;
    }

        .sidebar.show {
            left: 0;
        }

    .content {
        margin-left: 0 !important;
    }
}

/* ==========================================
   FORM CONTROLS, SELECTS, CHECKBOXES & LABELS
========================================== */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-color-dark);
}

.form-control {
    border-radius: 8px;
    padding: 0.8rem 1.1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color-light);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

    /* 
    FOCUS STYLES IN accessibility.css
    Form control focus indicators moved to accessibility.css for WCAG compliance
    */


    .form-control::placeholder {
        color: var(--text-color-medium);
        opacity: 0.9;
    }

/* selects */
/* match bootstrap’s form-select to our form-control */
.form-select {
    border-radius: 8px;
    padding: 0.8rem 1.1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color-light);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* 
    FOCUS STYLES IN accessibility.css
    Form select focus indicators moved to accessibility.css for WCAG compliance
    */

/* checkboxes */
.form-check-label {
    color: var(--text-color-dark);
    padding-left: 0.5em;
    font-weight: 500;
}

.form-check-input {
    border-radius: 4px;
    border: 1px solid var(--border-color-light);
    cursor: pointer;
    margin-top: 0.2em;
}

    .form-check-input:checked {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
    }

/* 
    FOCUS STYLES IN accessibility.css
    Checkbox focus indicators moved to accessibility.css for WCAG compliance
    */

/* ==========================================
   TOOLTIPS
========================================== */
.tooltip-left .tooltip-inner {
    text-align: left;
}

/* ==========================================
   SPINNER OVERLAY (MODAL LOADING)
========================================== */
.modal-body-footer-wrap {
    position: relative;
}

.spinner-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* soft white overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1055; /* One above Bootstrap modal-content (z-index: 1050) */
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    color: var(--primary-color);
}

.spinner-text {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--primary-color);
}

/* ==========================================
   BUTTONS
========================================== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .btn-primary:hover {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        filter: brightness(110%);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    /* 
    FOCUS STYLES MOVED TO accessibility.css
    All :focus and :focus-visible styles for buttons are now 
    centralized in accessibility.css for WCAG compliance
    */

    .btn-primary:active {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

.btn-outline-primary {
    background-color: white;
    border-color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

    .btn-outline-primary:hover {
        background-color: var(--primary-color-lighter);
        color: var(--primary-color);
        border-color: var(--primary-color);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* 
    FOCUS STYLES IN accessibility.css
    Button focus indicators moved to accessibility.css for WCAG compliance
    */

    .btn-outline-primary:active {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #fff;
}

    .btn-danger:hover {
        background-color: #dc3545;
        border-color: #dc3545;
        filter: brightness(110%);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    /* 
    FOCUS STYLES IN accessibility.css
    Danger button focus indicators moved to accessibility.css for WCAG compliance
    */

    .btn-danger:active {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

.btn-outline-danger {
    background-color: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .btn-outline-danger:hover {
        background-color: #dc3545;
        color: #fff;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    /* 
    FOCUS STYLES IN accessibility.css
    Outline danger button focus indicators moved to accessibility.css
    */

    .btn-outline-danger:active {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

/* ==========================================
   MODALS
========================================== */

.modal-close-btn {
    border: none;
    background: transparent;
    color: #fff;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
}

.modal-close-btn:hover {
        opacity: 0.85;
    }

/* 
FOCUS STYLES IN accessibility.css
Modal close button focus management handled in accessibility.css
*/

/* ==========================================
   BUTTON LINKS (LINKS THAT LOOK LIKE BUTTONS)
========================================== */

.btn-link-primary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .btn-link-primary:hover {
        background-color: var(--primary-color); /* <-- add this */
        filter: brightness(110%);
        color: #fff;
        text-decoration: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    /* 
    FOCUS STYLES IN accessibility.css
    Button link focus indicators moved to accessibility.css for WCAG compliance
    */

    .btn-link-primary:active {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

.btn-link-outline-primary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    background-color: #fff;
    border: 1px solid var(--primary-color);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    color: var(--primary-color);
    cursor: pointer;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

    .btn-link-outline-primary:hover {
        background-color: var(--primary-color-lighter);
        text-decoration: none;
        color: var(--primary-color);
        border-color: var(--primary-color);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* 
    FOCUS STYLES IN accessibility.css
    Button link outline focus indicators moved to accessibility.css
    */

    .btn-link-outline-primary:active {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

.btn-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 0.5rem;
}

/* 
FOCUS STYLES IN accessibility.css
Square button focus indicators moved to accessibility.css
*/

/* ==========================================
   PRIMARY LINKS
========================================== */
.theme-link-primary {
    color: var(--link-color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: text-decoration 0.2s ease, color 0.2s ease;
}

    .theme-link-primary:hover,
    .theme-link-primary:focus {
        text-decoration: underline;
        text-underline-offset: 2px;
    }

/* Action Link Style */
.theme-link-action {
    color: var(--link-color-action);
    text-decoration: none;
    font-weight: 500;
    transition: filter 0.2s ease, font-weight 0.2s ease;
}

    .theme-link-action:hover,
    .theme-link-action:focus {
        filter: contrast(115%);
        font-weight: 600;
    }

/* 
FOCUS STYLES IN accessibility.css
Link focus indicators enhanced in accessibility.css for WCAG compliance
*/

/* ==========================================
   LAYOUT CONTAINER
========================================== */
.layout-body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main layout section under header */
.layout-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Content + footer area next to sidebar */
.layout-content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Scrollable content */
.layout-content {
    flex: 1;
    transition: margin-left var(--transition-speed) ease;
    overflow-y: auto;
}

/* Footer */
.footer {
    min-height: var(--footer-height);
    background-color: var(--bg-white);
    flex-shrink: 0;
    padding: 1.5rem;
}
