* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sgu-navy: #171b55;
    --sgu-text: #5b5f69;
    --sgu-muted: #9aa2af;
    --sgu-line: #dfe4eb;
    --sgu-water: #edfafa;
    --sgu-land: #c7ccd5;
    --sgu-orange: #ff4f1f;
    --sgu-teal: #b2ebee;
    --filter-panel-width: 360px;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ffffff;
    color: var(--sgu-navy);
    min-height: 100vh;
    overflow: hidden;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #f4f4f4;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom:1px solid #FA6400;
}

body.map-only .header,
.header {
    display: none;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #1A1B4B;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile-only: counter next to the Map/List toggle */
.header-counter {
    display: none;
    font-size: 14px;
    font-weight: 600;
    color: #1A1B4B;
    background: #fff;
    padding: 10px 14px;
    border-radius: 8px;
}


.view-toggle {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.view-toggle-btn {
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.view-toggle-btn.active {
    background: var(--sgu-navy);
    color: white;
}


/* Map Container */
/* Map View Wrapper (map + overlays) */
.map-section {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.map-section-copy {
    display: block;
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 24px 22px;
    text-align: center;
    flex: 0 0 auto;
}

.map-section-copy h1 {
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 800;
    line-height: 1.12;
    color: var(--sgu-navy);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.map-section-copy p {
    font-size: 18px;
    line-height: 1.55;
    color: var(--sgu-text);
    font-weight: 400;
    max-width: 820px;
    margin: 0 auto;
}

#mapViewContainer {
    position: relative;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    overflow: hidden;
    background: var(--sgu-water);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

@media (min-width: 1440px) {
    :root {
        --filter-panel-width: 380px;
    }
}

@media (max-width: 1280px) and (min-width: 769px) {
    :root {
        --filter-panel-width: 280px;
    }

    .map-section {
        padding: 14px 24px 28px;
    }

    #mapViewContainer {
        min-height: 620px;
    }

    .filter-pannel-header,
    .filter-pannel-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .filter-pannel-header {
        padding-top: 40px;
        padding-bottom: 28px;
    }

    .filter-panel h3 {
        font-size: 19px;
        margin-bottom: 12px;
    }

    .filter-panel p {
        font-size: 13px;
        line-height: 1.45;
    }

    .filter-group {
        margin-bottom: 17px;
    }

    .filter-label {
        font-size: 10px;
        margin-bottom: 9px;
    }

    .filter-input,
    .filter-select {
        height: 38px;
        padding: 0 10px;
        border-radius: 6px;
        font-size: 13px;
    }

    .filter-input.location {
        padding-right: 40px;
    }

    .filter-input-icon > i {
        right: 16px;
        font-size: 12px;
    }

    .btn-explore,
    .btn-clear {
        height: 44px;
        border-radius: 6px;
        font-size: 13px;
    }

    .btn-explore {
        margin-top: 24px;
    }

    .btn-clear {
        border-width: 2px;
        margin-top: 10px;
    }

    .control-btn {
        width: 56px;
        height: 56px;
        border-radius: 12px;
        font-size: 23px;
    }

    .program-counter {
        min-height: 56px;
        padding: 0 24px;
        border-radius: 12px;
        font-size: 18px;
    }

    .map-controls {
        gap: 8px;
    }
}

#map {
    position: absolute;
    top: 0;
    left: var(--filter-panel-width);
    right: 0;
    bottom: 0;
    height: 100%;
    background: var(--sgu-water);
}

/* Partnership landing pages are already scoped by the URL, so the filter panel
   is removed and both map/list results use the full available width. */
body.partnership-query-active .filter-panel {
    display: none;
}

body.partnership-query-active #map {
    left: 0;
}

body.partnership-query-active .list-content,
body.partnership-query-active .list-topbar {
    margin-left: 0;
}

body.partnership-query-active .loading {
    left: 50%;
}

#map.hidden {
    display: none;
}

#mapViewContainer.is-expanded {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    z-index: 1000;
}

#mapViewContainer.is-expanded #map {
    left: 0;
}

#mapViewContainer.is-expanded .filter-panel,
#mapViewContainer.is-expanded .autocomplete-dropdown {
    display: none !important;
}

/* List View Container */
#listView {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: #f5f5f5;
}

#listView.active {
    display: block;
}

