/* Officials page — captain cards & map modal */
.captains-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: stretch;
}

.captain-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px 24px 28px;
    text-align: center;
    height: 100%;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.captain-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
}

.captain-card:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

.captain-photo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e3a8a 0%, #FFD700 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.35);
}

.captain-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 10px;
    line-height: 1.35;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captain-card .captain-name {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: auto;
    padding-bottom: 12px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.45;
}

.captain-card .captain-name-pending {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-weight: 500;
}

.captain-card .position {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-top: auto;
}

.captain-card .view-map-hint {
    margin-top: 14px;
    font-size: 12px;
    color: #FFD700;
    font-weight: 600;
}

#barangayMapModal .modal-content {
    background: linear-gradient(180deg, #243f8f 0%, #1e3a8a 100%);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 16px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

#barangayMapModal .modal-header {
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
}

#barangayMapModal .modal-title {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
}

#barangayMapModal .modal-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    margin: 6px 0 0;
}

#barangayMapModal .close { color: #fff; opacity: 0.85; font-size: 28px; }

#barangayMapModal .modal-body { padding: 0; position: relative; }

#barangayDetailMap,
.barangay-detail-map {
    width: 100%;
    height: 460px;
    min-height: 320px;
    border-radius: 0;
    position: relative;
    z-index: 1;
    background: #243447;
}

/* Keep Leaflet panes intact — do not override pane z-index (that made the map black). */
#barangayDetailMap.leaflet-container {
    width: 100% !important;
    height: 460px !important;
    background: #243447 !important;
}
#barangayDetailMap img.leaflet-tile,
#barangayDetailMap .leaflet-tile {
    max-width: none !important;
    max-height: none !important;
    width: 256px !important;
    height: 256px !important;
    opacity: 1 !important;
    visibility: visible !important;
}
#barangayDetailMap .leaflet-pane,
#barangayDetailMap .leaflet-map-pane,
#barangayDetailMap .leaflet-tile-pane {
    visibility: visible !important;
    opacity: 1 !important;
}
#barangayDetailMap .leaflet-control-zoom {
    display: none !important;
}

.barangay-map-scope-note {
    margin: 0;
    padding: 10px 16px 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.brgy-hall-pin {
    background: transparent !important;
    border: 0 !important;
}

.brgy-hall-pin-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transform: translateY(-6px);
}

.brgy-hall-pin-inner i {
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: linear-gradient(135deg, #1e3a8a, #FFD700);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    font-size: 16px;
}

.brgy-hall-pin-inner i:before {
    display: inline-block;
    transform: rotate(45deg);
}

.brgy-hall-pin-inner span {
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    color: #FFD700;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.leaflet-popup-content-wrapper {
    background: rgba(30, 58, 138, 0.95);
    color: #fff;
    border-radius: 10px;
}

.leaflet-popup-tip { background: rgba(30, 58, 138, 0.95); }

@media (max-width: 1200px) {
    .captains-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .captains-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
    .captains-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
    #barangayDetailMap { height: 320px; }
}
