/* Member Profile Editor - Professional CSS */

/* Profile Progress Container */
.profile-progress-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
}

.progress-title {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #F97316, #22C55E);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
}

.progress-text {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
    text-align: center;
    font-style: italic;
}

/* Main Form Container */
.member-edit-profile-form {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
}

/* Section Styling */
.member-form-section {
    margin-bottom: 30px;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.member-form-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Section Headers with Icon */
.member-form-section h6 {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 10px 15px;
    border-radius: 4px;
    margin-left: 0;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.member-form-section h6 i {
    color: #3498db;
    font-size: 16px;
    min-width: 20px;
}

/* Form Field Styling */
.member-form-field {
    margin-bottom: 20px;
}

.member-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.member-form-field input[type="url"] {
    color: #09c; /* Match the blue color used in other fields */
}

.member-form-field input[type="text"],
.member-form-field input[type="email"],
.member-form-field input[type="url"],
.member-form-field input[type="date"],
.member-form-field textarea,
.member-form-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f9f9f9;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.member-form-field input:focus,
.member-form-field textarea:focus,
.member-form-field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    background-color: #fff;
}

/* Instagram field styling */
.instagram-input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.instagram-input-wrapper:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    background-color: #fff;
}

.instagram-prefix {
    padding: 12px 0 12px 12px;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    user-select: none;
    pointer-events: none;
}

.instagram-input-wrapper input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 12px 12px 12px 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.instagram-input-wrapper input:focus {
    outline: none;
    border: none !important;
    box-shadow: none !important;
}

.instagram-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f0f7ff;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #666;
}

.instagram-preview i {
    color: #E4405F;
    font-size: 16px;
}

.instagram-url {
    color: #666;
}

.instagram-username {
    color: #3498db;
    font-weight: 500;
}

.instagram-preview.empty .instagram-username {
    color: #999;
    font-style: italic;
}

/* Instagram field fix */
.member-form-field input[type="url"] {
    width: 100%;
    display: block;
}

/* Required Field Indicator */
.required {
    color: #e74c3c;
    margin-left: 4px;
}

/* Remove old section styles and icons */
.section-basic-info,
.section-contact-info,
.section-additional-info,
.section-travel-preferences {
    position: relative;
    padding-top: 20px;
}

/* Remove old section icons */
.section-icon {
    display: none;
}

/* Name fields row */
.name-fields-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.name-fields-row .name-field {
    flex: 1;
    margin-bottom: 0;
}

/* Profile photo styling */
.profile-photo-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.current-profile-photo {
    margin-right: 20px;
}

.current-profile-photo img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-photo-upload {
    flex: 1;
}

/* Bio/Textarea styling - full width */
textarea {
    width: 100% !important;
    min-height: 120px;
    resize: vertical;
}

/* Custom checkboxes for nationalities */
.nationality-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f9f9f9;
}

.nationality-option {
    display: flex;
    align-items: center;
}

.nationality-option input[type="checkbox"] {
    margin-right: 8px;
}

/* Improved travel preferences spacing */
.travel-preferences-group {
    margin-bottom: 30px;
}

.travel-preferences-group:last-child {
    margin-bottom: 0;
}

/* Radio options styling */
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 5px 0;
    margin-bottom: 25px;
}

.radio-option {
    display: flex;
    align-items: center;
}

.radio-option input[type="radio"] {
    margin-right: 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    outline: none;
    transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked {
    border-color: #3498db;
    border-width: 6px;
}

.radio-option label {
    margin-bottom: 0;
    font-weight: normal;
}

/* Form errors */
.member-form-error, 
.member-field-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 6px;
    padding: 5px 0;
}

.member-form-success {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

/* Submit button */
.member-form-submit {
    margin-top: 30px;
    text-align: right;
}

.member-submit-button {
    background-color: #24B8F4;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.member-submit-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.member-submit-button:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .member-form-section {
        padding: 20px 15px;
    }
    
    .name-fields-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .profile-photo-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .current-profile-photo {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .nationality-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .member-form-submit {
        text-align: center;
    }
}

/* Visual Radio Buttons for Travel Preferences */
.visual-radio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    justify-content: center;
}

