/**
 * Filename: style.css
 * Author: Juan-Marcel Campos
 * Created: 2025-12-16
 * Description: Runs the style for the Aerial Imagery html
 */

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    min-width: 500px;
    font-family: 'Futura', sans-serif;
    font-size: 0.9em;
    font-weight: 300;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column; /* Stacks header, main, and footer vertically */
}

/* Override ESRI widget fonts */
.esri-ui,
.esri-widget,
.esri-legend__layer-caption,
.esri-legend__layer-labels {
    font-family: 'Futura', sans-serif !important;
    font-size: 0.95em;
    font-weight: 300;
}

/* Feature highlight style */
.esri-feature-highlight {
    fill: rgba(255, 255, 0, 0.5);
    stroke: yellow;
    stroke-width: 2px;
}

/* Header styles */
#header {
    background-color: #002f47;
    color: white;
    padding: 5px 20px;
    font-size: 1.2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

    #header .logo-group {
        display: flex;
        align-items: center;
    }

        #header .logo-group img {
            width: 60px;
            height: auto;
        }

        #header .logo-group > div,
        #header .header-text {
            display: flex;
            flex-direction: column;
            justify-content: center;
            margin-left: 10px;
        }

    #header h1 {
        margin: 0;
        font-size: 1.6em;
        margin-left: 10px;
    }

    #header h2 {
        margin: 0;
        color: #25b5af;
        font-weight: 700;
        font-size: 1.0em;
        margin-left: 10px;
    }


.spacer {
    flex-grow: 1; /* Pushes the icon to the right */
}

#info-icon {
    margin-right: 20px; /* Adjust spacing as needed */
}

/* Main layout */
#main-container {
    flex: 1;
    min-width: 400px;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Sidebar menu */
#menu {
    width: 300px;
    min-width: 200px; /* Prevents collapsing too much */
    background-color: #ffffff;
    padding: 10px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 9;
    flex-shrink: 0;
    border-right: 2px solid #00619B;
}

    #menu h2 {
        margin-top: 0;
        color: #333;
        border-bottom: 1px solid #ddd;
        padding-bottom: 10px;
        margin-bottom: 30px;
        font-family: Futura, serif;
        font-size: 1.5em;
    }

    #menu h3 {
        margin-top: 0;
        color: #000000;
        border-bottom: 1px solid #ddd;
        padding-bottom: 2px;
        margin-bottom: 10px;
        font-family: Futura, serif;
        font-size: 1.0em;
        font-weight: 275 !important;
    }

    #menu ul {
        list-style: none;
        padding: 0;
        margin-bottom: 5px;
        font-family: Futura, serif;
        font-size: 1.0em;
    }

        #menu ul li {
            margin-bottom: 10px;
        }

            #menu ul li a {
                text-decoration: none;
                color: #808080;
                display: block;
                padding: 4px 0;
                transition: background-color 0.2s ease;
            }

                #menu ul li a:hover {
                    background-color: #e0e0e0;
                    border-radius: 4px;
                }

/* Dropdown wrapper to match sidebar width */
.calcite-dropdown-wrapper {
    width: 100%;
    margin-bottom: 10px;
}

/* Make dropdown fill the wrapper */
calcite-dropdown,
calcite-button[slot="trigger"] {
    width: 100% !important;
}

    /* Reduce dropdown menu padding */
    calcite-dropdown::part(menu) {
        padding: 0 !important;
    }

    /* Reduce padding and spacing inside the list */
    calcite-dropdown calcite-list {
        --calcite-list-spacing-unit: 2px !important;
        --calcite-list-padding: 0 !important;
        width: 100%;
    }

/* Reduce padding on individual items */
calcite-list-item::part(content) {
    padding: 2px 6px !important;
    margin: 0 !important;
}

calcite-list-item::part(label) {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.1 !important;
}

/* Optional: super-tight mode for ultra-compact list items */
calcite-list-item {
    --calcite-list-item-spacing-unit: 2px !important;
    --calcite-list-item-padding: 2px !important;
}

/* Buttons below dropdowns also full width */
.calcite-dropdown-wrapper calcite-button,
.button-wrapper > * {
    width: 100%;
    margin-bottom: 0px;
    margin-block-end: 0 !important;
    margin-block-start: 0 !important;
}


/* Buttons wrapper - Using flex and gap for precise spacing */
.button-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0px; /* Adjust this value (e.g., 2px or 0) to tighten spacing */
    font-weight: 300 !important;
    margin: 0 !important;
    width: 100%;
}

    /* Ensure no extra margins are pushing the buttons apart */
    .button-wrapper > * {
        margin: 0 !important;
        width: 100%;
    }

