*, *::before, *::after {
    box-sizing: border-box;
}

/* ── Rich Text Editor ── */
.rte-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: visible;
    background: #fff;
    position: relative;
}

/* ── Toolbar ── */
.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1px;
    padding: 4px 6px;
    background: #f1f1f1;
    border-bottom: 1px solid #ddd;
    min-height: 38px;
}

/* ── Toolbar buttons ── */
.rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: Georgia, 'Times New Roman', serif;
    color: #888;
    line-height: 1;
    min-width: 30px;
    height: 30px;
    transition: all .12s;
}

.rte-btn:hover {
    background: #dedede;
    color: #444;
    border-color: #c5c5c5;
}

.rte-btn:active {
    background: #ccc;
    color: #333;
}

.rte-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: inherit;
    stroke: currentColor;
    fill: none;
}

/* ── Separator ── */
.rte-sep {
    width: 1px;
    background: #ccc;
    margin: 3px 4px;
    align-self: stretch;
    min-height: 22px;
}

/* ── Format dropdown ── */
.rte-dropdown {
    position: relative;
}

.rte-format-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 3px;
    padding: 3px 8px 3px 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: #666;
    height: 30px;
    min-width: 120px;
    transition: border-color .12s, box-shadow .12s;
}

.rte-format-toggle:hover {
    border-color: #888;
}

.rte-format-toggle:focus {
    outline: none;
    border-color: #5b9dd9;
    box-shadow: 0 0 0 1px #5b9dd9;
}

.rte-format-label {
    flex: 1;
    text-align: left;
    font-style: italic;
}

.rte-caret {
    font-size: 9px;
    color: #777;
}

/* ── Format menu ── */
.rte-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #c8c8c8;
    box-shadow: 0 3px 12px rgba(0,0,0,.15);
    min-width: 260px;
    max-height: 360px;
    overflow-y: auto;
    padding: 0;
}

.rte-dropdown-menu.open {
    display: block;
}

.rte-format-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #eee;
    padding: 8px 14px;
    cursor: pointer;
    font-family: Georgia, 'Times New Roman', serif;
    color: #333;
    transition: background .08s;
}

.rte-format-item:last-child {
    border-bottom: none;
}

.rte-format-item:hover {
    background: #e8e8e8;
}

.rte-format-item h1 { font-size: 1.8em; font-weight: 700; }
.rte-format-item h2 { font-size: 1.45em; font-weight: 700; color: #555; }
.rte-format-item h3 { font-size: 1.2em; font-weight: 700; }
.rte-format-item h4 { font-size: 1.05em; font-weight: 700; }
.rte-format-item h5 { font-size: 0.95em; font-weight: 600; }
.rte-format-item h6 { font-size: 0.85em; font-weight: 600; }
.rte-format-item p   { font-size: 1em; }
.rte-format-item pre { font-family: 'Courier New', monospace; font-size: 0.9em; }

.rte-shortcut {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: #999;
    margin-left: 16px;
    white-space: nowrap;
}

/* ── Color dropdown ── */
.rte-color-dropdown {
    position: relative;
}

.rte-color-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 4px 5px;
    cursor: pointer;
    height: 30px;
    min-width: 38px;
    transition: all .12s;
}

.rte-color-toggle:hover {
    background: #dedede;
    border-color: #c5c5c5;
}

.rte-color-a {
    font-weight: 700;
    font-size: 15px;
    font-family: Georgia, 'Times New Roman', serif;
    color: #888;
    line-height: 1;
}

.rte-color-underline {
    display: block;
    width: 14px;
    height: 3px;
    border-radius: 1px;
    background: #1a1a1a;
    margin-top: -2px;
}

.rte-color-panel {
    padding: 12px !important;
    min-width: 210px;
    max-width: 240px;
}

.rte-color-panel.open {
    display: block !important;
}