.visual-radio-option {
    position: relative;
    flex: 0 0 calc(25% - 15px);
    min-width: 170px;
    cursor: pointer;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.visual-radio-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.visual-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.visual-radio-option.selected {
    border-color: #4A90E2;
    background-color: rgba(74, 144, 226, 0.05);
}

.visual-radio-option .option-image {
    width: 125px;
    height: 125px;
    margin: 0 auto 5px;
}

.visual-radio-option .option-image img {
    max-width: 100%;
    max-height: 100%;
}

.visual-radio-option .option-label {
    font-size: 14px;
    font-weight: 500;
}

/* Add selected indicator */
.visual-radio-option input[type="radio"]:checked + .option-content:after {
    content: "\f058";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: -8px;
    right: -8px;
    color: #4A90E2;
    font-size: 20px;
    background: white;
    border-radius: 50%;
}

/* Option content wrapper */
.option-content {
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .visual-radio-option {
        flex: 0 0 calc(33.33% - 15px);
    }
}

@media (max-width: 480px) {
    .visual-radio-option {
        flex: 0 0 calc(50% - 15px);
    }
}

.country-flag 
{ 
    width: 20px; 
    height: 20px; 
    margin-right: 8px; 
    vertical-align: middle; 
    object-fit: cover; 
}
.nationality-option label 
{ 
    display: flex; 
    align-items: center; 
}

.field-explainer
{
    font-size: 12px;
    font-style: italic;
    color: #686363;
    display: block;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Select2 country dropdown custom styles */
.select2-container--default .select2-results__option {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    padding: 10px 16px;
    min-height: 40px;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #eaf6fd;
    color: #24B8F4;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #24B8F4;
    color: #fff;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    display: flex;
    align-items: center;
    font-size: 1em;
    padding-left: 12px;
    color: #24B8F4;
    font-weight: 500;
    min-height: 48px;
    padding-right: 40px;
}

.select2-container--default .country-thumb {
    width: 24px !important;
    height: 24px !important;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #eee;
    background: #fff;
    display: inline-block;
    vertical-align: middle;
}

.select2-container--default .select2-selection--single {
    min-height: 48px;
    border-radius: 8px;
    border: 1.5px solid #24B8F4;
    box-shadow: none;
    position: relative;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    right: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    font-size: 1.3em;
    cursor: pointer;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    color: #e74c3c;
    background: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    transition: background 0.2s;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    background: #f8d7da;
}

/* ================================
   NATIONALITIES SELECTOR (Custom Multi-Select)
   Styled to match filter-destination component
   ================================ */

/* Main container */
.nationalities-selector {
    position: relative;
    width: 100%;
}

/* Hidden inputs container */
.nationalities-hidden-inputs {
    display: none;
}

/* Input container - matches filter-input-wrapper style */
.nationalities-input-container {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #ffffff;
    padding-right: 30px; /* Space for clear button */
    transition: border-color 0.2s ease;
    min-height: 38px;
}

.nationalities-input-container:focus-within {
    border-color: #26b8f3;
}

/* Icon before input */
.nationalities-input-container::before {
    content: "\f3c5"; /* fa-map-marker-alt - same as filter-destination */
    position: absolute;
    left: 12px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 14px;
    color: #26b8f3;
    pointer-events: none;
    z-index: 1;
}

/* Tags container - inline chips like filter-destination */
.nationalities-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding-left: 32px; /* Space for icon */
    overflow-x: auto;
    max-width: calc(100% - 100px); /* Leave room for input */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nationalities-tags::-webkit-scrollbar {
    display: none;
}

/* When chips are present, remove left padding from input */
.nationalities-input-container:has(.nationalities-tags:not(:empty)) .nationalities-search-input {
    padding-left: 8px !important;
}

/* When no chips, keep icon space */
.nationalities-input-container:has(.nationalities-tags:empty) .nationalities-search-input {
    padding-left: 32px !important;
}

/* Individual tag/chip - flag with country name (clickable to show popover) */
.nationality-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    background: #e8f4fd;
    border: 1px solid #26b8f3;
    border-radius: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nationality-tag:hover {
    background: #d6effc;
    box-shadow: 0 2px 4px rgba(38, 184, 243, 0.2);
}

.nationality-tag-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: none;
    display: block;
    flex-shrink: 0;
}

.nationality-tag-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* Hide the X button on all devices (use popover for removal) */
.nationality-tag-remove {
    display: none;
}

/* Search input inside container - matches filter-destination style */
.nationalities-search-input {
    flex: 1;
    min-width: 80px;
    border: none !important;
    outline: none !important;
    padding: 8px !important;
    font-size: 14px;
    background: transparent !important;
    box-shadow: none !important;
    height: 38px;
    box-sizing: border-box;
}

.nationalities-search-input::placeholder {
    color: #26b8f3;
    font-size: 14px;
}

.nationalities-search-input:focus {
    outline: none;
    box-shadow: none;
}

/* Dropdown arrow/clear button area */
.nationalities-dropdown-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #26b8f3;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s ease;
}

