:root {
    --right-panel-width: 50vw;
    --bulma-navbar-height: 52px;
    --left-panel-width: 15vw;
    --bulma-background-color: hsl(216, 14%, 14%);
}

[hidden],
.report-toggle,
.tab-content .tab-pane {
    display: none;
}

.tab-content .tab-pane.is-active {
    display: block;
}

.container {
    position: relative;
}

.custom-filters-column,
.custom-map-column,
.custom-table-column {
    min-height: 100%;
    transition: transform 0.3s ease;
    z-index: 3;
    box-sizing: border-box;
}

.mapboxgl-ctrl-top-left,
.mapboxgl-ctrl-bottom-left {
    left: var(--left-panel-width);
    transition: left 0.3s ease;
}

.custom-filters-column {
    width: var(--left-panel-width);
    padding: 1rem;
    position: fixed;
    top: var(--bulma-navbar-height);
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.custom-filters-column.collapsed,
.custom-table-column.collapsed,
.custom-filters-column.open,
.custom-table-column.open {
    /* Raise the layer of the hidden panel so that the
    expand button is clickable */
    z-index: 4;
}

.custom-filters-column.collapsed {
    transform: translateX(-100%);
}

.custom-filters-column.open {
    transform: translateX(0);
}

/* Lasso tool styles */
.mapboxgl-ctrl-lasso {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/><path d="M12 8v8M8 12h8"/></svg>');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 70%;
    cursor: pointer;
}

.mapboxgl-ctrl-lasso:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.custom-table-column.collapsed {
    transform: translateX(100%);
}

.custom-table-column.open {
    transform: translateX(0);
}

.custom-map-column {
    width: 100vw;
    height: 100%;
}

.mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-bottom-right {
    right: var(--right-panel-width);
    transition: right 0.3s ease;
}

.custom-table-column {
    width: var(--right-panel-width);
    position: fixed;
    top: var(--bulma-navbar-height);
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    transition: transform 0.3s ease;
}

/* Add a little padding to the inside of the right panel */
.custom-table-column > p,
.custom-table-column > div,
.custom-table-column > h3 {
    padding: 0 1rem;
}

.collapse-btn {
    position: absolute;
    z-index: 4;
    background: #363636;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.left-collapse-btn {
    right: -15px;
    top: 10px;
}

.right-collapse-btn {
    left: -15px;
    top: 10px;
}

.custom-filters-column-collapsed .mapboxgl-ctrl-top-left,
.custom-filters-column-collapsed .mapboxgl-ctrl-bottom-left {
    left: 0;
}

.custom-filters-column-open .mapboxgl-ctrl-top-left,
.custom-filters-column-open .mapboxgl-ctrl-bottom-left {
    left: var(--left-panel-width);
}

.custom-table-column-collapsed .mapboxgl-ctrl-top-right,
.custom-table-column-collapsed .mapboxgl-ctrl-bottom-right {
    right: 0;
}

.custom-table-column-open .mapboxgl-ctrl-top-right,
.custom-table-column-open .mapboxgl-ctrl-bottom-right {
    right: var(--right-panel-width);
}

.map-container {
    width: 100%;
    height: calc(100vh - var(--bulma-navbar-height));
    padding-bottom: 1rem;
}

/* Position the draw controls 10% from the top */
.mapboxgl-ctrl-top-right {
    top: 10% !important;
}

.mapboxgl-ctrl-bottom-right,
.mapboxgl-ctrl-top-right {
    padding-right: 1rem;
}

.legend {
    position: absolute;
    top: var(--bulma-navbar-height);
    border-radius: 4px;
    z-index: 2;
    transition: left 0.3s ease;
    overflow-y: auto;
    max-height: 100vh;
    background-color: rgba(255, 255, 255, 0.75);
}

.custom-filters-column + .legend {
    left: calc(var(--left-panel-width) + 2rem);
}
.custom-filters-column.collapsed + .legend {
    left: 2rem;
}
.custom-filters-column.open + .legend {
    left: calc(var(--left-panel-width) + 2rem);
}

.legend ul, .legend h4 {
    padding: 10px;
}

.legend h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
}

/* Give tables a max height and make them scrollable */
.customer-reports .table-container {
    max-height: 300px; 
    overflow-y: auto;
}

/* Global Toast System */
#global-toast-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem;
}

#global-toast-container .notification {
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

@keyframes toast-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Multiselect Styles */
.multiselect {
    position: relative;
    width: 100%;
}

.select-box {
    position: relative;
}

