/* 
   Kerala Chatroom - Find Friends & Real-Time Glass Chat Stylesheet
*/

:root {
    --chat-font: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --handwriting-font: 'Caveat', cursive, sans-serif;
    --pill-nav-bg: rgba(255, 255, 255, 0.28);
    --card-glass: rgba(255, 255, 255, 0.28);
    --card-border: rgba(255, 255, 255, 0.55);
    --name-color: #173247;
    --text-sub: #2e4e66;
    --tag-color: #3b5d77;
    --time-color: #27475f;
    --badge-pink: #f472b6;
    --online-green: #22c55e;
    --away-red: #ef4444;
}

.chat-app-wrapper {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: url('imgs/background.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 28px 16px 40px;
    z-index: 1;
}

.main-content-layout {
    width: 100%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
}

/* APP GLASS HEADER (Branding & Cloud Real-time Status) */
.app-glass-header {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 2px 6px;
}

.header-brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-mini-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.header-app-title {
    font-family: var(--chat-font);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(10, 30, 50, 0.5);
}

.cloud-status-badge {
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 6px 12px;
    font-family: var(--chat-font);
    font-size: 11.5px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.cloud-status-badge:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.pulse-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(0.9); opacity: 0.85; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* TOP NAVIGATION PILL BAR (Find, Community, Profile) */
.top-nav-bar {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin-bottom: 14px;
}

.nav-pill-track {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--pill-nav-bg);
    border: 1.5px solid rgba(255, 255, 255, 0.65);
    border-radius: 28px;
    padding: 5px 6px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 
        0 15px 35px -5px rgba(10, 35, 55, 0.2),
        inset 0 1.5px 2px rgba(255, 255, 255, 0.85);
}

.nav-pill-track::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 30px;
    background: linear-gradient(100deg, 
        rgba(150, 220, 255, 0.6) 0%, 
        rgba(235, 180, 255, 0.45) 45%, 
        rgba(160, 255, 220, 0.55) 100%);
    z-index: -1;
    filter: blur(4px);
    opacity: 0.8;
}

.nav-tab {
    position: relative;
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--chat-font);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--name-color);
    padding: 7px 10px;
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    user-select: none;
}

.nav-tab:hover {
    color: #0b1f2e;
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    color: #0d2638;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.95),
        0 4px 12px rgba(15, 45, 70, 0.12);
}

.badge-unread {
    background: #f43f5e;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5.5px;
    line-height: 1.2;
}

/* Private Chats Header */
.private-chats-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px;
    margin-bottom: 4px;
}

.section-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--name-color);
}

.sub-counter {
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 500;
}

/* FILTER PILLS ROW */
.filter-pills-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
    width: 100%;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 6px 14px;
    font-family: var(--chat-font);
    font-size: 12px;
    font-weight: 500;
    color: var(--name-color);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-pill:hover,
.filter-pill.active {
    background: rgba(255, 255, 255, 0.55);
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* TAB VIEWS */
.tab-view {
    display: none;
    width: 100%;
}

.tab-view.active {
    display: block;
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* PEOPLE FEED - STRANGERS LIST */
.people-feed {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Vertical indicator line */
.people-feed::after {
    content: '';
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: -12px;
    width: 2.5px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

/* Glass User Card */
.person-card {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-glass);
    border: 1.5px solid var(--card-border);
    border-radius: 26px;
    padding: 12px 16px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 
        0 14px 30px -6px rgba(10, 35, 55, 0.22),
        inset 0 1.5px 2px rgba(255, 255, 255, 0.8),
        inset 0 -1px 2px rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, background 0.25s ease;
    overflow: hidden;
}

.person-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1.5px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(170, 230, 255, 0.9) 25%, 
        rgba(240, 190, 255, 0.9) 65%, 
        transparent 100%);
    pointer-events: none;
}

.person-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 18px 36px -4px rgba(8, 30, 48, 0.28),
        inset 0 1.5px 2.5px rgba(255, 255, 255, 0.95);
}

