/* =========================
   mapper.timeframe.css
   ========================= */
/* Timeframe pane layout */
.tf-pane .section-card .card-header {
    background: var(--bs-light);
}

.tf-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-light);
}

.tf-events-title {
    font-weight: 600;
    font-family: "Oswald", Arial, Helvetica, sans-serif;
}

.tf-graph-title {
    font-family: "Oswald", Arial, Helvetica, sans-serif;
    font-weight: 500;
}

/* Timeframe variable toggle group styling */
.tf-pane #tf-var-group .btn.btn-outline-secondary {
    border-color: rgba(27, 94, 32, 0.8);
    outline-offset: 0;
    color: #1b5e20;
    background-color: transparent;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tf-pane #tf-var-group .btn.btn-outline-secondary:hover,
.tf-pane #tf-var-group .btn.btn-outline-secondary:focus {
    border-color: rgba(27, 94, 32, 1);
    outline-color: rgba(27, 94, 32, 1);
    color: #1b5e20;
    background-color: rgba(21, 74, 25, 0.08);
}

.tf-pane #tf-var-group .btn-check:checked + .btn.btn-outline-secondary,
.tf-pane #tf-var-group .btn-check:active + .btn.btn-outline-secondary,
.tf-pane #tf-var-group .btn.btn-outline-secondary.active {
    background-color: rgba(27, 94, 32, 0.9);
    border-color: rgba(27, 94, 32, 0.9);
    outline-color: rgba(27, 94, 32, 0.9);
    color: #fff;
}

/* Heat events list container */
.tf-events-card {
    display: flex;
    flex-direction: column;
    height: 698.5px;
    max-height: 698.5px;
    min-height: 0;
    background: #eeeff1;
}

.tf-events-card .card-body.tf-events-scroll {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: auto;
    padding: 0.9rem;
}

.tf-events-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.tf-spin-btn {
    padding: 0.12rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1;
}

/* Graph area */
.tf-graph-wrap {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fff;
}

.tf-graph-wrap > .mapper-results-loading {
    align-items: center;
}

.tf-graph {
    flex: 1 1 auto;
    height: 100%;
    min-height: clamp(320px, 46vh, 520px);
}

.tf-datetime-head {
    min-width: 0;
}

.tf-datetime-head .tf-datetime-title {
    margin-bottom: 0.75rem !important;
}

.tf-datetime-head .tf-auto-controls {
    min-width: 0;
}

.tf-datetime-head.is-wrapped {
    justify-content: flex-start !important;
}

.tf-datetime-head.is-wrapped .tf-auto-controls {
    flex: 1 1 100%;
    margin-left: 0 !important;
    justify-content: flex-start !important;
}

/* Auto-selector label */
.tf-auto-label {
    font-weight: 600;
}

.tf-auto-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tf-auto-marker {
    display: inline-block;
    line-height: 1;
    font-size: 0.72rem;
}

.tf-auto-marker-square {
    font-size: 0.66rem;
}

/* Date/time inputs */
.tf-datetime-card {
    border: 1px dashed var(--bs-border-color);
    border-radius: 0.75rem;
}

/* Make form labels slightly smaller */
.tf-datetime-card .form-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Match month/AMPM control height to day/hour controls */
.tf-pane #tf-month,
.tf-pane #tf-ampm {
    height: calc(1.5em + 0.75rem + 2px);
}

.tf-plot-legend input[type="checkbox"] {
    accent-color: #1b5e20;
}

.tf-disabled-field:disabled {
    opacity: 0.65;
    background: var(--bs-light);
    cursor: not-allowed;
}



/* Timeframe appearance updates */
.tf-pane {
    --tf-medium-gray: #eeeff1;
    --tf-light-gray: var(--bs-light);
}

#timeframe-pane .tf-overview-maps {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.45rem;
    background: #fff;
    padding: 0.55rem 0.55rem 2.1rem;
}

#timeframe-pane .tf-overview-maps::after {
    left: 0.55rem;
    right: 0.55rem;
}

#timeframe-pane .tf-single-event-maps::after {
    background: url("/static/img/events/state_event_hi_color_ramp_5.png") center center / contain no-repeat;
}

#tf-detail-view .tf-single-event-maps {
    border: 0;
}

#tf-detail-view .tf-graph-card > .card-body {
    background: var(--tf-light-gray);
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: 0.5rem;
    overflow: auto;
}

#tf-detail-view .tf-detail-split-card {
    height: 700px;
    max-height: 700px;
    overflow: hidden;
    border: 0;
    box-shadow: none;
    background: transparent;
}