.list-content {
    margin-left: var(--filter-panel-width);
    padding: 30px;
    max-width: 1200px;
    min-height: calc(100% - 9rem);
}

/* Program Cards */
.mapboxgl-popup-content .program-card{
    padding: 0;
    padding-left: 24px;
    box-shadow: none;
    border:none;
    margin-bottom:0;
}

.mapboxgl-popup-content .program-card:hover{
    box-shadow: none!important;
    transform: none!important;
}

.mapboxgl-popup-content .program-card::before {
    left: 0px;
    top: 5px;
}

.mapboxgl-popup-content .program-title{
    font-size: 16px;
}


.program-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e5e5;
    position: relative;
    padding-left: 50px;
    transition: all 0.3s;
}

.program-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.program-card::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 28px;
    width: 10px;
    height: 10px;
    background: #FA6400;
    border-radius: 50%;
}

.program-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--sgu-navy);
    margin-bottom: 5px;
    line-height: 1.3;
}

.program-location {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.program-specialties {
    margin-bottom: 5px;
}

.program-specialties-label {
   
    margin-bottom: 5px;
    font-size: 14px;
}

.program-specialties-list {
    font-weight: 600;
    color: var(--sgu-navy);
    font-size: 14px;
    line-height: 1.6;
}

.program-matches {
    display: inline-block;
    font-size: 14px;
    color: #4B5563;
}

.program-matches-title .match-count,
.match-count{
    font-size: 14px;
    font-weight: 600;
    color: var(--sgu-orange);
}

/* Pagination */
.pagination-container {
    background: white;
    border-top: 1px solid #e5e5e5;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--sgu-navy);
    transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #1A1B4B;
}

.pagination-btn.active {
    background: #A7E9E7;
    border-color: #A7E9E7;
    color: var(--sgu-navy);
    font-weight: 700;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: var(--sgu-navy);
    font-size: 14px;
    cursor: pointer;
    margin-left: 16px;
}

.list-topbar {
    margin-left: var(--filter-panel-width);
    padding: 20px 30px 0;
    display: flex;
    justify-content: flex-end;
}

.list-counter {
    font-size: 14px;
    color: var(--sgu-navy);
}

/* Filter Panel */
.filter-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--filter-panel-width);
    background: white;
    border-right: 0;
    border-radius: 16px 0 0 16px;
    box-shadow: none;
    z-index: 5;
    max-height: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d6d9e1 transparent;
}

.filter-panel::-webkit-scrollbar {
    width: 6px;
}

.filter-panel::-webkit-scrollbar-thumb {
    background: rgba(154, 162, 175, 0.5);
    border-radius: 999px;
}

.filter-pannel-header,
.filter-pannel-inner{
    padding: 0 22px;
}

.filter-pannel-inner {
    padding-bottom: 20px;
}

.filter-pannel-header{
    background:#ffffff;
    padding-top: 40px;
    padding-bottom: 12px;
    border-radius: 16px 0 0 0;
}

.filter-panel h3 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.08;
    color: var(--sgu-navy);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.filter-panel p {
    max-width: 360px;
    color: var(--sgu-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-label {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sgu-navy);
    margin-bottom: 9px;
    line-height: 1.22;
}

.filter-label-text {
    display: inline-block;
    white-space: nowrap;
}

.filter-selection-chip {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: var(--sgu-navy);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    padding: 6px 10px;
    text-transform: none;
}

.filter-selection-chip span {
    display: inline-block;
    font-size: 14px;
    line-height: 0;
    margin-left: 6px;
    transform: translateY(1px);
}

.filter-label .filter-label-note {
    color: #c91f4d;
    font-weight: 500;
}

/* Location input icon */
.filter-input-icon {
    position: relative;
}

.filter-autocomplete {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--sgu-line);
    border-radius: 9px;
    box-shadow: 0 12px 28px rgba(26, 27, 75, 0.12);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.open {
    display: block;
}

.autocomplete-item {
    padding: 9px 13px;
    cursor: pointer;
    font-size: 13px;
    color: var(--sgu-navy);
}

.autocomplete-dropdown-info {
    overflow: visible;
    max-height: none;
}

.autocomplete-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.autocomplete-item-label {
    min-width: 0;
}

.autocomplete-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border: 0;
    border-radius: 50%;
    background: #22b8c4;
    color: #ffffff;
    cursor: help;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    line-height: 15px;
    padding: 0;
    text-align: center;
}

