﻿/* =========================================================
   GLOBAL SHARED & BASE STYLES
   ========================================================= */

/* Instruction text — unified styling for all sections */
.comparison-instructions {
    font-size: 0.875rem; /* matches Bootstrap .small */
    line-height: 1.4;
    text-align: left;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    color: var(--bs-secondary-color);
}

/* Section styling & layout */
.comparison-section {
    margin-bottom: 4rem;
}

    .comparison-section h3 {
        margin-bottom: 0.75rem;
    }

.slider-caption {
    text-align: center;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

/* Distinct style for minimum temperature section */
.min-temp-highlight {
    border-top: 5px solid #007BFF;
    padding-top: 2rem;
    background-color: #f0f8ff;
}

/* =========================================================
   BEERSLIDER BASE STYLES
   ========================================================= */

.beer-slider {
    position: relative;
    isolation: isolate; /* ensures z-index works correctly */
}

    .beer-slider img {
        max-width: 100%;
        height: auto;
        display: block;
    }

/* Guide line — adaptive for visibility */
.beer-guide-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: white;
    mix-blend-mode: difference;
    opacity: 0.9;
    pointer-events: none;
    z-index: 20;
}

/* Slightly wider guide line for high-contrast visuals */
.boxplot-slider-wrapper .beer-guide-line {
    width: 3px;
    opacity: 0.8;
}

/* Limit image height to viewport */
.beer-slider img,
.beer-slider .beer-reveal img {
    max-height: 95vh;
}

/* =========================================================
   BEERSLIDER WRAPPERS & INTERNAL LAYOUT
   ========================================================= */

.beer-slider-wrapper.vh-95,
.comparison-section .beer-slider-wrapper {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: none !important;
    position: relative;
    overflow: visible;
    padding: 1rem 0;
}

/* Internal layout */
.comparison-section .beer-slider {
    position: relative;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    /* Base (baseline) image */
    .comparison-section .beer-slider img {
        width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
    }

    /* Overlay reveal pane */
    .comparison-section .beer-slider .beer-reveal {
        position: absolute;
        top: 0;
        left: 0;
        width: 50%;
        height: 100%;
        overflow: hidden;
    }

        /* Overlay (reveal) image */
        .comparison-section .beer-slider .beer-reveal img {
            width: 100%;
            height: auto;
            object-fit: contain;
            object-position: center center;
            background: none;
        }

/* =========================================================
   CONTROL PANELS — SHARED HEADINGS
   ========================================================= */

.precip-control-panel h5,
.temp-control-panel h5 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--bs-body-color);
    text-align: left;
    margin-bottom: 1.25rem;
    padding-left: 0.25rem;
}

/* =========================================================
   PRECIPITATION CONTROL PANEL (BeerSlider)
   ========================================================= */

#section-precipitation .row {
    min-height: 100vh;
    align-items: stretch;
}

.precip-control-panel {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2rem 1rem;
    border-right: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-light-bg-subtle, #f8f9fa);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

    .precip-control-panel .form-label,
    .precip-control-panel .form-select {
        font-size: 0.95rem;
    }

    .precip-control-panel p.text-muted {
        font-size: 0.85rem;
        line-height: 1.3;
    }

/* =========================================================
   TEMPERATURE OVERLAY SECTION
   ========================================================= */

#section-temp-overlay .row {
    align-items: stretch;
}

/* Overlay image container */
.temp-overlay-wrapper {
    position: relative;
    width: 100%;
    display: block;
    overflow: hidden;
    background-color: var(--bs-body-bg);
    text-align: center;
}

    /* Overlay images */
    .temp-overlay-wrapper img.temp-layer {
        display: block;
        width: 100%;
        height: auto;
        max-height: 100vh;
        object-fit: contain;
        transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
        opacity: 0;
        visibility: hidden;
        position: absolute;
        top: 0;
        left: 0;
    }

        .temp-overlay-wrapper img.temp-layer.active {
            opacity: 1;
            visibility: visible;
            position: relative;
            z-index: 2;
        }

/* Left control panel */
.temp-control-panel {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-right: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-light-bg-subtle, #f8f9fa);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Radio buttons */
.temp-radio {
    transform: scale(1.2);
    margin-right: 0.6rem;
    cursor: pointer;
}

.temp-control-panel .form-check {
    margin-bottom: 1rem;
    padding-left: 0.25rem;
    transition: all 0.2s ease-in-out;
}

    .temp-control-panel .form-check:hover {
        background-color: rgba(13, 110, 253, 0.05);
        border-radius: 0.25rem;
        padding-left: 0.5rem;
    }

/* Active and focus states */
.temp-control-panel .form-check-input:checked + .form-check-label {
    color: var(--bs-primary);
    font-weight: 600;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#section-temp-overlay .form-check-input {
    transform: scale(1.1);
    margin-top: 0.25rem;
}

#section-temp-overlay .form-check-label {
    font-size: 1rem;
    line-height: 1.2;
}

#section-temp-overlay h5.text-center {
    margin-bottom: 1rem;
}

/* =========================================================
   PROJECTED MONTHLY PRECIPITATION (Boxplots)
   ========================================================= */

#section-boxplot-slider .slider-caption {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}

#section-boxplot-slider .comparison-instructions {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--bs-secondary-color);
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================================
   PROJECTED TEMPERATURE LINE PLOTS (BeerSlider)
   ========================================================= */

#lineplots-slider .beer-slider-wrapper,
#section-temp-lineplots-slider .beer-slider-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
}

#lineplots-slider .beer-slider img,
#section-temp-lineplots-slider .beer-slider img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Adaptive guide line for line plots */
#lineplots-slider .beer-guide-line,
#section-temp-lineplots-slider .beer-guide-line {
    width: 3px;
    mix-blend-mode: difference;
    background-color: white;
    opacity: 0.9;
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */

@media (max-width: 768px) {
    .comparison-section .form-select {
        width: 100%;
    }

    .comparison-section .beer-slider-wrapper {
        padding: 0.5rem 0;
    }

    .beer-slider img,
    .beer-slider .beer-reveal img {
        max-height: 65vh;
    }

    /* Column stacking for small screens */
    #section-precipitation .row,
    #section-temp-overlay .row {
        flex-direction: column;
        min-height: auto;
    }

    /* Panels adjust for horizontal layout */
    .precip-control-panel,
    .temp-control-panel {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        padding: 1rem;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    }

        .precip-control-panel h5,
        .temp-control-panel h5 {
            display: none;
        }

        .precip-control-panel p.text-muted {
            display: none;
        }

    .temp-overlay-wrapper {
        height: 65vh;
    }

    .temp-radio {
        transform: scale(1.1);
    }
}

/* =========================================================
   STATIC THUMBNAIL & MODAL STYLES
   ========================================================= */

.img-thumb-btn img {
    max-width: 100%;
    cursor: pointer;
    transition: transform 0.2s;
}

.img-thumb-btn:hover img {
    transform: scale(1.03);
}

.img-caption {
    display: block;
    margin-top: 0.25rem;
    color: #555;
    font-size: 0.9rem;
}

.modal-img {
    max-height: 90vh;
}