#tf-detail-view .tf-detail-split-card > .card-body {
    padding: 0 !important;
}

#tf-detail-view .tf-detail-split-card > .card-body,
#tf-detail-view .tf-detail-split-row,
#tf-detail-view .tf-detail-split-row > [class*="col-"],
#tf-detail-view .tf-events-card,
#tf-detail-view .tf-graph-card {
    height: 100%;
    max-height: 100%;
    min-height: 0;
}

#tf-detail-view .tf-detail-split-row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    row-gap: 0.85rem;
}

#tf-detail-view .tf-detail-main {
    border-left: 0;
}

#tf-detail-view .tf-detail-split-row .tf-events-card,
#tf-detail-view .tf-detail-split-row .tf-graph-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    box-shadow: none;
    margin: 0;
    overflow: hidden;
}

#tf-detail-view .tf-graph-wrap {
    min-height: 320px;
}

#tf-detail-view #tf-graph {
    box-sizing: border-box;
    height: 100%;
    min-height: 320px;
    max-height: none;
    padding: 0.75rem 1.1rem 0.6rem;
    overflow: hidden;
}

#tf-detail-view #tf-graph .tf-plot-legend-left,
#tf-detail-view #tf-graph .tf-plot-legend-left label,
#tf-detail-view #tf-graph .tf-plot-legend-left span {
    font-size: 0.875rem;
}

#tf-detail-view .tf-selected-event-title {
    font-size: 1.2rem;
    line-height: 1.15;
    font-weight: 500;
}

#tf-detail-view .tf-events-header {
    background: var(--bs-light);
}

#tf-detail-view .tf-events-scroll {
    overflow: auto;
}

#tf-detail-view .tf-graph-card > .card-header {
    min-height: 40px;
    padding-top: 0.65rem;
    padding-bottom: 0.4rem;
    border-bottom: 0;
}

#tf-detail-view .tf-events-card {
    background: #fff;
}

#tf-detail-view .tf-events-header {
    justify-content: flex-start;
    box-sizing: border-box;
}

#tf-detail-view .tf-events-scroll .tf-events-title {
    margin: 0 0 0.45rem;
    padding: 0;
    background: transparent;
}

#tf-detail-view .tf-events-header #btn-tf-back-location {
    opacity: 1;
    background-color: #fff;
    border-color: rgba(55, 55, 55, 0.46);
    color: rgba(31, 31, 31, 0.68);
    outline: 1px solid rgba(31, 31, 31, 0.18);
}

#tf-detail-view .tf-events-header #btn-tf-back-location:hover,
#tf-detail-view .tf-events-header #btn-tf-back-location:focus-visible {
    background-color: #154a19;
    border-color: #154a19;
    color: #fff;
    outline-color: rgba(255, 255, 255, 0.75);
}

#tf-detail-view .tf-events-header #btn-tf-back-location:focus:not(:focus-visible) {
    background-color: #fff;
    border-color: rgba(55, 55, 55, 0.46);
    color: rgba(31, 31, 31, 0.68);
    outline-color: rgba(31, 31, 31, 0.18);
}

#tf-detail-view .tf-single-event-card {
    background: #fff;
}

#tf-detail-view .tf-single-event-scroll {
    padding: 0.3rem 1rem 1rem;
}

#tf-detail-view .tf-single-event-summary {
    margin-top: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: #fff;
}

#tf-detail-view .tf-single-event-date {
    margin-bottom: 0.8rem;
    font-size: 1.35rem;
}

#tf-detail-view .tf-single-event-copy {
    color: #1f1f1f;
    font-size: 0.95rem;
    line-height: 1.5;
}

#tf-detail-view .tf-single-event-copy p {
    margin-bottom: 0.75rem;
}

#tf-detail-view .tf-single-event-table-section {
    margin-top: 1rem;
}

#tf-detail-view .tf-single-event-table-title {
    margin: 0 0 0.3rem;
    font-family: "Oswald", Arial, Helvetica, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    text-decoration-thickness: 1.5px;
}

#tf-detail-view .tf-single-event-table {
    margin-bottom: 0;
    font-size: 0.88rem;
}

#tf-detail-view .tf-single-event-table .tf-col-station {
    width: 59%;
}

#tf-detail-view .tf-single-event-table .tf-col-max-temp {
    width: 23%;
}

#tf-detail-view .tf-single-event-table .tf-col-date {
    width: 18%;
}

#tf-detail-view .tf-single-event-table > :not(caption) > * > * + * {
    border-left: 1px solid var(--bs-border-color);
}

#tf-detail-view .tf-single-event-table th {
    white-space: nowrap;
}