.partnership-info-tooltip {
    position: fixed;
    z-index: 3000;
    display: none;
    padding: 14px 16px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(23, 27, 85, 0.2);
    color: var(--sgu-navy);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    pointer-events: none;
}

.partnership-info-tooltip.open {
    display: block;
}

.autocomplete-item-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
}

.autocomplete-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 1px solid #7d88a2;
    border-radius: 5px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}

.autocomplete-item-checkbox.selected .autocomplete-checkbox {
    background: #05bfc4;
    border-color: #05bfc4;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #f5f5f5;
}

.filter-input.location {
    padding-right: 40px;
}

.filter-input-icon > i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sgu-muted);
    pointer-events: auto;
    cursor: pointer;
    font-size: 13px;
}

.filter-input, .filter-select {
    width: 100%;
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--sgu-line);
    border-radius: 9px;
    font-size: 15px;
    font-weight: 400;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #565e6d;
    background: #ffffff;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: #A7E9E7;
    box-shadow: 0 0 0 3px rgba(167, 233, 231, 0.2);
}

.filter-input::placeholder {
    color: #566071;
    opacity: 1;
}

.btn-explore {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: var(--sgu-teal);
    color: #000000;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
    margin-top: 18px;
    box-shadow: 0 6px 14px rgba(178, 235, 238, 0.22);
}

.btn-explore:hover {
    background: #1e1e64;
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

.btn-clear {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: #ffffff;
    border-radius: 8px;
    border: 2px solid var(--sgu-navy);
    color: var(--sgu-navy);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s, color 0.2s;
}

.btn-clear:hover {
    background: #f7f8fb;
    color: var(--sgu-navy);
}

/* Map Utilities */
.program-counter {
    background: white;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(23, 27, 85, 0.12);
    z-index: 99;
    font-size: 14px;
    font-weight: 800;
    color: var(--sgu-navy);
    display: flex;
    align-items: center;
    line-height: 1.2;
    white-space: nowrap;
}

/* Top-right HUD: counter + controls */
.map-topbar {
    position: absolute;
    top: 24px;
    right: 24px;
    bottom: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 6;
    opacity: 1;
    pointer-events: auto;
}

#programCounter {
    display: flex;
}


.search-area-btn {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 24px;
    border-radius: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 99;
    border: none;
    font-size: 14px;
    font-weight: 600;
    background: #1A1B4B;
    color:#fff;
    cursor: pointer;
    transition: all 0.3s;
    white-space:nowrap;
}

@media( max-width: 1250px ) and ( min-width: 769px) {
    .search-area-btn {
        left: calc(100% - 7rem);
    }

    .map-topbar {
        top: 24px;
        right: 24px;
        gap: 8px;
    }

    .program-counter {
        min-height: 44px;
        padding: 0 18px;
        font-size: 15px;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* Custom Map Controls */
.map-controls {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 99;
}

/* Ensure the map view container fills the screen in fullscreen mode */
#mapViewContainer:fullscreen {
    top: 0;
}

#mapViewContainer:-webkit-full-screen {
    top: 0;
}

.control-btn {
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(23, 27, 85, 0.12);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    color: var(--sgu-navy);
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: #f7fbfb;
    transform: scale(1.1);
}

/* Marker Cluster Styles */
.marker-cluster {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sgu-navy);
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.marker-cluster::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: transparent;
    transition: transform 0.2s;
    transform: scale(1);
    pointer-events: none;
}

.marker-cluster:hover::before {
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.marker-cluster-count {
    color: white;
    font-weight: 700;
    font-size: 14px;
}

/* Individual Marker */
.marker {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background-color: var(--sgu-navy);
    border: 4px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
}

.marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background-color: inherit;
    transition: transform 0.2s;
    transform: scale(1);
}

.marker:hover::before {
    transform: scale(1.2);
}

/* Popup Styles */
.mapboxgl-popup-content {
    padding: 0;
    max-width: none;
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(23, 27, 85, 0.18);
    overflow: hidden;
}

.mapboxgl-popup-tip {
    display: none;
}