/* Avatar with Country Flag Badge */
.avatar-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    margin-right: 14px;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.country-flag-badge {
    position: absolute;
    bottom: -2px;
    left: -2px;
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.status-indicator.online { background-color: var(--online-green); }
.status-indicator.away { background-color: var(--away-red); }

/* Center Details */
.user-info-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.user-name-signature {
    font-family: var(--handwriting-font);
    font-size: 23px;
    font-weight: 700;
    color: var(--name-color);
    line-height: 1;
    letter-spacing: 0.3px;
}

.pill-badge {
    background: var(--badge-pink);
    color: #ffffff;
    font-family: var(--chat-font);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 1.5px 6px;
    border-radius: 10px;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(244, 114, 182, 0.35);
}

.user-tags-row {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: var(--tag-color);
    margin-bottom: 3px;
    text-transform: uppercase;
}

.user-status-quote {
    font-size: 11.5px;
    color: var(--text-sub);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
}

/* Right Side: Timestamp & Bubble Button */
.card-right-action {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-timestamp {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--time-color);
    letter-spacing: 0.2px;
    user-select: none;
}

.chat-bubble-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, 
        rgba(255, 255, 255, 0.85) 0%, 
        rgba(220, 240, 255, 0.5) 45%, 
        rgba(235, 200, 255, 0.4) 75%, 
        rgba(160, 240, 220, 0.4) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: 
        inset 1px 2px 3px rgba(255, 255, 255, 0.95),
        inset -1px -2px 3px rgba(0, 40, 80, 0.15),
        0 4px 12px rgba(10, 40, 70, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #ffffff;
}

.chat-bubble-btn:hover {
    transform: scale(1.12);
    box-shadow: 
        inset 1px 2px 4px rgba(255, 255, 255, 1),
        0 6px 18px rgba(10, 40, 70, 0.25);
}

.chat-bubble-btn .bubble-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 2px rgba(0, 30, 60, 0.25));
}

/* COMMUNITY TAB */
.community-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.community-card {
    background: var(--card-glass);
    border: 1.5px solid var(--card-border);
    border-radius: 22px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.25s ease;
}

.community-card:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.comm-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--name-color);
    margin-bottom: 2px;
}

.comm-desc {
    font-size: 11.5px;
    color: var(--text-sub);
}

.comm-join-btn {
    background: linear-gradient(180deg, #588ec5, #30659a);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
    padding: 6px 16px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* PROFILE TAB */
.user-profile-card {
    background: var(--card-glass);
    border: 1.5px solid var(--card-border);
    border-radius: 28px;
    padding: 28px 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.profile-avatar-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--name-color);
    margin-bottom: 4px;
}

.user-level-badge {
    display: inline-block;
    background: var(--badge-pink);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.profile-bio {
    font-size: 13px;
    color: var(--text-sub);
    font-style: italic;
    margin-bottom: 22px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.profile-logout-btn {
    display: inline-block;
    background: rgba(220, 38, 38, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 8px 26px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.profile-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.profile-edit-btn {
    background: linear-gradient(180deg, #588ec5, #30659a);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 8px 24px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.profile-edit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

/* Profile Edit Form */
.profile-edit-form {
    text-align: left;
    margin-top: 6px;
}

.edit-profile-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--name-color);
    text-align: center;
    margin-bottom: 2px;
}

.edit-profile-sub {
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 18px;
}

.edit-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 18px;
}

.edit-avatar-preview-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 10px;
}

.edit-avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    background: #e2e8f0;
}

.avatar-upload-trigger {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: #30659a;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, background 0.2s ease;
}

.avatar-upload-trigger:hover {
    transform: scale(1.1);
    background: #1e40af;
}

.photo-upload-label-btn {
    background: rgba(255, 255, 255, 0.55);
    border: 1px dashed #4b7da3;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 11.5px;
    font-weight: 600;
    color: #173247;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-upload-label-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: #30659a;
}

.edit-field-group {
    margin-bottom: 12px;
}

.edit-fields-row {
    display: flex;
    gap: 12px;
}

.col-half {
    flex: 1;
}

.edit-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: #173247;
    margin-bottom: 4px;
}

.edit-input,
.edit-select,
.edit-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    font-size: 13px;
    color: #0f172a;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.edit-input:focus,
.edit-select:focus,
.edit-textarea:focus {
    border-color: #30659a;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 3px rgba(88, 142, 197, 0.25);
}

.edit-textarea {
    resize: vertical;
    min-height: 54px;
}

.edit-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.btn-cancel-edit {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 18px;
    padding: 8px 18px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-edit:hover {
    background: rgba(255, 255, 255, 0.7);
}

.btn-save-profile {
    background: linear-gradient(180deg, #22c55e, #15803d);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    padding: 8px 22px;
    font-size: 12.5px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.3);
    transition: all 0.2s ease;
}

.btn-save-profile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(21, 128, 61, 0.4);
}

/* REAL-TIME CHAT MODAL WINDOW */
.chat-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 20, 35, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chat-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.chat-window-glass {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 640px;
    max-height: 92vh;
    background: rgba(255, 255, 255, 0.32);
    border: 1.5px solid rgba(255, 255, 255, 0.65);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    box-shadow: 
        0 25px 60px rgba(5, 25, 45, 0.4),
        inset 0 1.5px 2px rgba(255, 255, 255, 0.9);
    overflow: hidden;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-modal-backdrop.active .chat-window-glass {
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-back-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--name-color);
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.chat-back-btn:hover {
    transform: translateX(-2px);
}

.chat-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.chat-partner-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
}

.chat-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: var(--online-green);
    border: 2px solid #ffffff;
}

