
/* Thin page header */
.survey-header {
    background: white;
    border-bottom: 1px solid var(--primary-color);
    padding-left: 3px;
    padding-right: 3px;
    padding-top: 3px;
    padding-bottom: 3px;
    display: flex;
    min-height: 50px;
    align-items: stretch;
    flex-shrink: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 1;
    min-width: 0;
}

/* Old circle style — kept for revert
.exit-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
*/
.exit-button {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 36px;
    align-self: stretch;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.exit-button:hover {
    background-color: var(--primary-light);
}

.header-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-title.compact {
    font-size: 14px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin-left: 4px;
}

/* Limit stats/gps sections on large screens, let lake/zone grow */
#header_center_stats,
#header_gps_status {
    flex: 0 0 auto;
}

.header-center-stats {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.survey-stats {
    display: flex;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    width: 100%;
}

.header-center-title {
    flex: 1;
    display: flex;
    min-width: 0;
    justify-content: center;
    margin-left: 10px;
}

.survey-title {
  align-content: center;
}

.header-right {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
}

/* Old circle style — kept for revert
.view-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
*/
.view-toggle-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 36px;
    align-self: stretch;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.view-toggle-btn:hover {
    background-color: var(--primary-light);
}

/* [?] beside the Map/Table toggle (survey_main header): same chrome as the
   toggle, but deliberately NOT class view-toggle-btn — survey_main.js and
   bottom_tabs.js querySelector('.view-toggle-btn') to swap that button's
   icon and hide/disable it per tab, and must not grab this one. */
.header-help-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 36px;
    align-self: stretch;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 700;
    margin-right: 6px;
}

.header-help-btn:hover {
    background-color: var(--primary-light);
}

/* Hamburger menu styles (.menu-overflow-*) moved to /css/common.css so the
   explore app's header menu can share them. */

/* Override common.css's fixed 40px height (kept for the explore header) so
   the hamburger and the Signups shortcut stretch like .exit-button does. */
.survey-header .menu-overflow-btn,
.survey-header .header-link-btn {
    height: auto;
    align-self: stretch;
}

/* On small screens the Signups shortcut collapses to just the arrow-square
   icon, as elsewhere (matches the explore header's Survey button). */
@media (max-width: 650px) {
    .survey-header .header-link-btn { padding: 0 8px; }
    .survey-header .header-link-btn-label { display: none; }
}

/* Map/Text view toggle when it lives inside a panel (survey_start.html): the
   button is a direct child of the New Survey .content-card (which gets
   bootstrap's .position-relative) and anchors 20px from the card's top-right
   corner. The solid background keeps the input beneath from showing through
   where the button overlaps the form. */
.panel-view-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    height: 36px;
    align-self: auto;   /* neutralize the header rule's align-self:stretch */
    background: var(--card-background, white);
    z-index: 5;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
}

/* Mobile responsive and small screens */
@media (max-width: 650px) {

    .header-title:not(.compact) {
        display: none;
    }

    .compact {
        display: block;
    }

    /* Mobile: all header regions equal width */
    .header-center {
        flex: 1 1 0;
    }

    #header_center_stats,
    #header_gps_status {
        flex: 1 1 0;
        max-width: none;
    }

    .survey-stats {
        flex-direction: column;
        gap: 2px;
        font-size: 12px;
    }

    .survey-stats .stat-item {
        min-height: 18px;
        flex: 1;
        justify-content: center;
    }

    .survey-stats .stat-test {
        flex: 0 0 33%;
        padding: 1px 8px;
        font-size: 11px;
    }

    .header-center + .header-center {
        margin-left: 2px;
    }

    .stat-value {
        font-size: 14px;
    }

    .survey-location {
      width: auto;
      margin-left: 5px;
      overflow: hidden;
      text-overflow: ellipsis;
      align-content: center;
    }
}

/* Mobile landscape: compact header */
@media (orientation: landscape) and (max-height: 500px) {
    .survey-header {
        padding-top: 2px;
        padding-bottom: 2px;
    }

    .header-title:not(.compact) {
        display: none;
    }

    .header-title.compact {
        display: block !important;
    }

    .stat-label {
        font-size: 9px;
    }

    .stat-value {
        font-size: 12px;
    }

    .header-action {
        padding: 2px 4px;
    }
}