.nationalities-selector.dropdown-open .nationalities-dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Dropdown container - matches where-autocomplete-dropdown */
.nationalities-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
}

/* Dropdown list */
.nationalities-dropdown-list {
    padding: 4px 0;
}

/* Dropdown item - matches autocomplete-item style */
.nationality-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.nationality-dropdown-item:hover,
.nationality-dropdown-item.highlighted {
    background: #f5f5f5;
}

.nationality-dropdown-item.selected {
    background: #e8f4fd;
}

.nationality-dropdown-item.selected .nationality-item-name::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    color: #26b8f3;
    font-size: 11px;
}

.nationality-item-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.nationality-item-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* No results message */
.nationalities-no-results {
    padding: 12px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* ================================
   NATIONALITY POPOVER (Click to view all)
   Matches destination-chip-popover style
   ================================ */

/* Popover container */
.nationality-chip-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    width: 100%;
}

.nationality-chip-popover-content {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

/* Popover item */
.nationality-chip-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    transition: background-color 0.15s ease;
}

.nationality-chip-popover-item:hover {
    background-color: #f8f9fa;
}

.popover-nationality-flag {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #26b8f3;
    flex-shrink: 0;
}

.popover-nationality-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.popover-nationality-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.popover-nationality-type {
    font-size: 12px;
    font-style: italic;
    color: #999;
    opacity: 0.8;
}

.popover-nationality-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    transition: all 0.2s ease;
}

.popover-nationality-remove:hover {
    background-color: #ff4444;
    color: #ffffff;
}

/* Clear all button in popover */
.popover-nationality-clear-all {
    width: calc(100% - 24px);
    margin: 8px 12px 4px;
    padding: 8px 16px;
    background-color: #24B8F4;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popover-nationality-clear-all:hover {
    background-color: #d32f2f;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nationalities-input-container {
        min-height: 38px;
    }

    .nationalities-search-input {
        font-size: 16px !important; /* Prevent iOS zoom */
    }

    .nationalities-search-input::placeholder {
        font-size: 16px !important;
    }

    /* Mobile: Show flag-only chips (24px) */
    .nationality-tag {
        padding: 0;
        background: transparent;
        border: none;
        width: 24px;
        height: 24px;
        border-radius: 50%;
    }

    .nationality-tag:hover {
        background: transparent;
        box-shadow: none;
    }

    .nationality-tag-flag {
        width: 24px;
        height: 24px;
        transition: all 0.2s ease;
    }

    .nationality-tag:hover .nationality-tag-flag {
        box-shadow: 0 0 0 2px rgba(38, 184, 243, 0.4);
        transform: scale(1.1);
    }

    /* Hide country name on mobile */
    .nationality-tag-name {
        display: none;
    }

    .nationalities-dropdown {
        max-height: 200px;
    }

    .nationality-dropdown-item {
        padding: 8px 10px;
    }

    .nationality-item-flag {
        width: 20px;
        height: 20px;
    }

    .nationality-item-name {
        font-size: 13px;
    }
}

/* City Selection Styles */
.city-selection-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.city-selection-wrapper select {
    flex: 1;
}

.city-map-btn {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    padding: 10px 14px !important;
    height: 48px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.city-map-btn:hover:not(:disabled) {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #495057 !important;
}

.city-map-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.city-map-btn .dashicons {
    margin-right: 4px;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* City Map Modal Styles */
.city-map-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.city-map-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.city-map-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.city-map-header {
    background: #f8f9fa;
    color: #333;
    border-bottom: 1px solid #dee2e6;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.city-map-header h6 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.city-map-search {
    flex: 1;
    max-width: 300px;
}

.city-search-field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
}

.city-map-close {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.city-map-close:hover {
    opacity: 0.8;
}

.city-map-close .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.city-map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.city-selection-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.city-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.city-map-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.city-map-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: center;
}

.add-missing-city-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
}

.add-missing-city-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.add-missing-city-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* City Markers */
.city-marker {
    background: transparent !important;
    border: none !important;
}

.city-marker-inner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #24B8F4;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* New city marker styling */
.new-city-marker-icon .city-marker-inner,
.new-city-inner {
    background-color: #24B8F4 !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 0 2px #24B8F4, 0 2px 4px rgba(0,0,0,0.2) !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
}

/* City Selection Popup Styles */
.city-selection-popup .leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.4;
}

/* City Popup */
.city-popup {
    text-align: center;
    padding: 8px;
}

