/* ================================================
   Keenks - Dark Modern Dating App Styles
   Mobile First | Bootstrap 5 Compatible
   ================================================ */


:root {
    /* Core Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;
    
    /* Accent Colors */
    --accent-primary: #e63946;
    --accent-secondary: #ff6b7a;
    --accent-gradient: linear-gradient(135deg, #e63946 0%, #ff6b7a 50%, #d62839 100%);
    --accent-glow: rgba(230, 57, 70, 0.4);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Border & Dividers */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    
    /* Status Colors */
    --online: #22c55e;
    --offline: #6b7280;
    --premium: #fbbf24;
    
    /* Spacing */
    --nav-height: 70px;
    --filter-height: 56px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    
    /* Typography */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    
    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-weight: 400;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}

/* ================================================
   AUTHENTICATION SCREEN
   ================================================ */

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh; /* ensure full viewport height incl. mobile UI */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 1000;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

#authScreen {
    background: var(--bg-primary);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 0;
    min-height: 100dvh; /* make auth screen full height */
}
#authScreen {
	position: relative;
	background: url('/img/bg2.png') no-repeat center center/cover;
}

#authScreen::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.55); /* adjust darkness here */
	z-index: 0;
}



.auth-bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(230, 57, 70, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 107, 122, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(230, 57, 70, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.auth-bg-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 20px 20px 40px;
    text-align: center;
    margin: 0 auto;
}

/* Auth Screen Footer Links */
.auth-footer {
    position: fixed;
    left: 0;
    bottom: calc(12px + var(--safe-area-bottom));
    width: 100%;
    z-index: 1002;
    text-align: center;
}

.auth-footer .links {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.auth-footer .separator {
    color: var(--text-muted);
}

/* Utility - Dark Card on Dark Theme */
.card-dark {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}
.card-dark .card-body { color: inherit; }
.card-dark .text-muted { color: var(--text-secondary) !important; }
.card-dark a { color: var(--text-secondary); text-decoration: none; }
.card-dark a:hover { color: var(--text-primary); text-decoration: underline; }

.auth-logo {
    margin-bottom: 24px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    animation: pulse-glow 3s ease-in-out infinite;
}

.logo-icon i {
    font-size: 30px;
    color: white;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--accent-glow);
    }
    50% {
        box-shadow: 0 0 40px var(--accent-glow), 0 0 60px var(--accent-glow);
    }
}

.logo-text {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 500;
    margin: 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.logo-tagline {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Auth Forms */
.auth-form {
    animation: fadeSlideUp 0.5s ease;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.step-indicator .step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-indicator .step.active {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: #fff;
}

.step-indicator .step.completed {
    background: var(--online);
    border-color: var(--online);
    color: #fff;
}

.step-indicator .step-line {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 12px;
    transition: all 0.3s ease;
}

.step-indicator .step-line.active {
    background: var(--accent-gradient);
}

/* City Autocomplete Wrapper */
.city-autocomplete-wrapper {
    position: relative;
}

.pac-container {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    margin-top: 4px;
    z-index: 10000 !important;
}

.pac-item {
    padding: 10px 14px !important;
    color: var(--text-primary) !important;
    border-top: 1px solid var(--border-color) !important;
    cursor: pointer;
}

.pac-item:first-child {
    border-top: none !important;
}

.pac-item:hover,
.pac-item-selected {
    background: var(--bg-tertiary) !important;
}

.pac-icon {
    display: none !important;
}

.pac-item-query {
    color: var(--text-primary) !important;
    font-size: 15px !important;
}

.pac-matched {
    color: var(--accent-secondary) !important;
    font-weight: 600 !important;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Controls Override */
.form-floating > .form-control,
.form-floating > .form-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    height: 52px;
    padding: 14px 14px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
    color: var(--text-primary);
}

.form-floating > label {
    color: var(--text-muted);
    padding: 14px;
    font-size: 15px;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--accent-secondary);
    opacity: 0.8;
    font-size: 12px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Buttons */
.btn-primary {
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    padding: 14px 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-light {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 16px;
    padding: 14px 24px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-switch {
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 15px;
}

.auth-switch a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-switch a:hover {
    color: var(--accent-primary);
}

/* Forgot password link */
.forgot-link { text-align: center; }
.forgot-link-a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}
.forgot-link-a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.city-autocomplete-wrapper .btn-gps {
    position: absolute;
    right: 8px;
    top: 8px;
    height: 36px;
    width: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================================
   MAIN APP CONTAINER
   ================================================ */

#appContainer {
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom));
}

/* Tab Content */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* ================================================
   FILTER BAR
   ================================================ */

.filter-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.filter-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.filter-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.filter-select,
.filter-input {
    flex-shrink: 0;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-body);
    min-width: 90px;
    transition: all 0.2s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.filter-input { width: 130px; }

.filter-input::placeholder {
    color: var(--text-muted);
}

/* ================================================
   USERS GRID
   ================================================ */

#tabSearch {
    padding-top: var(--filter-height);
}

#tabMessages,
#tabAccount {
    padding-top: 0;
}

