:root {
    --theme-blue: #227eac;
    --theme-dark-blue: #085175;
}
  
/* Fonts and heading styles */
body {
    font-family: "DM Sans", Arial, sans-serif;
    font-size: 16px;
}
h1 {
    font-size: 26px;
    margin-bottom: 0.25rem;
}
h3 {
    display: inline;
    color: var(--theme-dark-blue);
    font-size: 22px;
    margin-bottom: 0.25rem;
}

/* Footer formatting */
#footer-contents-all {
    position: relative;
    z-index: 3;
}
#version-text p {
    margin-bottom: 0.25rem;
}
#footer-about-text p {
    margin-bottom: 0rem;
    padding-left: 1rem;
    padding-right: 1rem;
    text-align: justify;
    font-size: 16px;
}

#footer-about-text iframe {
    display: block;
    width: 96%;
    aspect-ratio: 560/315;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1rem;
    margin-bottom: 0rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

#footer-about-text b {
    padding-left: 1rem;
    padding-right: 1rem;
    text-align: left;
    display: block;
    padding-top: 2rem;
    margin-bottom: 0.3rem;
    font-size: 18px;
    color: #fff;
}
#footer-about-text a {
    color: #FFF;
}
#footer-image {
    background-image: url('images/redwoods.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 480px; 
    width: 100%; 
    clear: both;
}
#footer {
    color: #ddd;
    padding-bottom: 0.5rem;
    position: relative;
    background-color: var(--theme-dark-blue);
    background-position: center 25%;
    z-index: 1;
}

/* Customise bootstrap components */
.alert {
    padding: 0 5px;
    margin-bottom: 5px;
    font-size: 14px;
}
.Select-control, .card {
    border-color: var(--theme-blue);
}
.form-switch .form-check-input {
    border-color: var(--theme-blue);
}
.form-switch .form-check-input:checked {
    background-color: var(--theme-blue);
}
.form-select, .form-control {
    padding: 0.3rem 1rem 0.3rem 0.5rem;
}

.form-control:disabled, .form-select:disabled {
    color: #cfcfcf;
}

.full-width-dropdown {
    width: 100% !important;
}

.full-width-dropdown .dropdown-toggle {
    width: 100% !important;
    text-align: left;
    background-color: white !important;
    color: black !important;
    border: 1px solid #ced4da !important;
    border-radius: 5px;
    display: flex;
    padding: 0.3rem 1rem 0.3rem 0.5rem;
    justify-content: space-between; /* Keeps caret aligned */
    align-items: center;
}

.full-width-dropdown .dropdown-menu {
    width: 100% !important;
}


input:invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    outline: none;
}
/* Override focus shadowing when input is invalid */
input:invalid:focus {
    box-shadow: 0 0 10px red; 
}

/* Custom button colouring */
.theme-button {
    background-color: #227eac;
    border: none;
}

/* Leaflet custom icon styling */
.leaflet-div-icon {
    background: none;
    border: none;
}
.customicon {
    width: 1.5em;
    height: 1.5em;
    background-color: white;
    border: 2px solid black;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* font-size: 24px; */
    font-weight: bold;
}
.customicon-invalid {
    width: 1.5em;
    height: 1.5em;
    background-color: white;
    border: 2px solid red;
    color: red;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* font-size: 24px; */
    font-weight: bold;
}

/* Hover info box on leaflet map */
#map-hover-info {
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
}

/* Controls for graphing options */
.graph-input-element, .graph-input-element-wide {
    display: inline-block;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

#add-to-compare {
    display: inline-block;
}

/* Height of map and graph */
#div-location-map {
    height: 50vh;
}
#graph-content {
    height: 48vh;
}
#alert-mobile-no-map {
    display: none;
}

/* Margins for scenario delete buttons */
.btn-scenario-delete {
    margin: 0px; 
    padding: 4px;
}

/* Display of scenario inputs */
.compare-card-element, .compare-card-element-wide {
    width:50%;
    display: inline-block;
    padding: 0.3em;
}

/* Button on end */
.compare-card-button {
    width: 60px;
    padding: 0.3em;
    float: right;
    margin-top: 0.7em;
}

/* Style Dash 'loading' text and add a spinner during initial load: https://community.plotly.com/t/whenever-i-try-to-load-a-page-from-dash-application-i-see-loading-before-the-content-is-displayed-please-suggest-me-a-way-to-remove-that-text-and-replace-it-with-css-spinner/45515/7 */
._dash-loading {
    margin: auto;
    margin-top: 2rem;
    margin-right: 1rem;
    color: #085175;
    text-align: center;
    font-weight: 600;
}
._dash-loading::after {
    content: '';
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    color: #085175;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    -webkit-animation: spinner-border 0.75s linear infinite;
    animation: spinner-border 0.75s linear infinite;
    text-align: center;
    margin: auto;
}

/* ~~~ Media Controls ~~~ */

/* Turn off tooltips if the user can't hover */
@media (any-hover: none) {
    .tooltip {
        display: none;
    }
}

/* Reduce height of graph for xs and sm screens */
@media (max-width: 767px) {
    .alert {
        font-size: 12px;
    }    
    #alert-mobile-no-map {
        display: block;
    }
    #div-location-map {
        height: 30vh;
    }
    #div-graph-content {
        margin-top: 70px;
    }
    #graph-content {
        height: 40vh;
    }
    #img-logo, #img-location, #img-species {
        display: none;
    }
    .div-alert-scenario {
        margin-top: 5px;
    }
    .btn-scenario-delete {
        margin-top: 5px;
    }
}

/* X-Small screens */
@media (min-width: 768px) {
    .compare-card-element {
        width: 18%;
    } 
    .compare-card-element-wide {
        width: 23%;
    }    
    #img-location-mob, #img-species-mob {
        display: none;
    }
}

/* Up to medium screens */
@media (max-width: 1199px) {
    #graph-content {
        height: 41vh;
    }    
    #img-logo {
        display: none;
    }   
}

/* X-Large screens */
@media (min-width: 1200px) {
    .compare-card-element {
        width: 9%;
    }
    .compare-card-element-wide {
        width: 11%;
    }    
}

/* Use smaller buttons, form inputs, and fonts for smaller screens */
@media (max-width: 1399px) {
    body {
        font-size: 14px;
    }
    h1 {
        font-size: 24px;
    }
    h3 {
        font-size: 20px;
    }
    #footer-about-text p {
        font-size: 14px;
    }
    #footer-about-text b {
        font-size: 16px;
    }
    .form-select, .form-control {
        padding-top: .25rem;
        padding-bottom: .25rem;
        padding-left: .5rem;
        font-size: .875rem;
        border-radius: var(--bs-border-radius-sm);
    }
    .btn {
        --bs-btn-padding-y: 0.25rem;
        --bs-btn-padding-x: 0.5rem;
        --bs-btn-font-size: 0.875rem;
        --bs-btn-border-radius: var(--bs-border-radius-sm);
    }
    .compare-card-element, .compare-card-element-wide {
        padding: 0.2em;
    }
    .graph-input-element, .graph-input-element-wide {
        padding-left: 0.2rem;
        padding-right: 0.2rem;        
        margin-top: 0.1rem;
        margin-bottom: 0.1rem;   
    }
}