.city-popup strong {
    display: block;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.select-city-btn {
    background: #24B8F4;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.select-city-btn:hover {
    background: #1a8fc4;
}

/* Add City Modal */
.add-city-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
    display: none;
}

.add-city-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.add-city-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.add-city-header {
    background: #f8f9fa;
    color: #333;
    border-bottom: 1px solid #dee2e6;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px 12px 0 0;
}

.add-city-header h6 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.add-city-close {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s;
}

.add-city-close:hover {
    opacity: 0.8;
}

.add-city-body {
    padding: 24px;
    overflow-y: auto;
}

.add-city-search-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.add-city-search-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.add-city-search-field {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

#search-missing-city-btn {
    background: #24B8F4 !important;
    border: 1px solid #24B8F4 !important;
    color: white !important;
    padding: 10px 16px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    cursor: pointer;
    transition: all 0.2s;
}

#search-missing-city-btn:hover {
    background: #1a8fc4 !important;
    border-color: #1a8fc4 !important;
}

.add-city-results {
    max-height: 300px;
    overflow-y: auto;
}

.city-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.city-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s;
}

.city-result-item:hover {
    background: #e9ecef;
}

.city-name {
    font-weight: 500;
    color: #333;
}

.city-region {
    color: #6c757d;
    font-size: 13px;
    margin-left: 8px;
}

.add-this-city-btn {
    background: #24B8F4;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.add-this-city-btn:hover {
    background: #1a8fc4;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .city-selection-wrapper {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .city-map-btn {
        align-self: stretch;
        justify-content: center;
    }
    
    .city-map-modal {
        padding: 10px;
    }
    
    .city-map-modal-content {
        max-height: 90vh;
        border-radius: 8px;
    }
    
    .city-map-header {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .city-map-search {
        max-width: none;
    }
    
    .city-map-close {
        position: absolute;
        top: 16px;
        right: 16px;
    }
    
    .add-city-modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* ================================
   HOME CITY SELECTOR (Single-Select with AJAX Search)
   Full-width selection display similar to Select2
   ================================ */

/* Main container */
.home-city-selector {
    position: relative;
    width: 100%;
}

/* Input container - styled like Select2 */
.home-city-input-container {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid #24B8F4;
    border-radius: 8px;
    background-color: #ffffff;
    min-height: 48px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-city-input-container:focus-within {
    border-color: #24B8F4;
    box-shadow: 0 0 0 2px rgba(36, 184, 244, 0.2);
}

/* Selected city display - full width */
.home-city-selected-display {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 40px 0 12px;
    min-height: 48px;
    overflow: hidden;
}

/* When city is selected, show the selection */
.home-city-selected-display.has-selection {
    gap: 10px;
}

.home-city-selected-display .selected-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.home-city-selected-display .selected-text {
    font-size: 14px;
    font-weight: 500;
    color: #24B8F4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-city-selected-display .placeholder-text {
    font-size: 14px;
    color: #24B8F4;
}

/* Search input - hidden when selection exists, shown when searching */
.home-city-search-input {
    position: absolute;
    top: 0;
    left: 0;
    right: 40px;
    bottom: 0;
    border: none !important;
    outline: none !important;
    padding: 0 12px !important;
    font-size: 14px;
    background: transparent !important;
    box-shadow: none !important;
    box-sizing: border-box;
    opacity: 0;
    z-index: 1;
}

.home-city-search-input:focus {
    opacity: 1;
    background: #fff !important;
}

.home-city-search-input::placeholder {
    color: #24B8F4;
    font-size: 14px;
}

/* Clear button */
.home-city-clear-btn {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    display: none;
    z-index: 2;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.home-city-clear-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.home-city-selector.has-selection .home-city-clear-btn,
.home-city-selector.has-text .home-city-clear-btn {
    display: flex;
}

/* Dropdown arrow */
.home-city-dropdown-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #26b8f3;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s ease;
}

.home-city-selector.dropdown-open .home-city-dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Dropdown container */
.home-city-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
}

/* Dropdown list */
.home-city-dropdown-list {
    padding: 4px 0;
}

/* Dropdown item */
.home-city-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.home-city-dropdown-item:hover,
.home-city-dropdown-item.highlighted {
    background: #f5f5f5;
}

.home-city-dropdown-item.selected {
    background: #e8f4fd;
}

.home-city-dropdown-item.selected .home-city-item-name::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    color: #26b8f3;
    font-size: 11px;
}

