﻿/* ==========================================================================
   Base Styles
   ========================================================================== */

html {
    font-size: 14px;
    height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    margin: 0;
}

/* ==========================================================================
Layout
========================================================================== */

/* Main content grows to push footer down */
main,
.container-fluid > main,
body > .container-fluid {
    flex: 1 0 auto;
}

/* Footer stays at bottom */
footer,
.global-footer {
    flex-shrink: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.custom-dropdown {
    height: 30px;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 3px;
    box-sizing: border-box;
    min-width: 180px;
}

.api-input {
    height: 30px !important;
    padding: 5px 10px !important;
    min-width: 128px !important;
}

#api_error {
    color: red;
    font-size: 0.8em;
}

/* ==========================================================================
   Header & Branding
   ========================================================================== */

.branding,
.branding .header-row {
    display: flex;
    align-items: center;
}

.branding .header-cagov-logo,
.branding .header-organization {
    display: flex;
    align-items: center;
    height: 100%;
}

.branding .header-cagov-logo a,
.branding .header-organization a {
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.header-logo,
.branding .header-cagov-logo img,
.branding .header-organization img {
    display: block;
    max-height: 80px;
    width: auto;
    object-fit: contain;
    margin: 0;
    line-height: 1;
    vertical-align: middle;
}

/* ==========================================================================
   Navigation - Megamenu
   ========================================================================== */

#mainMenuBar .accessible-megamenu,
#mainMenuBar .accessible-megamenu .accessible-megamenu-top-nav-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

#mainMenuBar .accessible-megamenu > .accessible-megamenu-top-nav-item > a,
#mainMenuBar .accessible-megamenu > .accessible-megamenu-top-nav-item > h2,
#mainMenuBar .accessible-megamenu > .accessible-megamenu-top-nav-item > h2 > a {
    display: block;
    height: 3.077em;
    line-height: 3.077em;
    padding-left: 0.769em;
    padding-right: 0.769em;
    color: #fff !important;
    text-decoration: none;
    vertical-align: middle;
    margin: 0;
}

#mainMenuBar .accessible-megamenu h2 {
    margin: 0;
    font-size: 1em;
    font-weight: bold;
    display: block;
}

#mainMenuBar .megamenu-home-link .ca-gov-icon-home,
#mainMenuBar .megamenu-home-link svg {
    display: inline-block;
    vertical-align: middle;
    line-height: 3.077em;
    font-size: 28.5px;
    position: relative;
    top: 0;
    color: inherit;
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

@media (max-width: 575px) {
    .branding {
        height: 84px;
        padding: 8px 12px;
        box-sizing: border-box;
    }

    .branding .header-row {
        align-items: center;
        position: relative;
        min-height: 56px;
    }

    .header-cagov-logo {
        display: none !important;
    }

    .header-organization {
        margin: 0 auto;
        text-align: center;
        display: block;
    }

    .header-cagov-logo img,
    .header-organization img,
    .header-logo {
        max-height: 56px;
        width: auto;
        object-fit: contain;
    }

    .global-header,
    #header2 {
        position: relative;
    }

    #mainMenuBar .accessible-megamenu-toggle {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 200;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 6px;
        background: transparent;
        border: 0;
        cursor: pointer;
        pointer-events: auto;
    }

    #mainMenuBar .accessible-megamenu-toggle > span:not(.sr-only) {
        display: block;
        width: 26px;
        height: 3px;
        background: #fff;
        margin: 3px 0;
        border-radius: 2px;
    }

    #mainMenuBar .accessible-megamenu {
        display: none;
        width: 100%;
        background: transparent;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    #mainMenuBar.mobile-open .accessible-megamenu {
        display: block;
        background: transparent;
        padding-top: 8px;
    }

    #mainMenuBar .accessible-megamenu > li,
    #mainMenuBar .accessible-megamenu > .accessible-megamenu-top-nav-item {
        display: block;
        width: 100%;
    }

    #mainMenuBar .accessible-megamenu > li > a,
    #mainMenuBar .accessible-megamenu > li > h2 > a {
        display: flex;
        align-items: center;
        height: 56px;
        padding: 0 16px;
        color: #fff !important;
        font-weight: 700;
        text-decoration: none;
        border-top: 1px solid rgba(255, 255, 255, 0.04);
        box-sizing: border-box;
    }

    #mainMenuBar .megamenu-home-link {
        display: none;
    }

    #mainMenuBar.mobile-open .megamenu-home-link {
        display: block;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
    color: #333;
    background-color: #eeac35;
    border-color: #eb9e14;
}

.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.btn-default.focus,
.btn-default:focus {
    color: #333;
    background-color: #e6e6e6;
    border-color: #8c8c8c;
}

.btn-default:hover {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}

.btn-default.active,
.btn-default:active,
.open > .dropdown-toggle.btn-default {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
    background-image: none;
}