.partner-popup {
    position: relative;
    width: min(300px, calc(100vw - 28px));
    max-height: min(50vh, 360px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border-top: 5px solid var(--sgu-navy);
    padding: 14px 16px 16px;
    color: var(--sgu-navy);
}

.partner-popup::-webkit-scrollbar {
    width: 6px;
}

.partner-popup::-webkit-scrollbar-track {
    background: #eef1f5;
    border-radius: 999px;
}

.partner-popup::-webkit-scrollbar-thumb {
    background: #9aa2af;
    border: 2px solid #eef1f5;
    border-radius: 999px;
}

.partner-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #9aa2af;
    font-size: 24px;
    font-weight: 300;
    line-height: 0.72;
    cursor: pointer;
    outline: none;
}

.partner-popup-logo {
    display: block;
    width: 110px;
    max-width: calc(100% - 48px);
    max-height: 44px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 10px;
}

.partner-popup-title {
    max-width: 235px;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: 0;
}

.partner-popup-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sgu-navy);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 9px;
}

.partner-popup-location i {
    color: var(--sgu-orange);
    font-size: 11px;
}

.partner-popup-excerpt {
    color: #596274;
    font-size: 11px;
    line-height: 1.38;
    font-weight: 400;
    margin: 0 0 8px;
}

.partner-popup-website {
    display: inline-flex;
    color: var(--sgu-orange);
    font-size: 11px;
    line-height: 1.25;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-bottom: 9px;
}

.partner-popup-primary-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 30px;
    padding: 6px 10px;
    background: var(--sgu-navy);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(23, 27, 85, 0.22);
    font-size: 11px;
    line-height: 1.1;
    font-weight: 800;
    text-decoration: none;
    margin-bottom: 10px;
}

.partner-popup-primary-link i {
    margin-left: auto;
    font-size: 12px;
}

.partner-popup-school {
    margin-top: 10px;
}

.partner-popup-school:first-child {
    margin-top: 0;
}

.partner-popup-school h3 {
    color: var(--sgu-navy);
    font-size: 11px;
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 4px;
}

.partner-popup-type {
    font-size: 9px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.partner-popup-type.academic {
    color: #00a7b5;
}

.partner-popup-type.clinical {
    color: #c4003f;
}

.partner-popup-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 9px;
}

.partner-popup-pill {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 8px;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: #ffffff;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.15;
}

.partner-popup-pill.academic {
    color: #00a7b5;
}

.partner-popup-pill.clinical {
    color: #c4003f;
}

.partner-popup-school-link,
.partner-popup-primary-link[href],
.partner-popup-website[href] {
    cursor: pointer;
}

.partner-popup-school-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 30px;
    padding: 6px 10px;
    background: var(--sgu-navy);
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(23, 27, 85, 0.22);
    font-size: 11px;
    line-height: 1.1;
    font-weight: 800;
    text-decoration: none;
}

.partner-popup-school-link i {
    margin-left: auto;
    font-size: 12px;
}

.mapboxgl-canvas {
    outline: none;
}

.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right {
    display: none;
}

.popup-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--sgu-navy);
    line-height: 1.3;
}

.popup-location {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-location::before {
    content: '📍';
}

.popup-specialities {
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--sgu-navy);
}

.popup-specialities-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--sgu-navy);
    margin-bottom: 8px;
}

.popup-specialities-list {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.popup-matches {
    border-top: 1px solid #e0e0e0;
    padding-top: 12px;
}

.popup-matches-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--sgu-navy);
    margin-bottom: 8px;
}

.match-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    padding: 4px 0;
}