.home-city-item-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.home-city-item-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* No results / loading message */
.home-city-no-results,
.home-city-loading {
    padding: 12px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.home-city-loading i {
    margin-right: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .home-city-input-container {
        min-height: 44px;
    }

    .home-city-search-input {
        font-size: 16px !important; /* Prevent iOS zoom */
    }

    .home-city-search-input::placeholder {
        font-size: 16px !important;
    }

    .home-city-selected-display {
        min-height: 44px;
    }

    .home-city-selected-display .selected-text,
    .home-city-selected-display .placeholder-text {
        font-size: 14px;
    }

    .home-city-dropdown {
        max-height: 200px;
    }

    .home-city-dropdown-item {
        padding: 10px 12px;
    }

    .home-city-item-flag {
        width: 20px;
        height: 20px;
    }

    .home-city-item-name {
        font-size: 14px;
    }
}

/* ========================================
   Date Picker Styling (Date of Birth)
   ======================================== */

/* Date wrapper with icon */
.date-range-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-range-wrapper .date-icon {
    position: absolute;
    left: 14px;
    color: #24B8F4;
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

/* Date picker input styling */
.date-picker {
    width: 100%;
    padding: 10px 14px 10px 38px !important;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.date-picker:hover {
    border-color: #24B8F4;
}

.date-picker:focus {
    outline: none;
    border-color: #24B8F4;
    box-shadow: 0 0 0 3px rgba(36, 184, 244, 0.15);
}

.date-picker::placeholder {
    color: #999;
}

/* Hide native date picker controls (calendar icon, clear button, etc.) */
.date-picker::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}

.date-picker::-webkit-clear-button {
    display: none;
    -webkit-appearance: none;
}

.date-picker::-webkit-inner-spin-button {
    display: none;
    -webkit-appearance: none;
}

.date-picker::-webkit-date-and-time-value {
    text-align: left;
}

/* ============================================
   Mobile Keyboard Handling Improvements
   ============================================ */

/* Ensure viewport allows for proper scrolling on mobile */
@media (max-width: 768px) {
    /* Prevent viewport bounce on iOS when keyboard appears */
    body.mobile-keyboard-active {
        position: fixed;
        width: 100%;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure proper spacing around focused fields */
    .member-form-field input:focus,
    .member-form-field textarea:focus {
        scroll-margin-top: 20px;
        scroll-margin-bottom: 250px; /* Space for keyboard + dropdown */
    }

    /* Ensure dropdowns have proper z-index and positioning */
    .nationalities-dropdown,
    .home-city-dropdown {
        position: absolute;
        z-index: 9999;
        max-height: 120px !important; /* Show only 3-4 items on mobile */
    }

    /* Add more spacing below input fields with dropdowns */
    .nationalities-selector,
    .home-city-selector {
        margin-bottom: 30px;
        scroll-margin-bottom: 250px;
    }

    /* Ensure focused fields are visible */
    .nationalities-selector.dropdown-open,
    .home-city-selector.dropdown-open {
        z-index: 10000;
    }

    /* Prevent text inputs from triggering iOS zoom */
    input[type="text"],
    input[type="email"],
    textarea {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }

    /* Add padding to bottom of form when keyboard is active */
    body.mobile-keyboard-active .member-edit-profile-form {
        padding-bottom: 400px; /* Extra space to allow scrolling past keyboard */
    }

    /* Smooth transitions for scroll adjustments */
    html {
        scroll-behavior: smooth;
    }

    /* Ensure calendar dropdown is visible */
    .flatpickr-calendar {
        position: absolute !important;
        max-height: 280px;
        overflow-y: auto;
    }

    /* Date picker field with calendar */
    .date-range-wrapper {
        scroll-margin-bottom: 300px; /* Extra space for calendar */
    }

    /* Improve touch targets for mobile */
    .member-form-field input,
    .member-form-field textarea,
    .nationalities-search-input,
    .home-city-search-input {
        min-height: 44px; /* iOS recommended touch target size */
        padding: 12px 16px;
    }

    /* Ensure dropdowns scroll properly */
    .nationalities-dropdown-list,
    .home-city-dropdown-list {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    /* Further reduce dropdown height on very small screens */
    .nationalities-dropdown,
    .home-city-dropdown {
        max-height: 100px !important; /* Show only 2-3 items on very small screens */
    }

    /* Increase bottom padding for smaller screens */
    body.mobile-keyboard-active .member-edit-profile-form {
        padding-bottom: 500px;
    }

    /* Ensure adequate spacing for form fields */
    .member-form-field {
        margin-bottom: 25px;
    }
}