/* Ensure dropdown triggers also follow the reset */
calcite-button[slot="trigger"] {
    width: 100% !important;
    margin: 0 !important;
}

/* Filter option texts */
.filter-options-text {
    font-size: 1.0em;
    font-weight: 300;
    color: #333;
}

.filter-options-smalltext {
    font-size: 1.0em;
    font-weight: 500;
    color: #333;
}

/* View container */
#viewDiv {
    flex-grow: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Footer */
#footer {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    text-align: left;
    font-size: 0.90em;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    min-height: 20px;
    flex-shrink: 0;
}

    #footer p {
        margin: 0;
    }

#floating-cart h4 {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
    color: #E07C07;
}

#floating-cart {
    position: absolute;
    bottom: 40px;
    left: 350px;
    width: 280px;
    min-height: 240px;
    /* height: 240px;  original color: ef9021*/

    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 2px solid #E07C07;
}

#color-bar {
    position: absolute;
    bottom: 0;
    left: 322px; /* width of your menu */
    width: calc(100% - 300px); /* fills entire map width */
    height: 20px;
    background: #CFD3D4;
    pointer-events: none;
    z-index: 9999;
}

/* Selection tools container */
#selection-tools-container {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Add all to cart button */
#add-all-to-cart-button {
    --calcite-color-brand: #2596be !important;
    --calcite-color-background: #2596be;
    --calcite-color-text: #2596be !important;
    --calcite-color-brand-border: #2596be !important;
}

    #add-all-to-cart-button::part(label) {
        margin-bottom: 0 !important;
        font-weight: 300 !important;
        font-size: 0.8em !important;
    }

    #add-all-to-cart-button:hover {
        --calcite-color-brand-hover: #2596be !important;
        --calcite-color-brand-hover-text: #2596be !important;
        --calcite-color-brand-hover-border: #2596be !important;
    }

        #add-all-to-cart-button:hover::part(label) {
            font-weight: 300 !important;
            font-size: 0.8em !important;
            color: #ffffff !important;
        }

/* Add county to cart button */
#add-county-to-cart-button {
    --calcite-color-brand: #2596be !important;
    --calcite-color-background: #2596be;
    --calcite-color-text: #2596be !important;
    --calcite-color-brand-border: #2596be !important;
}

    #add-county-to-cart-button::part(label) {
        font-weight: 300 !important;
        font-size: 0.8em !important;
    }

    #add-county-to-cart-button:hover {
        --calcite-color-brand-hover: #2596be !important;
        --calcite-color-brand-hover-text: #2596be !important;
        --calcite-color-brand-hover-border: #2596be !important;
    }

        #add-county-to-cart-button:hover::part(label) {
            font-weight: 300 !important;
            font-size: 0.8em !important;
            color: #ffffff !important;
        }


/* Disabled Section */

#add-all-to-cart-button[disabled] {
    filter: blur(0.8px);
    opacity: 0.2 !important;
    cursor: not-allowed;
}

#add-county-to-cart-button[disabled] {
    filter: blur(0.8px);
    opacity: 0.2 !important;
    cursor: not-allowed;
}

#county-button[disabled] {
    filter: blur(0.8px);
    opacity: 0.2 !important;
    cursor: not-allowed;
}

#product_class-dropdown[disabled] {
    filter: blur(0.8px);
    opacity: 0.2 !important;
    cursor: not-allowed;
}

#add-to-cart-button[disabled] {
    filter: blur(0.8px);
    opacity: 0.2 !important;
    cursor: not-allowed;
}


#clear-cart-button[disabled] {
    filter: blur(0.8px);
    opacity: 0.2 !important;
    cursor: not-allowed;
}

#export-selection-button[disabled] {
    filter: blur(0.8px);
    opacity: 0.2 !important;
    cursor: not-allowed;
}



/* Logo container with background */
.h-gac-logo-container {
    background-image: url("https://www.h-gac.com/Content/img/logo.png");
    background-repeat: no-repeat;
    background-size: contain;
    padding-left: 50px;
    min-height: 40px;
    display: inline-block;
}

/* Selection tool items */
.selection-tool-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.selection-tools {
    display: flex;
    gap: 5px;
    align-items: center;
}

.button-label {
    font-size: 1.0em;
    font-weight: bold;
    margin-left: 10px;
    vertical-align: middle;
    color: #8b0000;
}

