/* Expat map page — map layout, community list, admin UI */
.map-section {
    padding: 0 0 2rem;
    position: relative;
}

.map-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.25rem;
    min-height: 620px;
}

@media (max-width: 960px) {
    .map-layout {
        grid-template-columns: 1fr;
    }
}

.map-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-height: 520px;
    position: relative;
}

#mapContainer {
    width: 100%;
    height: 100%;
    min-height: 520px;
}

.list-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 720px;
}

.list-head {
    padding: 1rem 1.125rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 15px;
}

.list-head small {
    display: block;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 12px;
}

.list-body {
    overflow-y: auto;
    flex: 1;
    padding: 10px;
}

.community-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.6);
}

.community-card.active {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.card-main {
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
    word-break: break-word;
}

.card-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.name-en {
    display: block;
    line-height: 1.35;
}

.name-zh {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

.card-meta .name-en {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
}

.card-meta .name-zh {
    font-size: 10px;
}

.info-bilingual .name-en {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}

.info-bilingual .name-zh {
    font-size: 12px;
    margin-top: 3px;
}

.card-count {
    background: var(--light-tertiary);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.card-detail {
    display: none;
    padding: 0 16px 14px;
    border-top: 1px dashed var(--border);
    background: rgba(250, 245, 255, 0.5);
}

.community-card.open .card-detail {
    display: block;
    padding-top: 12px;
}

.years-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.years-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.year-chip {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--dark);
}

.year-chip em {
    font-style: normal;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.map-disclaimer {
    text-align: center;
    padding: 1.5rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.map-disclaimer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.map-disclaimer a:hover {
    text-decoration: underline;
}

/* Admin UI */
.admin-bar {
    display: none;
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    padding: 10px 0;
    font-size: 13px;
}

body.admin-mode .admin-bar {
    display: block;
}

.admin-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-bar strong {
    color: #92400e;
}

.admin-bar span {
    color: #78350f;
}

.admin-btn {
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.admin-btn-primary {
    background: var(--primary);
    color: #fff;
}

.admin-btn-primary:hover {
    background: var(--primary-light);
}

.admin-btn-ghost {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
}

.admin-btn-ghost:hover {
    background: var(--light);
}

.save-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--dark);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.25s;
    z-index: 200;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.save-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.save-toast.error {
    background: #b91c1c;
}

.admin-login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.45);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-login-overlay.open {
    display: flex;
}

.admin-login-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-xl);
}

.admin-login-box h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.admin-login-box p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

.admin-login-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    font-family: inherit;
}

.admin-login-box .row {
    display: flex;
    gap: 10px;
}

.admin-login-box .row .admin-btn {
    flex: 1;
}

.admin-login-err {
    color: #b91c1c;
    font-size: 12px;
    min-height: 18px;
    margin-bottom: 8px;
}

body.admin-mode .map-panel {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
}