.rte-color-label {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.rte-recent-label {
    margin-top: 10px;
}

.rte-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.rte-swatch {
    width: 30px;
    height: 30px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: transform .1s, border-color .1s, box-shadow .1s;
    padding: 0;
}

.rte-swatch:hover {
    transform: scale(1.15);
    border-color: #555;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.rte-swatch-white {
    border-color: #ddd;
}

.rte-swatch-white:hover {
    border-color: #999;
}

/* Custom color row */
.rte-custom-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.rte-custom-label {
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .5px;
    flex-shrink: 0;
}

.rte-color-input {
    width: 34px;
    height: 30px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

.rte-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.rte-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.rte-custom-apply {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background .12s;
    flex-shrink: 0;
}

.rte-custom-apply:hover {
    background: #43a047;
}

/* ── Editable area ── */
.rte-editable {
    padding: 14px 16px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    color: #333;
    line-height: 1.7;
    outline: none;
    min-height: 200px;
    word-wrap: break-word;
}

.rte-editable:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
    pointer-events: none;
    font-style: italic;
}

.rte-editable:focus {
    background: #fcfcfc;
}

.rte-editable h1 { font-size: 1.8em; margin: .5em 0 .3em; font-weight: 700; }
.rte-editable h2 { font-size: 1.45em; margin: .5em 0 .3em; font-weight: 700; }
.rte-editable h3 { font-size: 1.2em; margin: .5em 0 .3em; font-weight: 700; }
.rte-editable h4 { font-size: 1.05em; margin: .4em 0 .2em; font-weight: 700; }
.rte-editable h5 { font-size: .95em; margin: .4em 0 .2em; font-weight: 600; }
.rte-editable h6 { font-size: .85em; margin: .4em 0 .2em; font-weight: 600; }

.rte-editable ul, .rte-editable ol {
    padding-left: 2em;
    margin: .5em 0;
}

.rte-editable li {
    margin-bottom: .2em;
}

.rte-editable blockquote {
    border-left: 4px solid #4caf50;
    margin: .8em 0;
    padding: .5em 1em;
    background: #f9faf9;
    color: #555;
    font-style: italic;
}

.rte-editable a {
    color: #4caf50;
    text-decoration: underline;
}

.rte-editable hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 1em 0;
}

.rte-editable pre {
    background: #f5f5f5;
    padding: .8em;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
}

html, body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    background: #fff;
    color: #1a1a1a;
    line-height: 1.6;
}

a, .btn-link {
    color: #4caf50;
}

.btn-primary {
    color: #fff;
    background-color: #4caf50;
    border-color: #43a047;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #66bb6a;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem;
}

p {
    margin: 0 0 1rem;
}

img {
    max-width: 100%;
    height: auto;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1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jcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ===== Language Selector (Google Translate) ===== */
.lang-dropdown {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 500;
}
.lang-dropdown.open {
    display: block;
}
.lang-option {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    opacity: 0;
}
.lang-dropdown.open .lang-option {
    opacity: 1;
}
.lang-option:hover {
    transform: translate(-50%, -50%) scale(1.25) !important;
}
.lang-flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
/* Hide Google Translate default bar */
.goog-te-banner-frame,
.skiptranslate {
    display: none !important;
}
body {
    top: 0 !important;
}

/* ── Leaflet Members Map Markers ── */
.member-marker {
    background: transparent;
    border: none;
}

.member-marker .marker-pin {
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    background: #4caf50;
    transform: rotate(-45deg);
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.member-popup {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    padding: 0.25rem;
}

.member-popup .popup-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.member-popup .popup-photo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #67B377);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.member-popup .popup-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.member-popup .popup-info strong {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #333;
}

.member-popup .popup-location {
    font-size: 0.75rem;
    color: #888;
}

.member-popup .popup-link {
    font-size: 0.8rem;
    color: #4caf50;
    text-decoration: none;
    font-weight: 500;
}

.member-popup .popup-link:hover {
    text-decoration: underline;
}

/* Self marker (blue) */
.member-marker--self .marker-pin--self {
    background: #2196F3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

.popup-photo-placeholder--self {
    background: linear-gradient(135deg, #1976D2, #42A5F5) !important;
}

.popup-you {
    font-size: 0.75rem;
    color: #2196F3;
    font-weight: 400;
}

.legend-separator {
    color: #ccc;
    margin: 0 0.3rem;
}

.legend-dot--self {
    background: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.25);
}

/* ── Member Search Results Cards ── */
.search-results-count {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.member-card--self {
    border: 2px solid #2196F3;
    background: #f0f8ff;
}

.you-badge {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: #2196F3;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.member-card-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.member-card-initials {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #67B377);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.member-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: hidden;
}

.member-card-info strong {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #333;
}

.member-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tag {
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.tag-nus {
    background: #e8f5e9;
    color: #2e7d32;
}

.tag-exp {
    background: #e3f2fd;
    color: #1565c0;
}

@media (max-width: 600px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }
}