/* Imagery info styling */
.imagery-info {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.imagery-link {
    font-weight: 550;
    font-size: 0.8em;
    text-decoration: none;
}

.imagery-link-left {
    font-weight: 350;
    color: #000000 !important;
    padding-left: 80px;
    font-size: 0.85em;
    text-decoration: none;
}

.imagery-link:hover {
    text-decoration: underline;
}


#reset-dropdowns-button::part(label) {
    font-weight: 100 !important;
    font-size: 0.5em !important;
    color: #800020 !important;
}

#reset-dropdowns-button:hover::part(label) {
    font-weight: 100 !important;
    font-size: 0.5em !important;
}


/* Selected files summary and cart summary */
/* --- 1. SELECTED FILES SUMMARY (Reserves 4.7em of space) --- */
#selected-files-summary {
    color: #e1043b !important;
    font-weight: bold !important;
    /* Ensure the container itself has a min-height */
    min-height: 4.7em;
}

    /* Placeholder for when #selected-files-summary is empty */
    #selected-files-summary:empty::before {
        content: ""; /* Use an empty string for best accessibility */
        display: block;
        height: 4.7em;
    }


/* --- 2. CART SUMMARY (#cart-summary - Reserves 4.7em of space) --- */
#cart-summary {
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 1.1em;
    /* Setting min-height on the container */
    min-height: 4.7em;
    color: #000000 !important;
}

    /* Placeholder for when #cart-summary is empty */
    #cart-summary:empty::before {
        content: ""; /* Use an empty string for best accessibility */
        display: block;
        height: 4.7em;
    }


/* --- 3. CART SUMMARY 2 (#cart-summary2 - Reserves 7.0em of space) --- */
#cart-summary2 {
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 1.1em;
    /* Setting min-height on the container */
    min-height: 7.0em;
    color: #000000 !important;
}

    /* Placeholder for when #cart-summary2 is empty */
    #cart-summary2:empty::before {
        content: ""; /* Use an empty string for best accessibility */
        display: block;
        height: 7.0em;
    }

#add-to-cart-button {
    width: 100%;
    --calcite-color-brand: #00619B !important;
}

#export-selection-button {
    width: 100%;
    --calcite-color-brand: #E07C07 !important;
    --calcite-color-brand-hover: #fc7f03 !important;
    --calcite-color-brand-press: #00619B !important;
}

/* Walkthrough */

/* This is the most important part */
#walkthrough-container.hidden,
.walkthrough-step.hidden {
    display: none !important;
}

/* Ensure the container is hidden by default in the stylesheet */
#walkthrough-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* Base style for steps */
.walkthrough-step {
    position: absolute;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 10001;
}

/* Button text color override */
#toggle-imagery-color::part(label) {
    font-size: 0.6em !important;
    font-weight: 300 !important;
}




#floating-cart_button_div {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    #floating-cart_button_div h4 {
        margin: 0;
    }

    #floating-cart_button_div button {
        font-size: 0.8em;
        background-color: transparent;
        border-width: 1px;
        color: #fc7f03;
        border-color: #fc7f03;
        button: active

{
    border-color: transparent;
    outline: none;
}

}





#infoDiv {
    position: absolute;
    top: 20px;
    left: 120px;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.0);
    padding: 30px;
    border: 0px solid transparent;
    box-shadow: none;
    width: 300px;
}

/* Selected product class display */
#selected-product_class-display {
    position: absolute;
    top: -50px;
    left: 0px;
    background-color: yellow;
    font-size: 0.7em;
    z-index: 101;
    width: 300px;
}

ul {
    margin-top: 0; /* Removes the default large gap above the list */
    padding-top: 0;
}

.spacer-m {
    height: 5px; /* Custom gap height */
    display: block;
}

/* Highlighted text */
.highlight_product {
    position: absolute;
    top: -50px;
    left: 0px;
    font-size: 0.7em;
    background-color: yellow;
    z-index: 101;
}

/* Selected files list */
#selected-files-list ul {
    list-style-type: disc;
    margin-left: 20px;
    padding: 0;
    font-size: 0.85em;
    color: #555;
}

    #selected-files-list ul li {
        margin-bottom: 5px;
    }

/* Responsive */
@media (max-width: 600px) {
    #menu {
        display: none;
    }

    #viewDiv {
        display: none !important;
    }

    #floating-cart {
        display: none;
    }
}

.user-guide-link {
    color: #FFF;
    text-decoration: none;
}

    .user-guide-link:hover {
        color: #C5093B;
    }