.btn-default.active.focus,
.btn-default.active:focus,
.btn-default.active:hover,
.btn-default:active.focus,
.btn-default:active:focus,
.btn-default:active:hover,
.open > .dropdown-toggle.btn-default.focus,
.open > .dropdown-toggle.btn-default:focus,
.open > .dropdown-toggle.btn-default:hover {
    color: #333;
    background-color: #d4d4d4;
    border-color: #8c8c8c;
}

.btn-default.disabled.focus,
.btn-default.disabled:focus,
.btn-default.disabled:hover,
.btn-default[disabled].focus,
.btn-default[disabled]:focus,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default.focus,
fieldset[disabled] .btn-default:focus,
fieldset[disabled] .btn-default:hover {
    background-color: #fff;
    border-color: #ccc;
}

/* ==========================================================================
   DataTables
   ========================================================================== */

#dt-length-0 {
    font-size: 12px !important;
}

table.dataTable > tbody > tr.child {
    padding: 0.5em 1em !important;
}

table.dataTable > tbody > tr.child td.child {
    padding-left: 30px !important;
}

table.dataTable td.wrap,
table.dataTable th.wrap {
    white-space: normal !important;
    word-wrap: break-word;
}

/* DataTables Pagination */
.dt-paging .pagination .page-link {
    font-size: 14px !important;
}

.dt-paging .pagination .page-item:not(.disabled) .page-link {
    color: #337ab7 !important;
}

.dt-paging .pagination .page-item.active .page-link {
    background-color: #337ab7 !important;
    color: #fff !important;
}

/* DataTables Responsive Controls */
table.dataTable.dtr-column > tbody > tr > td.dtr-control,
table.dataTable.dtr-column > tbody > tr > th.dtr-control,
table.dataTable.dtr-column > tbody > tr > td.control,
table.dataTable.dtr-column > tbody > tr > th.control {
    position: relative;
    padding-left: 30px;
}

table.dataTable.dtr-column > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-column > tbody > tr > th.dtr-control:before,
table.dataTable.dtr-column > tbody > tr > td.control:before,
table.dataTable.dtr-column > tbody > tr > th.control:before {
    content: "+";
    background-color: #337ab7;
    top: 9px;
    left: 4px;
    height: 14px;
    width: 14px;
    display: block;
    position: absolute;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 14px;
    box-shadow: 0 0 3px #444;
    box-sizing: content-box;
    text-align: center;
    line-height: 14px;
    font-family: "Courier New", Courier, monospace;
}

table.dataTable.dtr-column > tbody > tr.dtr-expanded td.dtr-control:before,
table.dataTable.dtr-column > tbody > tr.dtr-expanded th.dtr-control:before,
table.dataTable.dtr-column > tbody > tr.dtr-expanded td.control:before,
table.dataTable.dtr-column > tbody > tr.dtr-expanded th.control:before {
    content: "−" !important;
    background-color: #d33333 !important;
    line-height: 14px !important;
    border: 2px solid #fff !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.global-footer .hidden-print li a {
    display: block;
    background-color: inherit;
    color: #fff;
    padding: 6px 10px;
    text-decoration: none;
}

/* ==========================================================================
   Components
   ========================================================================== */

.page-header {
    margin-top: 5px !important;
    margin-bottom: 0 !important;
    font-weight: normal;
    font-size: 22px;
}

.card-header-custom {
    background-color: #5a7797;
    border-color: #d4d4d4;
    color: white;
}

/* ============================================================
   Tab Fixes
   ============================================================ */

/* Ensure tab panes are hidden by default */
.tab-content > .tab-pane {
    display: none;
}

    /* Show active tab pane */
    .tab-content > .tab-pane.active {
        display: block !important;
    }

/* Smooth fade transition for tab switching */
.tab-content > .fade {
    transition: opacity 0.15s linear;
}

.tab-content > .fade:not(.show) {
    opacity: 0;
}

.tab-content > .fade.show {
    opacity: 1;
}

/* ============================================================
   Well Report Tables Styling
   ============================================================ */

/* Report table base styling */
.report-table {
    font-size: 0.7em;
    border: 1px solid #dee2e6;
}

/* Report table header styling */
.report-table thead {
    background-color: transparent;
    border-bottom: 2px solid #dee2e6;
}

/* Report table header cells */
.report-table thead th {
    border: 1px solid #dee2e6;
}

/* Report table body cells */
.report-table tbody td {
    border: 1px solid #dee2e6;
}

#wellDetailsTabs .nav-link {
    font-size: 21px;
    font-stretch: condensed;
}

/* Non-active tab header color */
#wellDetailsTabs .nav-link:not(.active) {
    color: #337ab7;
}

.custom-dropdown {
    padding-right: 2.5rem !important; /* Reserve space for the arrow */
    text-overflow: clip;
    white-space: nowrap;
    overflow: hidden;
}

/* Ensure the dropdown arrow/chevron has proper spacing */
.form-select {
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}