.users-grid {
    padding: 12px 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    min-height: calc(100dvh - var(--filter-height) - var(--nav-height));
}

.btn-fav-card {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    cursor: pointer;
    z-index: 2; /* ensure above image but below badge area */
}

.btn-fav-card.active { color: var(--premium); background: rgba(0,0,0,0.5); }

.message-item .btn-fav-msg {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
}

.message-item .btn-fav-msg.active { color: var(--premium); }

/* Switch-style filters */
.filter-switch { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; }
.filter-switch .switch {
  appearance: none;
  width: 42px; height: 24px;
  border-radius: 24px;
  background: rgba(255,255,255,0.08); /* lighter than page bg for contrast */
  border: 1px solid rgba(255,255,255,0.18);
  position: relative;
  outline: none; cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* Grow selects to fill available space */
.filter-select {
    flex: 1 1 140px;
}
.filter-more-btn {
  margin-left: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.filter-more { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; width: 100%; }
.filter-group-label { color: var(--text-secondary); font-size: 13px; align-self: center; }
.filter-more-btn i { margin-right: 6px; }

/* Looking-for chips */
.filter-looking-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 100%; overflow-x: auto; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 12px; background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.18); cursor: pointer; font-size: 12px; }
.filter-chip input { appearance: none; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.4); background: transparent; position: relative; }
.filter-chip input:checked { background: var(--accent-primary); border-color: var(--accent-primary); }
.filter-chip input:checked::after { content: '\2713'; position: absolute; color: #fff; font-size: 9px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.filter-switch .switch::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3);
  transition: left 0.2s ease;
}
.filter-switch .switch:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
.filter-switch .switch:checked::after { left: 20px; }
.filter-switch .switch-label { color: var(--text-primary); font-size: 14px; }
.filter-switch .switch-badge {
  display: inline-block;
  min-width: 20px; padding: 2px 6px; margin-left: 4px;
  font-size: 12px; line-height: 1; text-align: center;
  border-radius: 999px; background: var(--accent-primary); color: #fff;
  border: 1px solid transparent;
}

.user-card {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.user-card:active {
    transform: scale(0.97);
}

.user-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.user-card:hover .user-card-image {
    transform: scale(1.05);
}

.user-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 12px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
}

.user-card-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-card-name .online-dot {
    width: 8px;
    height: 8px;
    background: var(--online);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--online);
}

.user-card-info {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-card-info i {
    font-size: 11px;
}

.gender-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
}
.gender-badge i { font-size: 12px; }
.gender-badge.homme { color: #60a5fa; background: rgba(96,165,250,0.15); border-color: rgba(96,165,250,0.25); }
.gender-badge.femme { color: #f472b6; background: rgba(244,114,182,0.15); border-color: rgba(244,114,182,0.25); }
.gender-badge.couple { color: #f59e0b; background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.25); }
.gender-badge.trans { color: #22d3ee; background: rgba(34,211,238,0.15); border-color: rgba(34,211,238,0.25); }
.gender-badge.autre { color: #9ca3af; background: rgba(156,163,175,0.15); border-color: rgba(156,163,175,0.25); }

.user-card-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: auto;
}

.user-card-role.dominant {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
}

.user-card-role.dominÃ© {
    background: rgba(111, 66, 193, 0.9);
    color: #fff;
}

.user-card-role.switch {
    background: rgba(253, 126, 20, 0.9);
    color: #fff;
}

.user-card-role.curieux {
    background: rgba(32, 201, 151, 0.9);
    color: #fff;
}

.user-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-gradient);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================================
   MESSAGES
   ================================================ */
/* Google Sign-In button wrapper (optional) */
#g_id_signin { display: flex; justify-content: center; }

/* Profile completion blocker overlay */
.complete-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
}
.complete-profile-overlay.d-none { display: none !important; }
.complete-profile-overlay .cpo-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}
.complete-profile-overlay .cpo-card {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -40%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: min(92%, 420px);
  text-align: center;
}
.complete-profile-overlay h3 { margin: 0 0 8px 0; }
.complete-profile-overlay p { color: var(--text-secondary); margin-bottom: 16px; }

/* PWA install floating button */
.install-pwa-btn {
    position: fixed;
    right: 16px;
    bottom: calc(var(--nav-height) + 16px + var(--safe-area-bottom));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    z-index: 1100;
}
.install-pwa-btn i { font-size: 18px; }
.install-pwa-btn.d-none { display: none !important; }

/* Close button for PWA install */
.install-pwa-close {
    position: fixed;
    right: 16px;
    bottom: calc(var(--nav-height) + 66px + var(--safe-area-bottom));
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    z-index: 1101;
}
.install-pwa-close.d-none { display: none !important; }

.messages-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    padding: 20px 16px 12px;
    z-index: 10;
}