.chat-title-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-partner-name {
    font-family: var(--handwriting-font);
    font-size: 24px;
    font-weight: 700;
    color: var(--name-color);
    line-height: 1;
}

.chat-partner-badge {
    background: var(--badge-pink);
    color: #ffffff;
    font-family: var(--chat-font);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
}

.chat-partner-status {
    font-size: 11px;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--name-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-icon-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.06);
}

/* Chat Messages Area */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chat-timestamp-divider {
    align-self: center;
    font-size: 11px;
    font-weight: 500;
    color: rgba(23, 50, 71, 0.7);
    background: rgba(255, 255, 255, 0.35);
    padding: 3px 12px;
    border-radius: 12px;
    margin: 4px 0;
}

/* Message Bubbles */
.message-bubble {
    max-width: 78%;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.4;
    word-break: break-word;
    border-radius: 18px;
    position: relative;
    animation: bubbleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.message-bubble.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.88);
    color: #1a3348;
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.message-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #4d82b0 0%, #29557c 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 14px rgba(20, 60, 95, 0.25);
}

.message-time {
    display: block;
    font-size: 9.5px;
    margin-top: 4px;
    opacity: 0.75;
    text-align: right;
}

/* Typing Indicator */
.typing-indicator-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 18px;
    background: rgba(255, 255, 255, 0.2);
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #27475f;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
.typing-dot:nth-child(4) { animation-delay: 0.45s; }

.typing-text {
    font-size: 11px;
    color: #27475f;
    font-style: italic;
    margin-left: 4px;
}

/* Quick Icebreaker Chips */
.quick-chips-scroll {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    scrollbar-width: none;
}

.quick-chips-scroll::-webkit-scrollbar {
    display: none;
}

.icebreaker-chip {
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 14px;
    padding: 5px 12px;
    font-family: var(--chat-font);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--name-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.icebreaker-chip:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
}

/* Chat Input Bar */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.chat-tool-btn {
    background: transparent;
    border: none;
    font-size: 19px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s ease;
}

.chat-tool-btn:hover {
    transform: scale(1.15);
}

.chat-text-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 8px 16px;
    font-family: var(--chat-font);
    font-size: 13.5px;
    color: var(--name-color);
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.chat-text-input::placeholder {
    color: rgba(27, 51, 69, 0.6);
}

.chat-text-input:focus {
    background: rgba(255, 255, 255, 0.6);
    border-color: #ffffff;
}

.chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(180deg, #4e82b0, #275279);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(20, 60, 95, 0.25);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.chat-send-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.08);
}

