/**
 * navigation.css — Top bar, panel divider, tab buttons, view toggle,
 * segmented control, sort dropdown, control-strip search, and fuzzy toggle.
 */

/* ── Top bar ── */
.top-bar {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: var(--color-primary-200);
    background-color: var(--color-surface);
}

/* ── Blue panel divider ── */
.panel-divider {
    background-color: var(--color-primary-300);
}

/* ── Navigation tab button ── */
.tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom-width: 2px;
    border-bottom-style: solid;
    border-bottom-color: transparent;
    color: var(--color-gray-500);
    background: none;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn.is-active {
    border-bottom-color: var(--color-navy);
    color: var(--color-navy);
}

.tab-btn:hover:not(.is-active) {
    color: var(--color-navy);
    border-bottom-color: var(--color-primary-300);
}

/* ── View toggle button (Calendar / Map / List) ── */
.view-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-width: 1px;
    border-style: solid;
    border-radius: 0.5rem;
    border-color: var(--color-primary-200);
    color: var(--color-gray-600);
    background-color: var(--color-surface);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.view-btn.is-active {
    background-color: var(--color-navy);
    color: var(--color-surface);
    border-color: var(--color-navy);
}

.view-btn:hover:not(.is-active) {
    border-color: var(--color-navy);
    color: var(--color-navy);
    background-color: var(--color-primary-50);
}

/* ── Day/Week/Month segmented control ── */
.seg-control {
    display: flex;
    border-width: 1px;
    border-style: solid;
    border-color: var(--color-primary-200);
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.seg-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
    color: var(--color-gray-600);
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.seg-btn.is-active {
    background-color: var(--color-navy);
    color: var(--color-surface);
}

.seg-btn:hover:not(.is-active) {
    background-color: var(--color-primary-50);
}

/* ── Sort dropdown (in Explore control strip) ── */
.sort-select {
    font-size: 0.75rem;
    border-width: 1px;
    border-style: solid;
    border-color: var(--color-primary-200);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    color: var(--color-gray-700);
    background-color: var(--color-surface);
    flex-shrink: 0;
    appearance: none;
    cursor: pointer;
}

/* ── Control-strip search bar (List view) ── */
.control-strip-search {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.375rem;
    padding: 0.2rem 0.625rem;
    border-width: 1px;
    border-style: solid;
    border-color: var(--color-primary-200);
    border-radius: 0.375rem;
    background-color: var(--color-surface);
    color: var(--color-gray-500);
    min-width: 0;
}

.control-strip-search:focus-within {
    border-width: 2px;
    border-color: var(--color-primary-500);
    padding: 0.138rem 0.563rem; /* compensate for the extra 1px border to avoid layout shift */
}

.control-strip-search > svg {
    flex-shrink: 0;
}

.control-strip-search > input {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--color-gray-800);
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    appearance: none;
    min-width: 0;
}

.control-strip-search > input::placeholder {
    color: var(--color-gray-400);
}

.control-strip-search > input:hover,
.control-strip-search > input:focus {
    border: none;
    outline: none;
    box-shadow: none;
    appearance: none;
}

/* ── Control-strip search row (search bar) ── */
.control-strip-search-row {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.75rem;
    min-width: 0;
}

/* On mobile the search row takes its own full-width line. */
@media (max-width: 640px) {
    .control-strip-search-row {
        flex: 0 0 100%;
    }
}

/* ── Responsive label helpers ── */
.mobile-shown  { display: none; }

@media (max-width: 640px) {
    .mobile-hidden { display: none; }
    .mobile-shown  { display: inline; }
}

/* ── Logo (back-to-home interactive area) ── */
.shell-logo-btn {
    cursor: pointer;
    border-radius: 0.375rem;
    transition: opacity 0.15s;
}

.shell-logo-btn:hover {
    opacity: 0.75;
}

/* ── Exit button hover effect ── */
.shell-logout-btn:hover {
    color: var(--color-error-hover);
}

/* ── Hide exit button on small screens ── */
@media (max-width: 640px) {
    header.top-bar .shell-logout-btn {
        display: none;
    }
    #page-student header.top-bar {
        gap: 0;
    }
}

/* ── Ministry top bar: tabs absolutely centered relative to full bar width ── */
#page-ministry header.top-bar {
    position: relative;
}

#page-ministry header.top-bar > nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    /* Prevent the absolutely-positioned nav from capturing pointer events
       outside the actual buttons. */
    pointer-events: none;
}

#page-ministry header.top-bar > nav > button {
    pointer-events: auto;
}

/* ── Prevent tab button label from wrapping ── */
.tab-btn {
    white-space: nowrap;
}

/* ── Hide logo wordmark on mobile (shell pages only, not home) ── */
@media (max-width: 640px) {
    #page-student .logo-wordmark,
    #page-ministry .logo-wordmark {
        display: none;
    }
}

/* ── Mobile touch targets ── */
@media (max-width: 640px) {
    .seg-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    .view-btn {
        padding: 0.5rem 0.625rem;
    }
    #explore-prev-btn,
    #explore-next-btn {
        padding: 0.5rem;
    }
}