.messages-header h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    margin: 0;
}

.messages-search {
    width: 100%;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 12px;
    color: var(--text-primary);
}
.messages-search::placeholder { color: var(--text-muted); }

.messages-list {
    padding: 0 12px 12px;
}

.message-item {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.message-item:hover {
    background: var(--bg-tertiary);
}

.message-item.unread {
    border-color: var(--accent-primary);
    background: rgba(230, 57, 70, 0.08);
}

.message-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 14px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.message-item.unread .message-avatar {
    border-color: var(--accent-primary);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-preview {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-item.unread .message-preview {
    color: var(--text-primary);
    font-weight: 500;
}

.message-meta {
    text-align: right;
    flex-shrink: 0;
    margin-left: 12px;
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.message-unread-badge {
    width: 22px;
    height: 22px;
    background: var(--accent-gradient);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* ================================================
   CHAT VIEW
   ================================================ */

#chatView {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: var(--bg-primary);
    z-index: 150;
    display: flex;
    flex-direction: column;
}

.chat-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 160;
}

.btn-back {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 8px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.btn-back:hover {
    background: var(--bg-tertiary);
}

.chat-user-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.chat-user-name {
    font-weight: 600;
    font-size: 17px;
}

.chat-user-status {
    font-size: 12px;
    color: var(--online);
}

.chat-messages {
    flex: 1;
    padding: 80px 12px calc(80px + var(--nav-height) + var(--safe-area-bottom));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-messages::-webkit-scrollbar {
    display: none;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.4;
    animation: bubbleIn 0.3s ease;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-bubble.sent {
    background: var(--accent-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble.received {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-bubble-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.chat-bubble.sent .chat-bubble-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input-container {
    position: absolute;
    bottom: calc(var(--nav-height) + var(--safe-area-bottom));
    left: 0;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    z-index: 101;
}

.chat-input {
    flex: 1;
    height: 48px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0 20px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-body);
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.btn-send {
    width: 64px;
    height: 48px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-chat-tool {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-chat-tool:hover { background: var(--bg-card); }

.emoji-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(var(--nav-height) + var(--safe-area-bottom) + 64px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow-md);
    z-index: 130;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
}

.emoji-grid button {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Draggable helper */
.draggable { cursor: move; touch-action: none; }

.chat-bubble img.chat-image {
    max-width: 260px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    display: block;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.btn-send:active {
    transform: scale(0.95);
}

/* ================================================
   ACCOUNT
   ================================================ */

.account-header {
    padding: 20px 16px 12px;
}

.account-header h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    margin: 0;
}

.account-content {
    padding: 0 16px;
}

.avatar-section {
    text-align: center;
    padding: 20px 0 32px;
}

.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.account-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
}

.avatar-upload-btn i {
    font-size: 18px;
    color: white;
}

.account-pseudo {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 4px;
}

.account-status {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.account-status.premium {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    font-weight: 600;
}

/* Account Menu */
.account-menu {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.account-menu-item {
    display: flex;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.account-menu-item:last-child {
    border-bottom: none;
}

.account-menu-item:hover {
    background: var(--bg-tertiary);
}

.account-menu-item i:first-child {
    width: 24px;
    font-size: 18px;
    color: var(--accent-secondary);
    margin-right: 14px;
}

.account-menu-item span {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.account-menu-item i:last-child {
    font-size: 14px;
    color: var(--text-muted);
}

.account-menu-item.logout {
    color: var(--accent-primary);
}

.account-menu-item.logout i:first-child {
    color: var(--accent-primary);
}

/* Account Panels */
.account-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.account-panel.active {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.panel-content {
    padding: 24px 16px calc(var(--nav-height) + var(--safe-area-bottom) + 24px);
    overflow-y: auto;
    max-height: calc(100dvh - 60px);
}

/* Premium Benefits */
.premium-benefits {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.benefit-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.benefit-item:last-child {
    border-bottom: none;
}

.benefit-item i {
    width: 40px;
    height: 40px;
    background: rgba(230, 57, 70, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent-secondary);
    margin-right: 14px;
}

.benefit-item span {
    font-size: 15px;
    font-weight: 500;
}

/* Subscription Plans */
.subscription-plans {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.plan-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plan-card:hover {
    border-color: var(--accent-primary);
}
.subscription-status .alert { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }

.plan-card.selected {
    border-color: var(--accent-primary);
    background: rgba(230, 57, 70, 0.1);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.plan-badge.best {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}

.plan-duration {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-secondary);
    margin-bottom: 4px;
}

.plan-per-month {
    font-size: 14px;
    color: var(--text-muted);
}

/* ================================================
   USER PROFILE MODAL
   ================================================ */

.user-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.user-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.user-modal .modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 90dvh;
    background: var(--bg-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-modal.active .modal-content {
    transform: translateY(0);
}

.btn-close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
}

.btn-close-modal:hover {
    background: var(--bg-secondary);
}

.btn-fav-profile {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.btn-fav-profile.active { color: var(--premium); }

.btn-block-profile {
    position: absolute;
    top: 16px;
    left: 64px;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.btn-block-profile.active { color: #ff6b6b; }

.modal-scroll {
    max-height: 90dvh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-scroll::-webkit-scrollbar {
    display: none;
}

.profile-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.profile-main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-message-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: calc(100% - 32px);
    z-index: 10;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* Place buttons side-by-side: message wide left, call icon on the right */
#btnMessageUser.profile-message-btn {
  right: 80px; /* leave room for icon button + gap */
  width: auto; /* don't force full width */
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}
#btnCallUser.profile-message-btn {
  bottom: 16px;
  left: auto;
  right: 16px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 11; /* above message button */
}

/* Icon-only button utility */
.btn-icon-only { padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon-only i { margin: 0 !important; font-size: 18px; }

/* Settings panel readability on dark background */
#settingsPanel .panel-content .card.bg-dark {
  border: 1px solid var(--border-color);
}
#settingsPanel .form-check-label {
  color: #fff;
}
#settingsPanel .text-muted {
  color: rgba(255,255,255,0.7) !important;
}
#settingsPanel .form-check-input {
  background-color: transparent;
  border-color: rgba(255,255,255,0.4);
  cursor: pointer;
}
#settingsPanel .form-check-input:checked {
  background-color: #1db954;
  border-color: #1db954;
}


.profile-info {
    padding: 24px 20px calc(var(--safe-area-bottom) + 24px);
}

.profile-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    margin: 0;
}

.profile-age {
    font-size: 24px;
    color: var(--text-secondary);
}

.profile-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 8px;
}

.profile-location i {
    color: var(--accent-secondary);
}

.profile-distance {
    color: var(--text-secondary);
}

.profile-message-btn { backdrop-filter: saturate(140%) blur(6px); border-radius: var(--radius-md); }
.profile-message-btn i { font-size: 18px; }

/* Glossy gradient primary */
/* Lighter backgrounds */
.profile-message-btn.btn-primary {
    background: rgba(230, 57, 70, 0.24);
    border: 1px solid rgba(230, 57, 70, 0.38);
    color: #fff;
}
.profile-message-btn.btn-primary:hover { background: rgba(230, 57, 70, 0.32); }

/* Semi‑transparent glass outline */
.profile-message-btn.btn-outline-light { 
  background: rgba(34, 197, 94, 0.20); /* green glass */
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #fff; 
}
.profile-message-btn.btn-outline-light:hover { 
  background: rgba(34, 197, 94, 0.28); 
  border-color: rgba(34, 197, 94, 0.42); 
}
.profile-message-btn.btn-outline-light:active { transform: scale(.995); }

.profile-lastseen {
    margin-top: 6px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.profile-lastseen i { color: var(--accent-secondary); }

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.profile-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.profile-tag.role {
    background: rgba(230, 57, 70, 0.2);
    color: var(--accent-secondary);
}

.profile-tag:empty {
    display: none;
}

.profile-pratiques {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-pratique-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    backdrop-filter: blur(4px) saturate(120%);
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .05s ease;
}
.profile-pratique-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-secondary);
    box-shadow: 0 0 6px rgba(255, 107, 122, .6);
}
.profile-pratique-tag:hover {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.20);
    color: #fff;
}
.profile-pratique-tag:active { transform: scale(.98); }

#profilePratiquesSection:empty,
#profilePratiquesSection:has(.profile-pratiques:empty) {
    display: none;
}

/* ================================================
   PRATIQUES CHECKBOXES (Profile Edit)
   ================================================ */

.pratiques-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.pratiques-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.pratiques-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

@media (min-width: 360px) {
    .pratiques-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 500px) {
    .pratiques-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.pratique-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.pratique-checkbox:hover {
    background: var(--bg-secondary);
}

.pratique-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 3px;
    margin-right: 6px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.pratique-checkbox input[type="checkbox"]:checked {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
}

.pratique-checkbox input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.pratique-checkbox:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(230, 57, 70, 0.1);
}

.pratique-label {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pratique-checkbox:has(input:checked) .pratique-label {
    color: var(--text-primary);
}

.profile-section {
    margin-bottom: 20px;
}

.profile-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.profile-section p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* ================================================
   BOTTOM NAVIGATION
   ================================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 8px;
    z-index: 300;
}

.nav-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 54px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-btn i {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.nav-btn span {
    font-size: 11px;
    font-weight: 500;
}

.nav-btn.active {
    color: var(--accent-primary);
}

.nav-btn.active i {
    transform: scale(1.1);
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 12px;
    min-width: 18px;
    height: 18px;
    background: var(--accent-gradient);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ================================================
   LOADING SPINNER
   ================================================ */

.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner-border {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

.text-primary {
    color: var(--accent-primary) !important;
}

/* ================================================
   GUEST PROMPT MODAL
   ================================================ */

.guest-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.guest-prompt-overlay.active {
    opacity: 1;
}

.guest-prompt-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.guest-prompt-overlay.active .guest-prompt-modal {
    transform: scale(1) translateY(0);
}

.guest-prompt-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guest-prompt-icon i {
    font-size: 28px;
    color: white;
}

.guest-prompt-modal h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text-primary);
}

.guest-prompt-modal p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px;
    line-height: 1.5;
}

.guest-prompt-buttons {
    display: flex;
    gap: 12px;
}

.guest-prompt-buttons .btn {
    flex: 1;
    padding: 12px 16px;
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.toast-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.toast-body {
    color: var(--text-secondary);
}

/* ================================================
   UTILITIES
   ================================================ */

.d-none {
    display: none !important;
}

.text-accent {
    color: var(--accent-primary);
}

/* ================================================
   RESPONSIVE ADJUSTMENTS
   ================================================ */

@media (min-width: 576px) {
    .users-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .auth-container {
        max-width: 420px;
    }
}

@media (min-width: 768px) {
    .users-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .user-modal .modal-content {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        border-radius: var(--radius-xl);
        max-height: 85vh;
        bottom: 5vh;
    }
    
    .user-modal.active .modal-content {
        transform: translateX(-50%) translateY(0);
    }
}

/* Fullscreen Call Overlay */
#callOverlay.user-modal .modal-content {
    position: fixed;
    inset: 0;
    width: 100vw !important;
    height: 100dvh !important;
    border-radius: 0;
    background: #000;
    transform: none !important;
}
#callOverlay .modal-overlay { display: none; }
#callOverlay #callContainer { position: absolute; inset: 0; width: 100%; height: 100%; }

@media (min-width: 992px) {
    .users-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .chat-input-container {
        bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
    }
}
.chat-status { display: inline-flex; align-items: center; margin-right: 6px; }
.chat-status i { font-size: 14px; vertical-align: middle; }
.chat-status.delivered i { color: rgba(255,255,255,0.6); }
.chat-status.read i { color: var(--accent-primary); }
