/* =============================================================
   HSO Dashboard Component
   Shared dark-card dashboard styles.
   Use on pages adopting the EFB-style dark layout.
   ============================================================= */

/* ---------------------------------------------------------------
   Outer card shell
   --------------------------------------------------------------- */
.hso-dash-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--hso-border-radius);
    background: #0b1927;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.18);
}

.hso-parent-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--hso-border-radius);
    background: rgba(11, 25, 39, 0.92);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.18);
}

/* ---------------------------------------------------------------
   Card header
   --------------------------------------------------------------- */
.hso-dash-card-header {
    background: transparent;
    border-bottom: 1px solid var(--hso-secondary-color, #b68b05);
    /*border-radius: 1rem 1rem 0 0 !important;*/
    padding: 0.85rem 1.25rem;
}

.hso-dash-card-title {
    color: var(--hso-secondary-color, #b68b05);
    font-weight: 600;
    margin-bottom: 0;
}

/* ---------------------------------------------------------------
   Card body
   --------------------------------------------------------------- */
.hso-dash-card-body {
    background-color: var(--hso-primary-color, #323f4f);
    /*border-radius: 0 0 1rem 1rem;*/
    color: var(--hso-primary-text-color, #ebebeb);
}

/* ---------------------------------------------------------------
   Typography helpers
   --------------------------------------------------------------- */
.hso-dash-muted {
    color: rgba(235, 235, 235, 0.72) !important;
}

.hso-dash-section-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.hso-dash-section-desc {
    color: rgba(235, 235, 235, 0.65);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.hso-dash-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.hso-dash-stat-label {
    color: rgba(235, 235, 235, 0.75);
    font-size: 0.875rem;
}

/* ---------------------------------------------------------------
   Form label
   --------------------------------------------------------------- */
.hso-dash-form-label {
    color: rgba(235, 235, 235, 0.88);
    font-weight: 500;
    margin-bottom: 0.35rem;
}

/* ---------------------------------------------------------------
   Form controls — scoped to card body so modals stay light
   --------------------------------------------------------------- */
.hso-dash-card-body .form-control,
.hso-dash-card-body .form-select {
    /*background-color: rgba(255, 255, 255, 0.07);*/
    border-color: rgba(255, 255, 255, 0.18);
    /*color: #ebebeb;*/
}

.hso-dash-card-body .form-control:focus,
.hso-dash-card-body .form-select:focus {
    /*background-color: rgba(255, 255, 255, 0.11);*/
    border-color: var(--hso-secondary-color, #b68b05);
    box-shadow: 0 0 0 0.2rem rgba(182, 139, 5, 0.25);
    color: #000;
}

    .hso-dash-card-body .form-control::placeholder {
        color: #5c6a7b;
    }

.hso-dash-card-body .form-control[readonly] {
    background-color: #ebebeb;
    /*color: rgba(235, 235, 235, 0.65);*/
}

.hso-dash-card-body .input-group-text {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(235, 235, 235, 0.8);
    border-radius: .15rem;
}

.hso-dash-card-body .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(235, 235, 235, 0.8);
}

.hso-dash-card-body .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* Toggle switches */
.hso-dash-card-body .form-check-input {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.hso-dash-card-body .form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

/* ---------------------------------------------------------------
   Setting toggle row
   --------------------------------------------------------------- */
.hso-dash-setting-row {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 1rem;
    margin-bottom: .25rem;
    margin-top: .25rem;
}

.site-directory-assign-sites-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 0.9rem 0;
    margin-top: 0.5rem;
    background: linear-gradient(180deg, rgba(50, 63, 79, 0) 0%, rgba(50, 63, 79, 0.92) 22%, rgba(50, 63, 79, 1) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------------------------------------------------------------
   Progress bar
   --------------------------------------------------------------- */
.hso-dash-card-body .progress {
    height: 1.5rem;
    /*border-radius: 0.375rem;*/
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
}

.hso-dash-card-body .progress-bar {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ---------------------------------------------------------------
   List group items on dark background
   --------------------------------------------------------------- */
.hso-dash-card-body .list-group-item {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.08);
    color: #ebebeb;
}

/* ---------------------------------------------------------------
   Table helpers
   Canonical pattern:
     <table class="table table-sm hso-dash-table">
       <thead class="hso-table-header">...</thead>
       <tbody class="hso-table-body">...</tbody>
     </table>
   --------------------------------------------------------------- */

/* thead — gold, uppercase, vertically centred */
.hso-table-header {
    text-transform: uppercase;
    color: var(--hso-secondary-color, #b68b05);
    vertical-align: middle;
    border-bottom: 1px solid rgba(182, 139, 5, 0.35);
}

.hso-table-header th {
    background-color: transparent;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.hso-dash-table.els-table-sticky-header thead th {
    position: sticky;
    top: var(--els-table-sticky-header-top, 0px);
    z-index: 2;
    background-color: var(--hso-primary-color, #323f4f);
    box-shadow: inset 0 -1px 0 rgba(182, 139, 5, 0.35);
}

.els-table-sticky-filter {
    position: sticky;
    top: var(--els-table-sticky-filter-top, 0px);
    z-index: 3;
    background-color: var(--hso-primary-color, #323f4f);
    padding-top: 0.1rem;
    padding-bottom: 0.4rem;
}

.els-table-scroll-container {
    max-height: var(--els-table-scroll-max-height, 24rem);
    overflow-y: auto;
    overflow-x: auto;
}

/* tbody — light text on dark card body */
.hso-table-body {
    color: var(--hso-primary-text-color, #ebebeb);
}

.hso-table-body tr {
    border-color: rgba(255, 255, 255, 0.06);
}

/* Row hover */
.hso-dash-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--hso-primary-text-color, #ebebeb);
}

/* Cell alignment and spacing */
.hso-dash-table td,
.hso-dash-table th {
    vertical-align: middle;
}

/* Name / meta cell pattern */
.hso-dash-item-name {
    color: #fff;
    font-weight: 500;
}

.hso-dash-item-meta {
    color: rgba(235, 235, 235, 0.68);
    font-size: 0.85rem;
}

/* ---------------------------------------------------------------
   Dropzone — file-upload drag target
   --------------------------------------------------------------- */
.hso-dash-dropzone {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
}

/* ---------------------------------------------------------------
   Empty state placeholder
   --------------------------------------------------------------- */
.hso-dash-empty-state {
    border: 1px dashed rgba(255, 255, 255, 0.14);
    /*border-radius: 0.75rem;*/
    padding: 2.5rem 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    color: rgba(235, 235, 235, 0.75);
}

/* ---------------------------------------------------------------
   Autocomplete dropdown on dark background
   --------------------------------------------------------------- */
.hso-dash-dropdown {
    background-color: #1e2d3d;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.hso-dash-dropdown .list-group-item {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.06);
    color: #ebebeb;
    cursor: pointer;
}

.hso-dash-dropdown .list-group-item:hover,
.hso-dash-dropdown .list-group-item:focus {
    background-color: rgba(182, 139, 5, 0.2);
    color: #fff;
}

/* ---------------------------------------------------------------
   Modal overrides — add .hso-dash-modal to the .modal element
   --------------------------------------------------------------- */
.hso-dash-modal .modal-content {
    border: none;
    border-radius: 0;
}

.hso-dash-modal .modal-header {
    border-bottom: 2px solid #e9ecef;
    background-color: #f8f9fa;
}

.hso-dash-modal .modal-footer {
    border-top: 2px solid #e9ecef;
    background-color: #f8f9fa;
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 768px) {
    .hso-dash-card {
        /*border-radius: 0.5rem;*/
    }

    .hso-dash-card-header {
        /*border-radius: 0.5rem 0.5rem 0 0 !important;*/
    }
}

/* ---------------------------------------------------------------
   Settings sidebar navigation layout
   --------------------------------------------------------------- */
.settings-layout {
    align-items: stretch;
}

.settings-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-sidebar-header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-nav {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.settings-nav-item,
.settings-nav-item-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: rgba(235, 235, 235, 0.72);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-left-color 0.15s ease;
    font-size: 0.9375rem;
}

.settings-nav-item:hover,
.settings-nav-item-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(182, 139, 5, 0.35);
}

.settings-nav-item.active,
.settings-nav-item-link.active {
    color: var(--hso-secondary-color, #b68b05);
    background: rgba(182, 139, 5, 0.1);
    border-left-color: var(--hso-secondary-color, #b68b05);
    font-weight: 600;
}

.settings-content {
    min-height: 540px;
    padding: 2rem;
}

.hso-nav-section-title {
    color: var(--hso-secondary-color, #b68b05);
}

.hso-nav-toggle-btn {
    background: transparent;
    border: none;
    color: rgba(235, 235, 235, 0.45);
    padding: 0 0.6rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

    .hso-nav-toggle-btn:hover {
        color: rgba(235, 235, 235, 0.9);
    }

.hso-nav-chevron {
    font-size: 0.68rem;
    transition: transform 0.2s ease;
}

.hso-nav-toggle-btn[aria-expanded="true"] .hso-nav-chevron {
    transform: rotate(180deg);
}

.settings-nav-item-child {
    padding-left: 2.25rem;
}

@media (max-width: 991px) {
    .settings-layout {
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .settings-sidebar-header {
        display: none;
    }

    .settings-nav {
        display: flex;
        overflow-x: auto;
        gap: 0.125rem;
        padding: 0.375rem 0.5rem;
        white-space: nowrap;
    }

    .settings-nav li {
        flex-shrink: 0;
    }

    .settings-nav-item,
    .settings-nav-item-link {
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 0.375rem 0.375rem 0 0;
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .settings-nav-item.active,
    .settings-nav-item-link.active {
        border-left-color: transparent;
        border-bottom-color: var(--hso-secondary-color, #b68b05);
    }

    .settings-nav-item:hover,
    .settings-nav-item-link:hover {
        border-left-color: transparent;
    }

    .settings-content {
        padding: 1.25rem;
        min-height: auto;
    }
}

/* ---------------------------------------------------------------
   Index Page Flex Wrapper (fills viewport)
   --------------------------------------------------------------- */
.hso-index-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 85px); /* Subtract header and footer height */
}

/* ---------------------------------------------------------------
   Hero Section (Index/Landing Page)
   --------------------------------------------------------------- */
.hso-hero-section {
    position: relative;
    min-height: max(350px, 35vh);
    background-image: url('/images/hso_helicopter.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    padding: 2.5rem 0;
    flex-shrink: 0;
}

.hso-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(11, 25, 39, 0.7), rgba(11, 25, 39, 0.85));
    z-index: 1;
}

.hso-hero-section .container {
    position: relative;
    z-index: 2;
}

.hso-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--hso-secondary-color, #b68b05);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    margin-bottom: 5rem;
    line-height: 1.2;
}

.hso-hero-text {
    font-size: 1.25rem;
    color: var(--hso-primary-text-color, #ebebeb);
    line-height: 1.6;
    margin-bottom: 0;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* ---------------------------------------------------------------
   Search Section (Index/Landing Page)
   --------------------------------------------------------------- */
.hso-search-section {
    background-color: var(--hso-primary-dark-color, #0b1927);
    padding: 2rem 0;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------
   Feature Cards Section (Index/Landing Page)
   --------------------------------------------------------------- */
.hso-features-section {
    background-color: var(--hso-primary-dark-color, #0b1927);
    padding: 1.5rem 0 2.5rem 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

/* ---------------------------------------------------------------
   Feature Cards (Index/Landing Page)
   --------------------------------------------------------------- */
.hso-feature-card {
    background-color: var(--hso-primary-color, #323f4f);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--hso-border-radius);
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hso-feature-card:hover {
    background-color: rgba(50, 63, 79, 0.8);
    border-color: var(--hso-secondary-color, #b68b05);
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.hso-feature-icon {
    width: 70px;
    height: 70px;
    background-color: rgba(182, 139, 5, 0.15);
    border: 2px solid var(--hso-secondary-color, #b68b05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    font-size: 2rem;
}

.hso-feature-card:hover .hso-feature-icon {
    background-color: var(--hso-secondary-color, #b68b05);
    transform: scale(1.1);
}

.hso-feature-icon i {
    font-size: 1.75rem;
    color: var(--hso-secondary-color, #b68b05);
    transition: color 0.3s ease;
}

.hso-feature-card:hover .hso-feature-icon i {
    color: #000;
}

.hso-feature-title {
    color: var(--hso-secondary-color, #b68b05);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.hso-feature-desc {
    color: var(--hso-primary-text-color, #ebebeb);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* ---------------------------------------------------------------
   Hero & Feature Card Responsive
   --------------------------------------------------------------- */
@media (max-width: 991px) {
    .hso-index-wrapper {
        min-height: auto;
    }

    .hso-features-section {
        flex-grow: 0;
    }

    .hso-hero-section {
        min-height: max(320px, 30vh);
        padding: 2rem 0;
    }

    .hso-hero-title {
        font-size: 2.5rem;
        letter-spacing: 0.1em;
        margin-bottom: 1.5rem;
    }

    .hso-hero-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 767px) {
    .hso-hero-section {
        min-height: 280px;
        padding: 1.5rem 0;
    }

    .hso-hero-title {
        font-size: 2rem;
        letter-spacing: 0.08em;
        margin-bottom: 1rem;
    }

    .hso-hero-text {
        font-size: 1rem;
    }

    .hso-feature-card {
        padding: 1.25rem 1rem;
    }

    .hso-feature-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 0.75rem;
    }

    .hso-feature-icon i {
        font-size: 1.5rem;
    }

    .hso-feature-title {
        font-size: 0.9375rem;
    }

    .hso-feature-desc {
        font-size: 0.8125rem;
    }
}

/* ---------------------------------------------------------------
   Shared KPI Strip Component
   Reusable styles for Dashboard and Site Directory KPI strips.
   --------------------------------------------------------------- */
.hso-kpi-stat {
    padding: 1rem;
    min-width: 0;
}

.hso-kpi-stat + .hso-kpi-stat {
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.hso-kpi-alert {
    color: tomato !important;
}

.kpi-customize-panel {
    background-color: rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.kpi-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--hso-border-radius, 2px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--hso-primary-text-color, #ebebeb);
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.kpi-toggle-label:has(input:checked) {
    border-color: var(--hso-secondary-color, #b68b05);
    color: var(--hso-secondary-color, #b68b05);
}

.kpi-toggle-label input {
    display: none;
}

.hso-kpi-stat[draggable="true"] {
    cursor: grab;
    position: relative;
}

.hso-kpi-stat[draggable="true"]:active {
    cursor: grabbing;
}

.kpi-drag-handle {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.6rem;
    opacity: 0.3;
    pointer-events: none;
}

.hso-kpi-stat[draggable="true"]:hover .kpi-drag-handle {
    opacity: 0.7;
}

.hso-kpi-stat.kpi-dragging {
    opacity: 0.4;
}

.hso-kpi-stat.kpi-drag-over {
    outline: 1px dashed var(--hso-secondary-color, #b68b05);
    outline-offset: -2px;
}

/* Mobile KPI strip tweaks */
@media (max-width: 575.98px) {
    .hso-kpi-stat {
        padding: 0.5rem 0.25rem;
    }

    .hso-dash-stat-value {
        font-size: 1.1rem;
    }

    .hso-dash-stat-label {
        font-size: 0.7rem;
    }
}