.overSelect {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

.checkboxes {
    position: absolute;
    max-height: 200px;
    background-color: var(--bulma-background-color);
    overflow-y: auto;
    z-index: 999;
    width: 100%;
    display: none;
}

.checkboxes label {
    display: block;
    padding: 0.5rem;
}

/* Filter Container Styles */
.filter-container {
    position: relative;
}

.farm-field-addons {
    margin-bottom: 0;
}

.filter-info-icon {
    cursor: help;
    align-self: center;
}

@keyframes toast-fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

.toast-fade-in {
    animation: toast-fade-in 0.3s;
}

.toast-fade-out {
    animation: toast-fade-out 0.3s;
}

/* Filter Loading States */
.disabled-filter {
    pointer-events: none;
    opacity: 0.6;
    cursor: not-allowed;
}

.filter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 10;
    cursor: not-allowed;
}

select[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

input[type="checkbox"][disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Instant Tooltip Styles */
.instant-tooltip {
    position: relative;
}

.instant-tooltip::before,
.instant-tooltip::after {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
}

.instant-tooltip::before {
    content: attr(data-tooltip);
    background-color: #363636;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    z-index: 1000;
}

.instant-tooltip::after {
    content: '';
    border: 6px solid transparent;
    border-right-color: #363636;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 2px;
    z-index: 1000;
}

.instant-tooltip:hover::before,
.instant-tooltip:hover::after {
    opacity: 1;
}

/* JD Auth Page Styles */
.jd-auth .container {
    max-width: 90%;
    margin: 0 auto;
    padding-bottom: 2vh;
}

.jd-auth-header {
    padding: 2vh 0 2vh 1vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jd-auth-header .title {
    margin-bottom: 0;
}

.jd-auth-org-count {
    margin-right: 1vw;
}

.jd-auth .columns {
    padding: 1%;
    align-items: flex-start;
}

.jd-auth-column .box .notification {
    margin-top: auto;
}

.jd-auth-results-container {
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #dbdbdb;
    border-radius: 0.25rem;
}

.jd-auth-results-container thead {
    position: sticky;
    top: 0;
    background-color: #1f2329;
    z-index: 1;
}

.jd-auth-results-container thead th {
    color: white;
}

.jd-auth-button-container-bottom {
    margin-top: 2%;
}

.jd-auth-check-button {
    transition: box-shadow 0.1s ease, transform 0.1s ease;
}

button.jd-auth-check-button:active {
    box-shadow: none;
    transform: translateY(1px);
}

/* JD Auth Visual Guide Images */
.jd-auth .image img {
    width: auto;
    max-width: 100%;
    height: auto;
}

.jd-auth .image img.stretch-to-fit {
    width: 100%;
}

.jd-auth .image img.partner {
    max-width: 40%;
}

.jd-auth .image img.login {
    max-width: 10%;
}
  

@media screen and (max-width: 768px) {
    :root {
        --right-panel-width: 100vw;
        --left-panel-width: 100vw;
    }

    /* On mobile stagger the buttons so they don't overlap */
    .right-collapse-btn {
        top: 70px;
    }

    /* On mobile, don't move the legend when the filters are collapsed
    just let it sit underneath */
    .custom-filters-column + .legend {
        left: 2rem;
    }
}

/* Seed Mapping Page Styles */

/* Yellow Dot Indicator for Navigation */
.yellow-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ffc107;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Sub-Tab Content */
.seed-mapping .tab-content.is-hidden {
    display: none;
}

/* Selected Varieties Display */
.seed-mapping .notification code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.9em;
}

/* AG Grid Height Fix */
#active-mappings-grid .ag-root-wrapper,
#active-mappings-grid .ag-root-wrapper-body,
#active-mappings-grid .ag-root,
#active-mappings-grid .ag-body-viewport {
    height: 100% !important;
}

#unmapped-varieties-grid .ag-root-wrapper,
#unmapped-varieties-grid .ag-root-wrapper-body,
#unmapped-varieties-grid .ag-root,
#unmapped-varieties-grid .ag-body-viewport {
    height: 100% !important;
}

/* Reports Page Grid Heights */
#soil-acres-grid {
    height: 200px;
}

#seeding-harvest-grid,
#seed-selector-grid,
#qa-grid,
#benchmark-grid,
#recently-loaded-seeding-grid,
#recently-loaded-harvest-grid {
    height: 400px;
}

/* Variety Naming Page Styles */
#varieties-grid.ag-theme-alpine .unmapped-row {
    background-color: #fffde7;
}

[data-ag-theme-mode="dark"] #varieties-grid.ag-theme-alpine .unmapped-row {
    background-color: #3d3d00;
}