/* Keyframes */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(6px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATION (iPhones, Android, Tablets)
   ========================================================================== */

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-tab, 
    .filter-pill, 
    .person-card, 
    .chat-bubble-btn, 
    .chat-send-btn,
    .icebreaker-chip {
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav-tab:active, 
    .filter-pill:active, 
    .chat-bubble-btn:active {
        transform: scale(0.96);
    }
}

/* Tablet & Smaller Screens (max-width: 768px) */
@media (max-width: 768px) {
    .chat-app-wrapper {
        padding: 16px 12px 30px;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .main-content-layout {
        max-width: 100%;
    }

    .top-nav-bar {
        max-width: 100%;
    }
}

/* Mobile Phones (max-width: 600px) */
@media (max-width: 600px) {
    .chat-app-wrapper {
        padding: max(12px, env(safe-area-inset-top)) 10px max(18px, env(safe-area-inset-bottom));
        min-height: 100dvh;
    }

    .app-glass-header {
        max-width: 100%;
        margin-bottom: 10px;
        padding: 0 4px;
    }

    .header-mini-logo {
        width: 28px;
        height: 28px;
    }

    .header-app-title {
        font-size: 15px;
    }

    .cloud-status-badge {
        padding: 5px 10px;
        font-size: 10.5px;
    }

    /* Navigation Bar */
    .top-nav-bar {
        max-width: 100%;
        margin-bottom: 10px;
    }

    .nav-pill-track {
        padding: 4px;
        border-radius: 22px;
    }

    .nav-tab {
        font-size: 12px;
        padding: 8px 6px;
        min-height: 38px;
        gap: 4px;
    }

    .badge-unread {
        min-width: 16px;
        height: 16px;
        font-size: 9.5px;
        padding: 0 4px;
    }

    /* Filter Pills - Smooth Horizontal Scroll */
    .filter-pills-row {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 2px 2px 8px;
        margin-bottom: 10px;
        flex-wrap: nowrap;
    }

    .filter-pills-row::-webkit-scrollbar {
        display: none;
    }

    .filter-pill {
        flex-shrink: 0;
        font-size: 11.5px;
        padding: 5px 12px;
    }

    /* People Feed & Stranger Cards */
    .people-feed {
        gap: 10px;
    }

    .people-feed::after {
        display: none;
    }

    .person-card {
        padding: 10px 12px;
        border-radius: 18px;
        margin-bottom: 2px;
    }

    .avatar-wrapper {
        width: 46px;
        height: 46px;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .country-flag-badge {
        font-size: 12px;
        bottom: -2px;
        left: -2px;
    }

    .status-indicator {
        width: 11px;
        height: 11px;
        bottom: 0px;
        right: 0px;
    }

    .user-name-signature {
        font-size: 19px;
    }

    .pill-badge {
        font-size: 9.5px;
        padding: 1.5px 6px;
    }

    .user-status-quote {
        font-size: 11.5px;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-timestamp {
        font-size: 10px;
    }

    .chat-bubble-btn {
        width: 36px;
        height: 36px;
    }

    .chat-bubble-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Community View */
    .community-grid {
        gap: 10px;
    }

    .community-card {
        padding: 14px;
        border-radius: 18px;
    }

    .comm-title {
        font-size: 14px;
    }

    .comm-desc {
        font-size: 11.5px;
    }

    .comm-join-btn {
        font-size: 11.5px;
        padding: 6px 14px;
    }

    /* Profile View */
    .user-profile-card {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
    }

    .profile-name {
        font-size: 18px;
    }

    .profile-bio {
        font-size: 12.5px;
    }

    .edit-fields-row {
        flex-direction: column;
        gap: 12px;
    }

    .col-half {
        width: 100%;
    }

    /* FULLSCREEN MOBILE CHAT WINDOW DRAWER */
    .chat-modal-backdrop {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .chat-window-glass {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .chat-window-header {
        padding: max(12px, env(safe-area-inset-top)) 12px 12px;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.35);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-shrink: 0;
    }

    .chat-back-btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 4px;
    }

    .chat-partner-avatar {
        width: 38px;
        height: 38px;
    }

    .chat-partner-name {
        font-size: 15px;
    }

    .chat-partner-status {
        font-size: 11px;
    }

    .chat-messages-area {
        flex: 1;
        padding: 14px 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .message-bubble {
        max-width: 86%;
        font-size: 13.5px;
        padding: 9px 13px;
        border-radius: 16px;
    }

    .quick-chips-scroll {
        padding: 6px 12px;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .quick-chips-scroll::-webkit-scrollbar {
        display: none;
    }

    .icebreaker-chip {
        font-size: 11px;
        padding: 5px 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .chat-input-bar {
        padding: 10px 12px max(12px, env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        gap: 8px;
        flex-shrink: 0;
    }

    .chat-text-input {
        font-size: 14px;
        padding: 10px 14px;
        border-radius: 22px;
    }

    .chat-tool-btn, 
    .chat-send-btn {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
}

/* Extra Small Phones (max-width: 360px - e.g. iPhone SE 1st gen, small Androids) */
@media (max-width: 360px) {
    .nav-tab {
        font-size: 11px;
        padding: 6px 3px;
    }

    .user-name-signature {
        font-size: 17px;
    }

    .user-status-quote {
        max-width: 140px;
    }
}

/* =======================================================
   KERALA PUBLIC COMMUNITY WALL & MEMBERS SIDEBAR
======================================================= */
.community-wall-container {
    width: 100%;
    height: calc(100dvh - 170px);
    min-height: 520px;
    max-height: 680px;
    background: rgba(255, 255, 255, 0.24);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    border-radius: 24px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.community-wall-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}

.community-wall-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.community-wall-icon {
    font-size: 26px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.community-wall-title {
    font-family: var(--chat-font);
    font-size: 15.5px;
    font-weight: 700;
    color: #173247;
    margin: 0;
    line-height: 1.2;
}

.community-wall-status {
    font-size: 11.5px;
    font-weight: 600;
    color: #15803d;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.live-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    display: inline-block;
    animation: pulseGlow 1.8s infinite ease-in-out;
}

/* 3-Bar Online Members Toggle Button */
.community-members-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.45);
    border: 1.2px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--chat-font);
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.community-members-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
}

.hamburger-bars {
    display: flex;
    flex-direction: column;
    gap: 3.5px;
    width: 15px;
}

.hamburger-bars span {
    width: 100%;
    height: 2px;
    background: #173247;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.members-btn-label {
    font-size: 12px;
    font-weight: 700;
    color: #173247;
    letter-spacing: -0.2px;
}

/* Community Wall Body (Messages + Sliding Drawer) */
.community-wall-body {
    flex: 1;
    position: relative;
    display: flex;
    overflow: hidden;
}

.community-messages-stream {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Right-Side Online Members Sidebar / Drawer */
.community-members-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 270px;
    max-width: 82%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-left: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.community-members-sidebar.active {
    transform: translateX(0);
}

.sidebar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 40, 0.3);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 9;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.members-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.6);
}

.members-sidebar-header h4 {
    margin: 0;
    font-family: var(--chat-font);
    font-size: 13.5px;
    font-weight: 700;
    color: #173247;
}

.close-sidebar-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: #173247;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: rgba(0, 0, 0, 0.14);
    transform: scale(1.05);
}

.members-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
}

.community-member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

.community-member-item:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.member-info-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.member-avatar-mini {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #22c55e;
    flex-shrink: 0;
}

.member-text-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.member-name-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #173247;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-place-text {
    font-size: 10.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-dm-btn {
    font-family: var(--chat-font);
    font-size: 11px;
    font-weight: 600;
    background: #173247;
    color: #ffffff;
    padding: 5px 11px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.member-dm-btn:hover {
    background: #0284c7;
    transform: scale(1.04);
}

/* Community Bottom Input Controls */
.community-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
}

/* =======================================================
   MODERN GLASS EMOJI PICKER POPOVER
======================================================= */
.emoji-picker-popover {
    position: absolute;
    bottom: 64px;
    left: 12px;
    right: 12px;
    max-height: 240px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 16px 42px rgba(10, 25, 45, 0.24);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    animation: popoverFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.emoji-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(245, 248, 252, 0.85);
    flex-shrink: 0;
}

.emoji-cat-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.emoji-cat-tabs::-webkit-scrollbar {
    display: none;
}

.emoji-cat-tab {
    font-family: var(--chat-font);
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: none;
    padding: 5px 9px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.emoji-cat-tab:hover {
    background: rgba(0, 0, 0, 0.05);
}

.emoji-cat-tab.active {
    background: #173247;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(23, 50, 71, 0.25);
}

.emoji-picker-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 6px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.emoji-picker-close:hover {
    background: rgba(0, 0, 0, 0.16);
    transform: scale(1.08);
}

.emoji-grid-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 6px;
    -webkit-overflow-scrolling: touch;
}

.emoji-btn-item {
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.emoji-btn-item:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: scale(1.22);
}

.emoji-btn-item:active {
    transform: scale(0.92);
}