.match-type {
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .map-section {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 32px 16px 40px;
        overflow: hidden;
    }

    .map-section-copy {
        margin-bottom: 34px;
    }

    .map-section-copy h1 {
        font-size: 31px;
        line-height: 1.1;
    }

    .map-section-copy p {
        font-size: 15px;
        line-height: 1.55;
    }

    .header {
        position: static;
        height: auto;
        padding: 0.5rem;
        box-shadow: none;;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        flex-direction: row-reverse;
    }

    .header-counter {
        display: inline-flex !important;
        gap: 6px;
        font-size: 12px;
        padding: 8px 12px;
        white-space: nowrap;
    }

    .header-title {
        font-size: 18px;
        display:none;
    }

    .filter-panel {
        position: relative;
        margin: 0;
        top: auto;
        left: auto;
        bottom: auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        max-height: none;
        overflow: hidden;
        transform: none;
        box-shadow: none;
        border-right: 0;
        border-radius: 10px 10px 0 0;
    }

    .filter-pannel-header {
        padding: 22px 20px 14px;
        border-radius: 10px 10px 0 0;
        max-width: 100%;
    }

    .filter-pannel-inner {
        padding: 0 20px 20px;
        max-width: 100%;
        min-width: 0;
    }

    .filter-panel h3 {
        font-size: 31px;
        line-height: 1.08;
        margin-bottom: 14px;
    }

    .filter-panel p {
        font-size: 16px;
        line-height: 1.45;
    }

    .filter-group {
        margin-bottom: 18px;
    }

    .filter-label {
        font-size: 13px;
        line-height: 1.25;
        margin-bottom: 10px;
        overflow-wrap: anywhere;
    }

    .filter-label span {
        overflow-wrap: anywhere;
    }

    .filter-input,
    .filter-select {
        height: 54px;
        padding: 0 24px;
        font-size: 16px;
        border-radius: 8px;
    }

    .btn-explore,
    .btn-clear {
        height: 56px;
        font-size: 16px;
        border-radius: 8px;
    }

    .btn-explore {
        margin-top: 24px;
    }

    .btn-clear {
        border-width: 2px;
        margin-top: 10px;
    }

    /* With header + filters in flow, map/list should not be fixed overlays */
    #mapViewContainer {
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        height: auto;
        width: 100%;
        min-width: 0;
        max-width: none;
        overflow: hidden;
    }

    #map {
        position: relative;
        left: 0;
        height: 360px;
        width: 100%;
    }

    #listView {
        position: relative;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        overflow-y: visible;
        height: auto;
    }

    /* Use the header counter on mobile instead of the overlay counters */
    #programCounter {
        display: none !important;
    }

    #listCounter {
        display: none !important;
    }

    .map-topbar {
        top: 10px;
        bottom: auto;
        right: 15px;
        gap: 8px;
        flex-direction: row;
        align-items: flex-end;
    }

    .list-topbar {
        margin-left: 0;
        padding: 15px;
        padding-top: 15px;
    }

    .list-counter {
        font-size: 12px;
        padding: 8px 16px;
    }

    .search-area-btn {
        padding: 10px 14px;
    }
    
    .view-toggle-btn{
        padding: 7px 12px;
    }

    .view-toggle-btn span {
        display: none;
    }

    .view-toggle-btn::after {
        content: attr(data-mobile-label);
    }

    .map-controls {
        flex-direction: row;
    }

    /* List view responsive */
    .list-content {
        margin-left: 0;
        padding: 15px;
        padding-top: 15px;
    }

    .list-content.filter-open {
        padding-top: 15px;
    }

    .program-card {
        padding: 16px;
        padding-left: 40px;
        margin-bottom: 15px;
    }

    .program-card::before {
        left: 15px;
        top: 20px;
        width: 8px;
        height: 8px;
    }

    .program-title {
        font-size: 16px;
    }

    .pagination-container {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
        margin-top: 15px;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-select {
        margin-left: 0;
    }
}

.loading {
    position: absolute;
    top: 50%;
    left: calc(var(--filter-panel-width) + (100% - var(--filter-panel-width)) / 2);
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #1A1B4B;
    background: white;
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 2000;
}

@media (max-width: 768px) {
    .loading {
        left: 50%;
        top: auto;
        bottom: 148px;
        max-width: calc(100% - 48px);
        font-size: 15px;
        padding: 16px 24px;
        white-space: nowrap;
    }
}

/* Hide default Mapbox controls */
.mapboxgl-ctrl-top-right {
    display: none;
}

/* Map attribution/copyright text */
.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-attrib a {
    color: #1A1B4B !important;
}

/* The map is always embedded in an iframe, so keep the app pinned to the iframe viewport. */
body {
    overflow: hidden;
}

.map-section {
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.map-section-copy {
    display: block;
    flex: 0 0 auto;
}

#mapViewContainer {
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

#map {
    height: 100%;
}

.loading {
    left: calc(var(--filter-panel-width) + (100% - var(--filter-panel-width)) / 2);
    top: 50%;
    bottom: auto;
}

/* Mobile filters can be taller than the iframe viewport. Let the document
   scroll and keep the map at full height below the filter panel. */
@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .map-section {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    #mapViewContainer {
        height: auto;
        min-height: 0;
        flex: 0 0 auto;
    }

    #map {
        height: 360px;
    }

    .map-topbar {
        top: auto;
        bottom: 302px;
    }

    .loading {
        left: 50%;
        top: auto;
        bottom: 148px;
    }
}