#tf-detail-view .tf-auto-controls .tf-auto-label {
    color: #495057;
}

#tf-detail-view .tf-auto-controls .tf-auto-btn {
    min-width: 0;
    width: auto;
    flex: 0 0 auto;
    background-color: #fff;
    border-color: #373737;
    color: #1f1f1f;
    opacity: 0.88;
    outline: 1px solid rgba(31, 31, 31, 0.35);
}

#tf-detail-view .tf-auto-controls .tf-auto-btn:hover,
#tf-detail-view .tf-auto-controls .tf-auto-btn:focus-visible {
    background-color: #154a19;
    border-color: #154a19;
    color: #fff;
    opacity: 0.95;
    outline-color: rgba(255, 255, 255, 0.75);
}

#tf-detail-view .tf-auto-controls .tf-auto-btn:focus:not(:focus-visible) {
    background-color: #fff;
    border-color: #373737;
    color: #1f1f1f;
    opacity: 0.88;
    outline-color: rgba(31, 31, 31, 0.35);
}

#tf-detail-view .tf-datetime-card {
    border: 1px solid var(--bs-border-color);
    background: #fff;
}

#tf-detail-view .tf-datetime-card .card-body > .d-flex {
    align-items: flex-start;
}

#tf-detail-view .tf-datetime-card .tf-auto-controls {
    margin-left: auto;
    justify-content: flex-end;
}

#tf-detail-view .tf-datetime-title {
    font-family: var(--bs-body-font-family);
    font-weight: 600;
    line-height: 1.1;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    text-decoration-thickness: 1.5px;
    padding-top: 0.25rem;
}

@media (max-width: 991.98px) {
    #tf-detail-view .tf-detail-split-card {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    #tf-detail-view .tf-detail-split-card > .card-body,
    #tf-detail-view .tf-detail-split-row,
    #tf-detail-view .tf-detail-split-row > [class*="col-"],
    #tf-detail-view .tf-events-card,
    #tf-detail-view .tf-graph-card {
        height: auto;
        max-height: none;
    }

    #tf-detail-view .tf-detail-split-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        overflow-x: visible;
    }

    #tf-detail-view .tf-detail-side {
        order: 1;
    }

    #tf-detail-view .tf-detail-main {
        order: 2;
        border-left: 0;
        border-top: 0;
    }

    #tf-detail-view .tf-events-card .card-body.tf-events-scroll {
        display: block;
        max-height: none;
        overflow: visible;
        padding: 0.75rem;
    }

    #tf-detail-view .tf-graph-card > .card-body {
        display: block;
        overflow: visible;
    }

    #tf-detail-view .tf-graph-wrap {
        display: block;
        flex: none;
        min-height: 0;
    }

    #tf-detail-view #tf-graph {
        height: clamp(320px, 46vh, 520px);
        max-height: 520px;
    }
}

@media (min-width: 992px) {
    #tf-detail-view .tf-detail-split-row {
        display: flex;
        flex-wrap: nowrap;
    }

    #tf-detail-view .tf-detail-side,
    #tf-detail-view .tf-detail-main {
        min-width: 0;
    }

    #tf-detail-view .tf-detail-side {
        padding-right: 0.5rem;
    }

    #tf-detail-view .tf-detail-main {
        padding-left: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    #tf-detail-view .tf-single-event-table {
        font-size: 0.82rem;
    }
}

.tf-overview-maps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    position: relative;
    padding-bottom: 2.1rem;
}

.tf-overview-maps::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.4rem;
    background: url("/static/img/events/state_event_legend.png") center center / contain no-repeat;
    z-index: 0;
}

.tf-overview-map {
    position: relative;
    height: 160px;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.4rem;
    overflow: hidden;
    background: var(--bs-body-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.tf-overview-map img {
    width: 95%;
    height: 95%;
    object-fit: contain;
    display: block;
}

.tf-overview-map-year {
    position: absolute;
    left: 0.35rem;
    bottom: 0.35rem;
    padding: 0.12rem 0.35rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.78);
    color: #222;
    font-size: 0.8rem;
    font-weight: 700;
}

.tf-overview-dates {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: "Oswald", Arial, Helvetica, sans-serif;
}

.tf-overview-title {
    font-size: 0.95rem;
    line-height: 1.25;
    font-weight: 600;
}

.tf-overview-title .bi {
    margin-right: 0.3rem;
}

@media (max-width: 991.98px) {
    .tf-overview-map {
        height: 150px;
    }

    .tf-overview-maps {
        padding-bottom: 1.8rem;
    }

    .tf-overview-maps::after {
        height: 1.7rem;
    }
}


