/* ============================================================
   features.css — Styles for ported features
   Profile, Dating, Gallery, Chat Enhancements, Location, Map
   ============================================================ */

/* Override accent colour to match the site's green/teal theme */
:root {
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-light: rgba(16, 185, 129, 0.1);
    --accent-border: rgba(16, 185, 129, 0.3);

    /* Light-theme defaults for variables used throughout */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --surface-color: #f3f4f6;
    --hover-color: #f3f4f6;
    --border-color: #e5e7eb;
}

/* ── Toast Notifications ──────────────────────────────────── */
.toast-notification {
    position: fixed;
    bottom: calc(var(--bottom-nav-height, 60px) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface-color, #1a1a2e);
    color: var(--text-primary, #fff);
    padding: 10px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 90vw;
}
.toast-notification.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast-success { border-left: 3px solid #22c55e; }
.toast-error { border-left: 3px solid #ef4444; }
.toast-info { border-left: 3px solid #3b82f6; }
.toast-close {
    background: none; border: none; color: var(--text-tertiary); cursor: pointer;
    font-size: 18px; padding: 0; margin-left: 8px;
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border-color, #333);
    border-top-color: var(--accent, #6c5ce7);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.modal-loading, .modal-error {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; padding: 40px; color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════════════
   PROFILE TAB
   ══════════════════════════════════════════════════════════════ */

.profile-tab-content {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* Force the profile tab and its parents to allow scrolling */
#profileTab {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}

/* Ensure mainContent doesn't clip any tab */
#mainContent {
    overflow: visible !important;
    height: 100% !important;
}

/* Make sure .tab-content allows scroll when active */
.tab-content {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    height: calc(100vh - 60px) !important;
    max-height: calc(100vh - 60px) !important;
}

/* Desktop: no bottom nav */
@media (min-width: 769px) {
    .tab-content {
        height: calc(100vh - 0px) !important;
        max-height: calc(100vh - 0px) !important;
    }
}

/* Mobile: extra specificity for scroll */
@media (max-width: 768px) {
    #profileTab.tab-content,
    div#profileTab,
    div.tab-content {
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y !important;
    }
}

.profile-header-section {
    padding: 0 0 16px;
}

.profile-banner {
    height: 140px;
    background: linear-gradient(135deg, #0d9488 0%, #06b6d4 50%, #22d3ee 100%);
    border-radius: 0;
    background-size: cover;
    background-position: center;
    width: 100%;
}
.profile-banner.has-banner .profile-banner-placeholder { display: none; }

.profile-avatar-section {
    display: flex;
    justify-content: center;
    margin-top: -48px;
    position: relative;
    z-index: 2;
}

.profile-avatar-wrapper {
    position: relative;
    width: 96px;
    height: 96px;
}

.profile-avatar-large {
    width: 96px; height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-primary, #0f0f1a);
}

.profile-avatar-placeholder-large {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: var(--accent, #6c5ce7);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 28px; font-weight: 700;
    border: 4px solid var(--bg-primary, #0f0f1a);
}

.avatar-upload-overlay {
    position: absolute;
    bottom: 0; right: 0;
    width: 32px; height: 32px;
    background: var(--accent, #6c5ce7);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #fff;
    border: 2px solid var(--bg-primary, #0f0f1a);
    transition: transform 0.2s;
}
.avatar-upload-overlay:hover { transform: scale(1.1); }

.profile-info-section {
    text-align: center;
    padding: 12px 16px 0;
}

.profile-display-name {
    font-size: 22px; font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0;
}

.profile-username {
    color: var(--text-secondary, #a0a0b8);
    font-size: 14px;
}

.profile-bio {
    color: var(--text-secondary); font-size: 14px;
    margin: 8px 0 0; line-height: 1.5;
}

.profile-meta {
    display: flex; justify-content: center; gap: 16px;
    margin-top: 8px;
}

.profile-meta-item {
    display: flex; align-items: center; gap: 4px;
    color: var(--text-tertiary, #666); font-size: 13px;
}

/* Stats */
.profile-stats-row {
    display: flex; justify-content: center; gap: 32px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color, #222);
}
.profile-stat { text-align: center; cursor: pointer; }
.profile-stat-value { display: block; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.profile-stat-label { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; }

/* Actions */
.profile-actions {
    display: flex; justify-content: center; gap: 12px;
    padding: 12px 16px;
}

.btn-profile-action {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 20px; border: none; border-radius: 20px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.btn-profile-action.btn-primary {
    background: #10b981; color: #fff;
}
.btn-profile-action.btn-primary:hover { filter: brightness(1.1); }
.btn-profile-action.btn-secondary {
    background: #f3f4f6; color: #374151;
    border: 1px solid #e5e7eb;
}
.btn-profile-action.btn-secondary:hover { background: #e5e7eb; }
.btn-profile-action.btn-dating {
    background: linear-gradient(135deg, #ec4899, #f43f5e); color: #fff;
}

/* Profile Strength */
.profile-strength-section {
    padding: 8px 16px;
    display: flex; align-items: center; gap: 10px;
}
.profile-strength-bar {
    flex: 1; height: 6px; background: var(--border-color, #333);
    border-radius: 3px; overflow: hidden;
}
.profile-strength-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), #22c55e);
    border-radius: 3px; transition: width 0.5s;
}
.profile-strength-text { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }

/* Sub-tabs */
.profile-subtabs {
    display: flex; border-bottom: 1px solid var(--border-color, #222);
    padding: 0 16px;
    max-width: 700px;
    margin: 0 auto;
}
.profile-subtab {
    flex: 1; padding: 12px; text-align: center;
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-secondary); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.profile-subtab.active {
    color: var(--accent); border-bottom-color: var(--accent);
}

.profile-subtab-content { 
    padding: 8px 16px; 
    min-height: 200px; 
    max-width: 700px;
    margin: 0 auto;
}
.profile-subtab-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 48px 16px; gap: 8px;
}
.profile-subtab-empty p { color: #6b7280; margin: 0; font-size: 15px; }
.subtle-text { color: #9ca3af; font-size: 13px; }

/* Profile post cards */
.profile-post-card {
    padding: 14px 16px;
    border-bottom: 1px solid #f3f4f6;
}
.profile-post-tribe {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}
.profile-post-content {
    font-size: 15px;
    line-height: 1.5;
    color: #111827;
    word-wrap: break-word;
}
.profile-post-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: #9ca3af;
}


/* ══════════════════════════════════════════════════════════════
   VIEW PROFILE MODAL
   ══════════════════════════════════════════════════════════════ */

.view-profile-photos { position: relative; }
.view-profile-main-photo {
    width: 100%; max-height: 400px; object-fit: cover;
    cursor: pointer; border-radius: 8px;
}
.view-profile-no-photo {
    display: flex; justify-content: center; padding: 32px;
}
.avatar-placeholder-xlarge {
    width: 120px; height: 120px; border-radius: 50%;
    background: var(--accent); display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 40px; font-weight: 700;
}
.view-profile-thumbnails {
    display: flex; gap: 6px; padding: 8px 0; overflow-x: auto;
}
.view-profile-thumbnail {
    width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
    cursor: pointer; opacity: 0.6; transition: opacity 0.2s;
    border: 2px solid transparent;
}
.view-profile-thumbnail.active { opacity: 1; border-color: var(--accent); }

.view-profile-info { padding: 16px 0; }
.view-profile-name { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 0; }
.view-profile-username { color: var(--text-secondary); font-size: 14px; display: block; }
.view-profile-subtitle { color: var(--text-secondary); font-size: 14px; display: block; margin-top: 4px; }

.view-profile-section { margin-top: 16px; }
.view-profile-section h3 {
    font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-tertiary); margin: 0 0 8px;
}
.view-profile-section p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; margin: 0; }
.view-profile-location { display: flex; align-items: center; gap: 4px; color: var(--text-secondary); font-size: 14px; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    padding: 4px 12px; border-radius: 16px; font-size: 13px;
    background: var(--surface-color, #1a1a2e); color: var(--text-secondary);
    border: 1px solid var(--border-color, #333);
}
.tag-accent { background: rgba(16,185,129,0.15); color: var(--accent); border-color: rgba(16,185,129,0.3); }
.tag-pink { background: rgba(236,72,153,0.15); color: #ec4899; border-color: rgba(236,72,153,0.3); }

.shared-tribes-list { display: flex; flex-wrap: wrap; gap: 6px; }
.shared-tribe-badge {
    padding: 4px 12px; border-radius: 16px; font-size: 12px;
    background: rgba(16,185,129,0.1); color: var(--accent);
    cursor: pointer; transition: background 0.2s;
}
.shared-tribe-badge:hover { background: rgba(16,185,129,0.2); }

.view-profile-actions {
    display: flex; gap: 12px; padding: 16px 0;
    border-top: 1px solid var(--border-color, #222);
}


/* ══════════════════════════════════════════════════════════════
   DEMOGRAPHICS / DATING
   ══════════════════════════════════════════════════════════════ */

/* Step Indicator */
.step-indicator { display: flex; justify-content: center; gap: 8px; padding: 16px 0; }
.step-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #d1d5db; transition: all 0.3s;
}
.step-dot.active { background: #ec4899; transform: scale(1.3); }
.step-dot.completed { background: #22c55e; }

/* ── Dating Wizard (Demographics Modal) Pink Theme ─────── */

#demographicsModal .modal-container {
    overflow: hidden;
}

#demographicsModal .modal-header {
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    color: #fff;
    padding: 20px 16px 16px;
    border-bottom: none;
    position: relative;
}

#demographicsModal .modal-header::before {
    content: '✨';
    display: block;
    text-align: center;
    font-size: 36px;
    margin-bottom: 4px;
}

#demographicsModal .modal-header .modal-title {
    color: #fff;
    text-align: center;
    font-size: 20px;
}

#demographicsModal .modal-header .modal-back-btn svg {
    stroke: #fff;
}

/* Pink subtitle under the header */
#demographicsModal .modal-header::after {
    content: 'Help us find your perfect match';
    display: block;
    text-align: center;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin-top: 2px;
}

/* Override the title text */
#demographicsModal .modal-title {
    font-size: 0; /* hide "Dating Preferences" */
}
#demographicsModal .modal-title::after {
    content: 'Set Up Your Dating Profile';
    font-size: 20px;
    font-weight: 700;
}

#demographicsModal .step-indicator {
    padding: 20px 0 8px;
}

#demographicsModal .demo-step h3 {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

#demographicsModal .demo-step p {
    text-align: center;
    color: #6b7280;
}

/* Pink continue button */
#demographicsModal .btn-primary,
#demographicsModal button[onclick*="nextDemoStep"],
#demographicsModal button[onclick*="saveDemographics"] {
    background: linear-gradient(135deg, #ec4899, #f43f5e) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 15px;
}

/* Back button styling */
#demographicsModal button[onclick*="prevDemoStep"] {
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    color: #374151 !important;
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
}

/* Chip styling within dating wizard */
#demographicsModal .chip {
    border-color: #e5e7eb;
    background: #fff;
    color: #374151;
    border-radius: 24px;
    padding: 8px 18px;
}
#demographicsModal .chip:hover {
    border-color: #ec4899;
}
#demographicsModal .chip.selected {
    background: #fff;
    color: #10b981;
    border-color: #10b981;
    font-weight: 600;
}
#demographicsModal .chip.pink.selected {
    color: #ec4899;
    border-color: #ec4899;
    background: rgba(236,72,153,0.05);
}

/* Chips */
.chip {
    display: inline-flex; align-items: center;
    padding: 8px 16px; border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151; font-size: 14px;
    cursor: pointer; transition: all 0.2s;
    user-select: none;
}
.chip:hover { border-color: #10b981; }
.chip.selected {
    background: #fff; color: #10b981;
    border-color: #10b981; font-weight: 600;
}
.chip.pink.selected {
    background: #ec4899; border-color: #ec4899;
}

/* Age range slider */
.range-slider-container {
    padding: 8px 0;
}
.range-slider-container label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; color: #6b7280; margin-bottom: 8px;
}
.range-slider-container input[type="range"] {
    width: 100%; margin: 4px 0;
    accent-color: var(--accent);
}

#demographicsModal .range-slider-container input[type="range"] {
    accent-color: #ec4899;
}

/* Dating badge */
.dating-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 12px; font-size: 11px;
    background: linear-gradient(135deg, #ec4899, #f43f5e); color: #fff;
    font-weight: 600;
}

/* Dating preview card */
.dating-preview-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 12px;
    background: var(--surface-color, #1a1a2e);
    border: 1px solid var(--border-color, #333);
}
.dating-preview-avatar img, .dating-preview-avatar .avatar-placeholder {
    width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
}
.dating-preview-name { font-weight: 600; color: var(--text-primary); }
.dating-preview-detail { font-size: 13px; color: var(--text-secondary); display: block; }


/* ══════════════════════════════════════════════════════════════
   PHOTO GALLERY
   ══════════════════════════════════════════════════════════════ */

.gallery-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 4px; padding: 8px;
}

.gallery-item {
    position: relative; aspect-ratio: 1;
    border-radius: 8px; overflow: hidden; cursor: pointer;
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.2s;
}
.gallery-item:hover img { transform: scale(1.05); }

.gallery-item-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 4px 6px; display: flex; justify-content: space-between;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.visibility-badge {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    padding: 2px 6px; border-radius: 4px; letter-spacing: 0.5px;
}
.badge-public { background: #22c55e; color: #fff; }
.badge-dating { background: #ec4899; color: #fff; }
.badge-private { background: #6b7280; color: #fff; }
.primary-badge { font-size: 9px; color: #fbbf24; font-weight: 700; }

.gallery-upload-slot {
    aspect-ratio: 1; border-radius: 8px;
    border: 2px dashed var(--border-color, #333);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; cursor: pointer; transition: border-color 0.2s;
}
.gallery-upload-slot:hover { border-color: var(--accent); }
.gallery-upload-slot span { font-size: 12px; color: var(--text-tertiary); }
.photo-count { font-size: 11px; }

/* Photo options */
.photo-options-preview { text-align: center; }
.photo-options-preview img {
    max-width: 100%; max-height: 300px; border-radius: 8px;
}
.photo-options-form { padding: 16px 0; }
.photo-option-label {
    font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-tertiary); margin-bottom: 8px; display: block;
}
.photo-visibility-options { display: flex; gap: 8px; margin-bottom: 16px; }
.visibility-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px; border-radius: 8px; border: 1px solid var(--border-color, #333);
    background: var(--surface-color, #1a1a2e); color: var(--text-secondary);
    cursor: pointer; font-size: 12px; transition: all 0.2s;
}
.visibility-btn.active {
    border-color: var(--accent); color: var(--accent);
    background: rgba(16,185,129,0.1);
}
.photo-options-actions { display: flex; flex-direction: column; gap: 8px; }


/* ══════════════════════════════════════════════════════════════
   EMOJI PICKER
   ══════════════════════════════════════════════════════════════ */

.emoji-picker {
    position: absolute; bottom: 100%; left: 0; right: 0;
    background: var(--surface-color, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px 12px 0 0;
    padding: 8px; max-height: 240px; overflow-y: auto;
    z-index: 100; box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.emoji-picker.hidden { display: none; }

.emoji-picker-grid {
    display: grid; grid-template-columns: repeat(10, 1fr);
    gap: 2px;
}
.emoji-btn {
    width: 100%; aspect-ratio: 1;
    background: none; border: none; font-size: 22px;
    cursor: pointer; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.emoji-btn:hover { background: var(--hover-color, #252540); }

@media (max-width: 480px) {
    .emoji-picker-grid { grid-template-columns: repeat(8, 1fr); }
    .emoji-btn { font-size: 20px; }
}


/* ══════════════════════════════════════════════════════════════
   ATTACHMENT MENU
   ══════════════════════════════════════════════════════════════ */

.attachment-menu {
    position: absolute; bottom: 100%; left: 8px;
    background: var(--surface-color, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 12px; padding: 8px; min-width: 160px;
    z-index: 100; box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.attachment-menu.hidden { display: none; }

.attachment-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    color: var(--text-secondary); font-size: 14px;
    cursor: pointer; transition: background 0.15s;
}
.attachment-menu-item:hover { background: var(--hover-color, #252540); }


/* ══════════════════════════════════════════════════════════════
   IMAGE PREVIEW & VIEWER
   ══════════════════════════════════════════════════════════════ */

.image-preview-container {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.image-preview-img { max-width: 100%; max-height: 50vh; border-radius: 8px; }
.image-preview-caption { width: 100%; }
.image-caption-input {
    width: 100%; padding: 10px 14px; border-radius: 8px;
    border: 1px solid var(--border-color, #333);
    background: var(--bg-primary, #0f0f1a);
    color: var(--text-primary); font-size: 14px;
}
.image-preview-actions { display: flex; gap: 12px; width: 100%; justify-content: flex-end; }

.image-viewer-modal {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.95);
    display: none; align-items: center; justify-content: center;
}
.image-viewer-modal.active { display: flex; }
.image-viewer-close {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,0.1); border: none;
    color: #fff; width: 40px; height: 40px; border-radius: 50%;
    font-size: 24px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.image-viewer-img { max-width: 95vw; max-height: 95vh; object-fit: contain; }

/* Message image */
.message-image { cursor: pointer; border-radius: 8px; overflow: hidden; max-width: 280px; }
.message-image img { width: 100%; display: block; border-radius: 8px; }
.message-caption { font-size: 13px; color: var(--text-secondary); margin: 4px 0 0; }
.message-edited { font-size: 11px; color: var(--text-tertiary); margin-left: 4px; }
.message-deleted { opacity: 0.5; }


/* ══════════════════════════════════════════════════════════════
   TYPING INDICATOR
   ══════════════════════════════════════════════════════════════ */

#typingIndicator {
    display: none; align-items: center; gap: 8px;
    padding: 4px 12px; font-size: 13px; color: var(--text-tertiary);
}
.typing-dots { display: flex; gap: 3px; }
.typing-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-tertiary);
    animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}
.typing-text { font-style: italic; }


/* ══════════════════════════════════════════════════════════════
   LOCATION
   ══════════════════════════════════════════════════════════════ */

.location-current, .location-empty {
    display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.location-text { color: var(--text-primary); }
.location-accuracy { color: var(--text-tertiary); font-size: 12px; }
.btn-text {
    background: none; border: none; color: var(--accent);
    cursor: pointer; font-size: 13px; font-weight: 600;
}

.location-editor { display: flex; flex-direction: column; gap: 8px; }
.location-search-wrapper { position: relative; }
.location-search-input {
    width: 100%; padding: 10px 14px 10px 36px; border-radius: 8px;
    border: 1px solid var(--border-color, #333);
    background: var(--bg-primary, #0f0f1a);
    color: var(--text-primary); font-size: 14px;
}
.location-search-icon {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); color: var(--text-tertiary);
}

.location-results { max-height: 200px; overflow-y: auto; }
.location-result-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; cursor: pointer;
    border-radius: 8px; font-size: 14px;
    color: var(--text-secondary); transition: background 0.15s;
}
.location-result-item:hover { background: var(--hover-color, #252540); }
.location-searching, .location-no-results, .location-error {
    padding: 12px; text-align: center; font-size: 13px;
    color: var(--text-tertiary);
}
.location-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.location-privacy-note {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-tertiary); margin: 0;
}


/* ══════════════════════════════════════════════════════════════
   MAP
   ══════════════════════════════════════════════════════════════ */

.map-filters {
    position: absolute; top: 12px; right: 12px; z-index: 1000;
    background: var(--surface-color, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px; padding: 8px 12px;
}
.map-filter-option {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.map-filter-option input { accent-color: var(--accent); }


/* ══════════════════════════════════════════════════════════════
   MATCHES & LIKES
   ══════════════════════════════════════════════════════════════ */

.matches-empty, .likes-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 48px 16px; gap: 12px; text-align: center;
}
.matches-empty h3, .likes-empty h3 {
    color: var(--text-primary); margin: 0;
}
.matches-empty p, .likes-empty p {
    color: var(--text-secondary); margin: 0; font-size: 14px;
}

.match-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color, #222);
}
.match-card:hover { background: var(--hover-color, #252540); }

.match-avatar { position: relative; }
.match-avatar img, .match-avatar .avatar-placeholder {
    width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
}
.match-score {
    position: absolute; bottom: -4px; right: -4px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: #fff; font-size: 10px; font-weight: 700;
    padding: 2px 6px; border-radius: 10px;
    border: 2px solid var(--bg-primary, #0f0f1a);
}

.match-info { flex: 1; min-width: 0; }
.match-name { display: block; font-weight: 600; color: var(--text-primary); }
.match-detail { display: block; font-size: 13px; color: var(--text-secondary); }
.match-shared { display: block; font-size: 12px; color: var(--accent); margin-top: 2px; }
.match-arrow { color: var(--text-tertiary); flex-shrink: 0; }

.like-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #222);
}
.like-avatar img, .like-avatar .avatar-placeholder {
    width: 48px; height: 48px; border-radius: 50%; object-fit: cover; cursor: pointer;
}
.like-info { flex: 1; cursor: pointer; }
.like-name { display: block; font-weight: 600; color: var(--text-primary); }
.like-time { display: block; font-size: 12px; color: var(--text-tertiary); }

.btn-accept-like {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: none; border-radius: 20px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: #fff; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: filter 0.2s;
}
.btn-accept-like:hover { filter: brightness(1.1); }


/* ══════════════════════════════════════════════════════════════
   CONNECTION CELEBRATION
   ══════════════════════════════════════════════════════════════ */

.connection-celebration {
    text-align: center; padding: 24px 16px;
}
.celebration-hearts { font-size: 48px; margin-bottom: 12px; }
.connection-celebration h2 {
    font-size: 28px; color: var(--text-primary); margin: 0 0 8px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.connection-celebration p { color: var(--text-secondary); margin: 0 0 24px; }

.celebration-avatars {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    margin-bottom: 24px;
}
.celebration-avatar img, .celebration-avatar .avatar-placeholder {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    border: 3px solid #ec4899;
}
.celebration-heart { font-size: 32px; }
.celebration-actions { display: flex; flex-direction: column; gap: 10px; }


/* ══════════════════════════════════════════════════════════════
   POST REPLIES
   ══════════════════════════════════════════════════════════════ */

.post-replies {
    border-top: 1px solid var(--border-color, #222);
    padding: 8px 0 8px 16px;
}

.post-reply {
    display: flex; gap: 8px; padding: 8px 0;
}
.reply-avatar img, .reply-avatar .avatar-placeholder-sm {
    width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}
.avatar-placeholder-sm {
    background: var(--accent); display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px; font-weight: 700;
}
.reply-content { flex: 1; min-width: 0; }
.reply-author {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    cursor: pointer;
}
.reply-author:hover { text-decoration: underline; }
.reply-time { font-size: 11px; color: var(--text-tertiary); margin-left: 6px; }
.reply-content p { margin: 2px 0 0; font-size: 14px; color: var(--text-secondary); line-height: 1.4; }

.reply-input-wrapper {
    display: flex; gap: 8px; padding: 8px 0; align-items: center;
}
.reply-input {
    flex: 1; padding: 8px 12px; border-radius: 20px;
    border: 1px solid var(--border-color, #333);
    background: var(--bg-primary, #0f0f1a);
    color: var(--text-primary); font-size: 13px;
}
.reply-send-btn {
    background: none; border: none; color: var(--accent);
    cursor: pointer; padding: 4px;
}


/* ══════════════════════════════════════════════════════════════
   SHARED / UTILITY
   ══════════════════════════════════════════════════════════════ */

.avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: var(--accent, #6c5ce7); color: #fff;
    font-weight: 700; border-radius: 50%;
}

.mention { color: var(--accent); cursor: pointer; font-weight: 600; }
.mention:hover { text-decoration: underline; }

.btn-primary {
    padding: 10px 20px; border: none; border-radius: 8px;
    background: var(--accent); color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: filter 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary {
    padding: 10px 20px; border: 1px solid #e5e7eb; border-radius: 8px;
    background: #f3f4f6; color: #374151;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { background: #e5e7eb; }

.btn-danger {
    padding: 10px 20px; border: 1px solid #ef4444; border-radius: 8px;
    background: rgba(239,68,68,0.1); color: #ef4444;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background 0.2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Online indicator */
[data-online-user]::after {
    content: ''; display: block; width: 8px; height: 8px;
    border-radius: 50%; background: #6b7280;
    position: absolute; bottom: 2px; right: 2px;
    border: 2px solid var(--bg-primary, #0f0f1a);
}
[data-online-user].online::after { background: #22c55e; }

/* Tribe list items */
.tribe-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; cursor: pointer;
    transition: background 0.15s;
}
.tribe-list-item:hover { background: #f9fafb; }
.tribe-list-avatar img, .tribe-avatar-placeholder {
    width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
}
.tribe-avatar-placeholder {
    background: #10b981; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px; font-weight: 700;
}
.tribe-list-info { flex: 1; }
.tribe-list-name { display: block; font-weight: 600; color: #111827; font-size: 15px; }
.tribe-list-members { display: block; font-size: 12px; color: #9ca3af; }

/* Demo steps */
.demo-step { display: none; padding: 16px 0; }
.demo-step h3 { color: var(--text-primary); margin: 0 0 4px; }
.demo-step p { color: var(--text-secondary); font-size: 14px; margin: 0 0 16px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* Upload progress */
.upload-progress { display: none; padding: 8px 0; }
.progress-bar { height: 4px; background: var(--border-color, #333); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; width: 0; }

/* Dating only visibility */
.dating-only { display: none; }


/* ══════════════════════════════════════════════════════════════
   TOKEN & GIFT SYSTEM
   ══════════════════════════════════════════════════════════════ */

/* Gift Options Grid */
.gift-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.gift-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.gift-option:hover {
    border-color: #ec4899;
    background: #fef2f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.15);
}

.gift-option.popular {
    border-color: #ec4899;
    background: #fff5f7;
}

.gift-icon {
    font-size: 48px;
    line-height: 1;
}

.gift-name {
    font-weight: 600;
    color: #111827;
    font-size: 14px;
}

.gift-cost {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Token Packages Grid */
.token-packages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px 0;
}

@media (max-width: 480px) {
    .token-packages {
        grid-template-columns: 1fr;
    }
}

.token-package {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.token-package.popular {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.token-package:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.popular-badge {
    position: absolute;
    top: -10px;
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.token-amount {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.token-bonus {
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 8px;
}

.token-price {
    font-size: 20px;
    color: #6b7280;
    font-weight: 600;
}

.token-value {
    font-size: 11px;
    color: #059669;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Locked Message Button */
.btn-message.locked {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.btn-message.locked:hover {
    background: #fff !important;
    transform: none !important;
}

/* Accept Friend Button in Requests */
.btn-accept-friend {
    padding: 6px 14px;
    border: 1px solid #10b981;
    background: #ecfdf5;
    color: #10b981;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-accept-friend:hover {
    background: #d1fae5;
    border-color: #059669;
}

.btn-accept-friend:active {
    transform: scale(0.95);
}

/* Token Balance Display */
.token-balance {
    text-align: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
}

.token-balance a {
    color: #10b981;
    font-weight: 600;
    text-decoration: none;
}

.token-balance a:hover {
    text-decoration: underline;
}

/* Current Balance Widget */
.current-balance {
    text-align: center;
    padding: 16px;
    background: #f0fdf4;
    border-radius: 12px;
    margin-bottom: 24px;
}

/* Profile Likes Badge */
.profile-likes-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin: 12px 16px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-likes-badge:hover {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.profile-likes-badge:active {
    transform: translateY(0);
}

/* Request Badge in Conversation Item */
.conversation-badge {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 8px;
    background: #f3f4f6;
}