:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --accent-2: #5ae2b2;
    --glow: 0 0 15px rgba(106, 137, 255, 0.3);
    --round: 16px;
    --text-light: #ffffff;
    --text-dark: #1e293b;
    --error: #ef4444;
    --background: #0b1224;
    --surface: #111a2e;
    --surface-light: #1a2540;
    --border: #2a3760;
}

/* ==================== MOBILE PERFORMANCE OPTIMIZATIONS ==================== */
html {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Enable GPU acceleration for animations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    /* Disable body scrolling on mobile */
    overscroll-behavior: none;
    -webkit-user-select: none;
}

/* ==================== LAYOUT ==================== */
.app {
    height: 100%;
    width: 100%;
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
    height: 100%;
    z-index: 1000;
}

.sidebar-header {
    height: 70px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
    height: 100%;
    overflow: hidden;
}

.content-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    flex-shrink: 0;
    height: 70px;
}

.content-header h1 {
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.content-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--background);
}

/* ==================== AUTH PAGES ==================== */
/* ==================== ENHANCED AUTH/HOME PAGE ==================== */

/* Modern Gradient Background */
.auth-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #04091d 0%, #14307c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animated Background Particles */
.auth-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Floating Shapes Animation */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: floatShape 20s infinite linear;
}

.floating-shape:nth-child(1) { width: 300px; height: 300px; top: -100px; left: -100px; }
.floating-shape:nth-child(2) { width: 200px; height: 200px; top: 20%; right: -50px; animation-delay: -5s; }
.floating-shape:nth-child(3) { width: 150px; height: 150px; bottom: -50px; left: 30%; animation-delay: -10s; }

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(100px, 50px) rotate(90deg); }
    50% { transform: translate(0, 100px) rotate(180deg); }
    75% { transform: translate(-100px, 50px) rotate(270deg); }
}

/* Modern Glass Card */
.auth-card {
    background: var(--background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Animation */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 16px;
}

.auth-logo-img {
    width: 56px;
    height: 56px;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 6px 14px rgba(99, 102, 241, 0.35));
}


@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.3));
    }
    50% { 
        transform: scale(1.05); 
        filter: drop-shadow(0 15px 30px rgba(99, 102, 241, 0.4));
    }
}

.auth-logo-text {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.auth-tagline {
    font-size: 16px;
    color: #f3f3f3;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Enhanced Form Elements */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #aab5c8;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.form-group input::placeholder {
    color: #9ca3af;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
}


/* Password visibility toggle */
.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s;
}

.toggle-password:hover {
    color: #6366f1;
}

/* Enhanced Auth Button */
.auth-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.auth-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.auth-btn:active {
    transform: translateY(-1px);
}

.auth-btn::after {
    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.7s;
}

.auth-btn:hover::after {
    left: 100%;
}

/* Toggle between login/register */
.auth-toggle {
    text-align: center;
    margin-top: 30px;
    color: #6b7280;
    font-size: 14px;
}

.auth-toggle a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    margin-left: 8px;
    transition: all 0.3s;
    position: relative;
}

.auth-toggle a:hover {
    color: #8b5cf6;
}

.auth-toggle a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    transition: width 0.3s;
}

.auth-toggle a:hover::after {
    width: 100%;
}

/* Features Showcase */
.features-showcase {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

.features-title {
    text-align: center;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-weight: 600;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.feature-item {
    text-align: center;
    padding: 15px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    transition: all 0.3s;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.feature-item:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.feature-icon {
    font-size: 20px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-text {
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
}

/* Loading Animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-card {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .auth-logo-text {
        font-size: 36px;
    }
    
    .auth-logo-img {
        width: 56px;
        height: 56px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .floating-shape:nth-child(1) { width: 200px; height: 200px; }
    .floating-shape:nth-child(2) { width: 150px; height: 150px; }
    .floating-shape:nth-child(3) { width: 100px; height: 100px; }
}

/* Success/Error States */
.form-group.success input {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.form-group.error input {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.validation-message {
    font-size: 12px;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 6px;
}

.validation-message.success {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.validation-message.error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.content-header {
    backdrop-filter: blur(8px);
    background: rgba(30,41,59,0.85);
}

/* Login Success Animation */
.auth-card.success {
    animation: successPop 0.6s ease;
    border-color: var(--success);
    box-shadow: 0 0 30px rgba(16,185,129,0.5);
}

@keyframes successPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}


/* ==================== USER PROFILE ==================== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
    position: relative;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.user-info h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.user-info p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== SEARCH ==================== */
.search-box {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 45px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--surface);
}

.clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    display: none;
}

.clear-search.show {
    display: block;
}

/* ==================== NAVIGATION ==================== */
.sidebar-nav {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    position: relative;
}

.nav-item:hover {
    background: var(--surface-light);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--glow);
}

.nav-item .badge {
    position: absolute;
    right: 10px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-icon {
    padding: 10px;
    min-width: 40px;
    justify-content: center;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--surface-light);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* ==================== CARDS ==================== */
.card {
    background: var(--surface);
    border-radius: var(--round);
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.1);
}

/* User Cards */
.user-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--surface);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.user-card:hover {
    background: var(--surface-light);
    transform: translateX(4px);
    border-color: var(--primary);
}

.user-card.unread {
    border-left: 3px solid var(--primary);
}

/* ==================== STATUS INDICATORS ==================== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.online {
    background: var(--success);
}

.offline {
    background: var(--text-muted);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--surface);
    box-shadow: 0 0 5px var(--success);
}

/* ==================== FILTER TABS ==================== */
.filter-tabs {
    display: flex;
    gap: 8px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    padding: 8px 16px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-tab:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-tab i {
    margin-right: 5px;
}

/* ==================== CHAT CONTAINER ==================== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 0;
}

/* Chat Header */
.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    background: var(--surface);
    flex-shrink: 0;
    height: 70px;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--surface-light);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.back-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    background: var(--primary);
    flex-shrink: 0;
    border: 2px solid var(--primary);
    box-shadow: var(--glow);
    background-size: cover;
    background-position: center;
}

.chat-header-name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.chat-status {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.status-indicator.offline {
    background: var(--text-muted);
    animation: none;
}

/* ==================== MESSAGES CONTAINER - FIXED FOR SCROLLING ==================== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--background);
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
    min-height: 0;
    position: relative;
}

/* Message bubble */
.message-bubble {
    max-width: 85%;
    min-width: 20%;
    padding: 12px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 15px;
    margin: 2px 0;
    animation: fadeIn 0.3s ease;
    opacity: 0;
    animation-fill-mode: forwards;
}

.message-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message-bubble.received {
    align-self: flex-start;
    background: var(--surface);
    /* border: 1px solid var(--border); */
    border-bottom-left-radius: 4px;
    color: var(--text);
    margin-right: auto;
}

.message-content {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.message-bubble.sent .message-sender {
    display: none;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.message-bubble.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message-bubble.received .message-time {
    color: var(--text-muted);
}

/* Media in messages */
.message-image,
.message-video {
    max-width: 100%;
    max-height: 250px;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    display: block;
    object-fit: cover;
}

.message-audio {
    width: 100%;
    margin: 8px 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.message-bubble.received .message-audio {
    background: var(--surface-light);
}

/* File messages */
.message-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    margin: 5px 0;
    font-size: 14px;
}

.message-bubble.received .message-file {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text);
}

/* Typing indicator */
.typing-indicator {
    align-self: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px 15px;
    margin: 5px 0;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

/* Date separator */
.date-separator {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.date-separator span {
    background: var(--surface);
    color: var(--text-muted);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
}

/* System messages */
.system-message {
    align-self: center;
    background: var(--surface-light);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 12px;
    margin: 5px 0;
    font-style: italic;
    max-width: fit-content;
}

/* Message animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==================== MESSAGE INPUT ==================== */
.message-input-container {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.media-buttons {
    display: flex;
    flex-direction: row;        /* force horizontal */
    align-items: center;
    gap: 8px;
    overflow-x: auto;           /* allow scroll if small screen */
    flex-wrap: nowrap;          /* 🚫 prevent wrapping */
    padding-bottom: 4px;
}


.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 12px 15px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
    transition: all 0.2s;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.send-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.send-btn:not(:disabled) {
    opacity: 1 !important;
    cursor: pointer !important;
    background: var(--primary) !important;
}

.send-btn:not(:disabled):hover {
    background: var(--primary-dark) !important;
    transform: scale(1.05);
}

/* ==================== MEDIA PREVIEW ==================== */
.preview-container {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--surface-light);
    border-radius: 12px;
    border: 2px dashed var(--border);
    display: none;
    position: relative;
}

.preview-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.preview-close:hover {
    transform: scale(1.1);
}

.preview-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    border: 2px solid var(--primary);
}

.preview-video {
    max-width: 250px;
    max-height: 200px;
    border-radius: 10px;
    border: 2px solid var(--primary);
}

/* ==================== ROOMS ==================== */
/* Enhanced Rooms UI */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.room-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.room-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-light);
}

.room-card.room-public {
    border-left: 4px solid var(--success);
}

.room-card.room-private {
    border-left: 4px solid var(--primary);
}

.room-card.room-creator {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.room-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.room-privacy-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.room-privacy-badge.public {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.room-privacy-badge.private {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.room-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.creator-badge {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.room-member-badge {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.room-activity {
    margin: 15px 0;
    padding: 12px;
    background: var(--surface-light);
    border-radius: 12px;
}

.room-activity h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.activity-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

.activity-text {
    font-size: 12px;
    color: var(--text-muted);
}

.room-avatar-container {
    position: relative;
    margin-bottom: 15px;
}

.room-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    overflow: hidden;
    border: 3px solid var(--surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.room-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Room Categories */
.room-categories {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.room-category {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--surface-light);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Quick Stats */
.room-stats {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Room Description */
.room-description {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    margin: 12px 0;
    padding: 12px;
    background: var(--surface-light);
    border-radius: 10px;
    border-left: 3px solid var(--primary);
}

/* Featured Rooms */
.featured-room {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
    border: 2px solid var(--primary-light);
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Discover Rooms Header */
.discover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
    border-radius: 16px;
}

.discover-header-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.discover-header-content p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 600px;
}

.discover-actions {
    display: flex;
    gap: 10px;
}

/* Filter Tabs */
.room-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.filter-tab {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    background: var(--surface-light);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-tab.with-count::after {
    content: attr(data-count);
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
}

/* Room Grid Layout Variations */
.rooms-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.rooms-grid.list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rooms-grid.list .room-card {
    display: flex;
    align-items: center;
    padding: 15px;
}

.rooms-grid.list .room-avatar-large {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin-right: 15px;
    margin-bottom: 0;
}

/* Loading States */
.room-skeleton {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--border) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 15px;
}

.skeleton-text {
    height: 12px;
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--border) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State Enhancement */
.empty-state.rooms-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-radius: 20px;
    border: 2px dashed var(--border);
}

.empty-state.rooms-empty i {
    font-size: 64px;
    color: var(--primary-light);
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state.rooms-empty h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.empty-state.rooms-empty p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .discover-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .discover-actions {
        width: 100%;
        justify-content: center;
    }
    
    .room-filter-tabs {
        justify-content: flex-start;
        padding: 10px;
    }
}
/* In your styles.css */
.content-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Remove any max-height or overflow hidden from .main-content */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Ensure rooms grid is scrollable when needed */
.rooms-grid {
    max-height: calc(100vh - 200px); /* Adjust based on your header height */
    overflow-y: auto;
    padding-right: 10px; /* Space for scrollbar */
}
/* Filter tabs */
.room-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.filter-tab {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    background: var(--surface-light);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-tab.with-count::after {
    content: attr(data-count);
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
}
/* ==================== KEBAB MENU ==================== */
.kebab-menu {
    position: relative;
    display: inline-block;
}

.kebab-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.kebab-btn:hover {
    background: var(--surface-light);
}

.kebab-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 160px;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: modalSlide 0.2s ease;
}

.kebab-dropdown.show {
    display: block;
}

.kebab-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

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

.kebab-item:hover {
    background: var(--surface-light);
}

.kebab-item.danger {
    color: var(--danger);
}

.kebab-item.danger:hover {
    background: var(--danger);
    color: white;
}

/* ==================== MODALS ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--round);
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
    animation: modalSlide 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 35px;
    cursor: pointer;
    background: var(--danger);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    transform: scale(1.1);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Meme Modal */
.meme-content {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--round);
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
}

.meme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.meme-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.meme-item:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.meme-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--surface);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--info);
}

/* ==================== LOADING ==================== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    height: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--surface-light) 25%, var(--surface) 50%, var(--surface-light) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 80px;
    margin-bottom: 10px;
}

.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text);
}

/* ==================== SCROLLBARS ==================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    /* Sidebar for mobile */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 66%;
        max-width: 400px;
        height: 100vh;
        z-index: 1000;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

    .sidebar.active ~ .main-content .sidebar-overlay {
        display: block;
    }

    /* Content adjustments */
    .content-header {
        padding: 15px;
        height: 60px;
    }

    .content-header h1 {
        font-size: 1.25rem;
    }

    /* Messages on mobile */
    .messages-container {
        padding: 12px;
        gap: 6px;
    }

    .message-bubble {
        max-width: 88%;
        padding: 10px 12px;
        font-size: 14px;
    }

    .chat-header {
        padding: 12px 15px;
        height: 60px;
    }

    .chat-header-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .chat-header-name {
        font-size: 14px;
    }

    /* Message input on mobile */
    .message-input-container {
        padding: 12px 15px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .icon-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .message-input {
        font-size: 16px;
    }

    .send-btn {
        width: 50px;
        height: 50px;
    }

    /* Rooms grid on mobile */
    .rooms-grid {
        grid-template-columns: 1fr;
    }

    /* Filter tabs on mobile */
    .filter-tabs {
        padding: 10px;
    }

    /* Buttons on mobile */
    .btn {
        font-size: 13px;
        padding: 8px 12px;
    }
}
/* ================= KEBAB MENU ================= */

.kebab-menu {
    position: relative;
}

.kebab-btn {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
}

.kebab-btn:hover {
    background: rgba(255,255,255,0.1);
}

.kebab-dropdown {
    position: absolute;
    right: 0;
    top: 36px;
    min-width: 200px;
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid #334155;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    display: none;
    z-index: 9999;
    overflow: hidden;
}

.kebab-dropdown.show {
    display: block;
}

.kebab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    transition: background 0.2s;
}

.kebab-item:hover {
    background: rgba(255,255,255,0.08);
}

.kebab-item.danger {
    color: #ef4444;
}

.kebab-item i {
    width: 16px;
    text-align: center;
}

/* Important: allow dropdown overflow */
.chat-header {
    overflow: visible !important;
}


/* Extra small devices */
@media (max-width: 375px) {
    .message-bubble {
        max-width: 90%;
        padding: 8px 10px;
        font-size: 13px;
    }

    .chat-header {
        padding: 8px 12px;
        height: 56px;
    }

    .message-input-container {
        padding: 10px 12px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .media-buttons {
        gap: 6px;
        margin-bottom: 10px;
    }
}

/* Mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-header {
        height: 50px;
        padding: 8px 12px;
    }

    .messages-container {
        padding: 10px;
    }

    .message-bubble {
        max-width: 75%;
        padding: 8px 10px;
    }

    .message-input-container {
        padding: 8px 12px;
    }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .app,
    .chat-container {
        height: -webkit-fill-available;
    }
}

/* Fix for safe areas on modern mobile browsers */
@supports (padding: max(0px)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .chat-header {
        padding-top: max(15px, env(safe-area-inset-top));
    }
    
    .message-input-container {
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}

/* Prevent iOS bounce/overscroll */
html {
    overscroll-behavior: none;
}

body {
    overscroll-behavior-y: none;
}

/* Fix for iOS input zoom */
@media screen and (max-width: 768px) {
    input, textarea, select {
        font-size: 16px;
    }
}

/* Ensure text color in inputs */
input, textarea {
    color: var(--text) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
}

/* ==================== MEME MODAL FIX ==================== */
.meme-modal {
    position: fixed;
    inset: 0;                     /* top:0 left:0 right:0 bottom:0 */
    background: rgba(0,0,0,0.8);
    display: none;               /* hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 99999;              /* above everything */
    backdrop-filter: blur(4px);
}

/* 🧼 Sticker messages – no bubble */
.message-bubble.sticker-message {
    background: transparent !important;
    padding: 2px !important;
    box-shadow: none !important;
    border: none !important;
}

.message-bubble.sticker-message img {
    max-width: 140px;
    border-radius: 8px;
    background: transparent;
}


.room-info-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    border: 1px solid var(--border);
}

.room-info-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.room-info-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.room-info-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
}

.room-info-details {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-info-section {
    margin-bottom: 20px;
}

.room-info-section h4 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-small {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
}

.member-avatar {
    flex-shrink: 0;
}
.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Room privacy badges */
.room-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
}

.room-privacy-badge.private {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.room-privacy-badge.public {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Room card styles */
.room-card.room-private {
    border-left: 4px solid var(--primary);
}

.room-card.room-public {
    border-left: 4px solid var(--text-muted);
}

/* Copy button */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text);
}

/* Recording animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.fa-microphone.recording {
    animation: pulse 1s infinite;
    color: var(--error) !important;
}

/* Audio recording preview */
.recording-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--error);
    margin-left: 10px;
}

.recording-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

/* Add to your CSS file */
.pulse-ring {
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }
}

.btn-icon {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
/* Instagram-style Audio Message Styles */

.audio-message-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    min-width: 280px;
    max-width: 350px;
    transition: all 0.3s ease;
}

.message-bubble.sent .audio-message-container {
    background: rgba(255, 255, 255, 0.15);
}

.audio-message-container.playing {
    background: rgba(99, 102, 241, 0.2);
}

.audio-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.audio-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.audio-play-btn:active {
    transform: scale(0.95);
}

.audio-play-btn i {
    color: white;
    font-size: 14px;
    transition: all 0.2s ease;
}

.audio-waveform-container {
    flex: 1;
    position: relative;
    height: 36px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.audio-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
    width: 100%;
}

.waveform-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: all 0.3s ease;
    min-width: 2px;
}

.audio-message-container.playing .waveform-bar {
    background: var(--primary);
    animation: waveAnimation 1s ease-in-out infinite;
}

@keyframes waveAnimation {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.waveform-bar:nth-child(2n) {
    animation-delay: 0.1s;
}

.waveform-bar:nth-child(3n) {
    animation-delay: 0.2s;
}

.audio-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0.3;
    border-radius: 4px;
    transition: width 0.1s linear;
    pointer-events: none;
}

.audio-duration {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    min-width: 45px;
    justify-content: flex-end;
}

.message-bubble.sent .audio-duration {
    color: rgba(255, 255, 255, 0.9);
}

/* Hide default audio element */
.audio-message-container audio {
    display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .audio-message-container {
        min-width: 240px;
        max-width: 280px;
        gap: 10px;
        padding: 10px 12px;
    }
    
    .audio-play-btn {
        width: 36px;
        height: 36px;
    }
    
    .audio-play-btn i {
        font-size: 12px;
    }
    
    .audio-waveform-container {
        height: 32px;
    }
    
    .waveform-bar {
        min-width: 1.5px;
        gap: 1.5px;
    }
}

/* Sticker message adjustments */
.sticker-message .message-image {
    max-width: 150px !important;
    max-height: 150px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

.sticker-message {
    background: transparent !important;
    padding: 5px !important;
    box-shadow: none !important;
}

/* Smooth transitions for all interactive elements */
.audio-message-container * {
    transition: all 0.2s ease;
}

/* Loading state for audio */
.audio-message-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.audio-message-container.loading .audio-play-btn {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== IN-APP NOTIFICATIONS ==================== */

.in-app-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    min-width: 320px;
    max-width: 400px;
    display: flex;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.in-app-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.in-app-notification:hover {
    background: var(--surface-light);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-body {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* ==================== ENHANCED IMAGE PREVIEW ==================== */

.enhanced-preview {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface-light);
    border-bottom: 1px solid var(--border);
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
}

.preview-size {
    color: var(--text-muted);
    font-size: 12px;
}

.preview-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.preview-close:hover {
    background: var(--danger);
    color: white;
}

.preview-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--background);
    min-height: 200px;
    max-height: 400px;
}

.preview-image-large {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    transition: transform 0.3s;
}

.preview-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface-light);
    border-top: 1px solid var(--border);
}

.preview-actions .btn {
    flex: 1;
}

.preview-caption {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

/* ==================== SEND BUTTON ENHANCEMENTS ==================== */

.send-btn {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.send-btn.recording {
    animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.attachment-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

.char-counter {
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 11px;
    color: var(--text-muted);
    transition: all 0.2s;
}

/* ==================== ONLINE PRESENCE ==================== */

.presence-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    transition: all 0.3s;
}

.presence-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: presencePulse 2s infinite;
}

.presence-indicator.offline {
    background: var(--text-muted);
}

@keyframes presencePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ==================== GROUP MEMBERS MODAL ==================== */

.group-members-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.group-members-content {
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.members-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-light);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.member-card:hover {
    background: var(--surface);
    transform: translateX(4px);
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
    position: relative;
}

.member-presence-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--surface-light);
}

.member-presence-indicator.online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.member-presence-indicator.offline {
    background: var(--text-muted);
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
}

.member-username {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 4px;
}

.member-status {
    font-size: 11px;
}

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

/* ==================== MENTION SYSTEM ==================== */

.mention-dropdown {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border);
}

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

.mention-item:hover,
.mention-item.selected {
    background: var(--surface-light);
}

.mention-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.mention-info {
    flex: 1;
}

.mention-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}

.mention-username {
    font-size: 11px;
    color: var(--primary);
}

/* Mention highlights in messages */
.mention {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.mention:hover {
    background: rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.mention-me {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
    animation: mentionHighlight 1s ease;
}

@keyframes mentionHighlight {
    0%, 100% {
        background: rgba(16, 185, 129, 0.15);
    }
    50% {
        background: rgba(16, 185, 129, 0.3);
    }
}

.mention-other {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ==================== MOBILE RESPONSIVE ==================== */

@media (max-width: 768px) {
    .in-app-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .enhanced-preview {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .preview-image-container {
        max-height: 300px;
    }
    
    .group-members-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .mention-dropdown {
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
    }
    
    .member-card {
        padding: 10px;
    }
    
    .member-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* ==================== SMOOTH TRANSITIONS ==================== */

* {
    -webkit-tap-highlight-color: transparent;
}

button, .btn, .icon-btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    .icon-btn, .send-btn, .back-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .mention-item, .member-card {
        min-height: 56px;
    }
}

/* Add to your existing styles.css */

/* Unread badge in chat list */
.user-avatar {
    position: relative;
}

.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--surface);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.user-card.unread {
    background: var(--surface-light);
    border-left: 3px solid var(--primary);
}

.user-card.unread:hover {
    background: var(--surface);
}

/* In-app notification styles (add to existing .in-app-notification styles if you have them) */
.in-app-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 15px;
    width: 320px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.in-app-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.in-app-notification:hover {
    transform: translateX(0) translateY(-2px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border-left-color: var(--secondary);
}

.notification-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    font-size: 16px;
}

.in-app-notification.mention .notification-icon {
    background: var(--warning);
    animation: mentionPulse 1s infinite;
}

@keyframes mentionPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-body {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-word;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 5px;
}

.notification-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

/* Mention badge in navbar */
.nav-item .mention-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--warning);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

/* Mobile responsive notifications */
@media (max-width: 768px) {
    .in-app-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .unread-badge {
        font-size: 10px;
        min-width: 16px;
        height: 16px;
    }
}

/* Notification sound toggle */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.sound-toggle:hover {
    background: var(--surface-light);
    transform: scale(1.1);
}

.sound-toggle.muted {
    opacity: 0.5;
}

/* Participants Modal */
.participants-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.participants-content {
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.participants-stats {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: var(--surface-light);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
}

.participants-section {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.participants-section:last-child {
    border-bottom: none;
}

.participants-section h4 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.participants-list {
    max-height: 300px;
    overflow-y: auto;
}

.participant-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.participant-card:hover {
    background: var(--surface-light);
}

.participant-card.current-user {
    background: rgba(99, 102, 241, 0.1);
}

.participant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    position: relative;
    background-size: cover;
    background-position: center;
}

.participant-presence {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.participant-presence.online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.participant-presence.offline {
    background: var(--text-muted);
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.you-badge {
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

.participant-details {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.participant-username {
    color: var(--primary);
}

.participant-last-seen {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.participant-status.online {
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.participant-card .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
}

/* Chat header status indicator */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

.status-indicator.online {
    background: var(--success);
}

.status-indicator.offline {
    background: var(--text-muted);
}

/* Chat user info hover effect */
.chat-user-info {
    cursor: pointer;
    transition: opacity 0.2s;
}

.chat-user-info:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .participants-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .participants-list {
        max-height: 250px;
    }
    
    .participant-avatar {
        width: 36px;
        height: 36px;
    }
}

/* Edit Room Modal */
.edit-room-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.edit-room-content {
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    padding: 25px;
}

.edit-room-content .form-group {
    margin-bottom: 20px;
}

.edit-room-content .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
}

.edit-room-content input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
}

.edit-room-content input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.edit-room-content input[readonly] {
    background: var(--surface);
    color: var(--text-muted);
    cursor: not-allowed;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 15px;
    background: var(--surface-light);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.toggle-label:hover {
    border-color: var(--primary);
    background: var(--surface);
}

.room-info-box {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.room-info-box h4 {
    color: var(--text);
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.creator-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.room-creator {
    border-left: 4px solid #f59e0b;
}

/* Switch styles (if not already defined) */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* Action buttons */
.btn-icon {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Room card actions */
.room-card .btn {
    padding: 10px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-card .btn i {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .edit-room-content {
        width: 95%;
        max-height: 95vh;
        padding: 20px;
    }
    
    .room-card .btn {
        padding: 8px;
        min-width: 40px;
    }
    
    .room-name {
        font-size: 14px;
    }
    
    .room-privacy-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Message container styles */
.message-container {
    width: 100%;
    margin: 5px 0;
}

/* Image styles */
.image-container, .meme-container, .sticker-container {
    margin: 5px 0;
}

.message-image, .meme-image, .sticker-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s;
    object-fit: contain;
}

.message-image:hover, .meme-image:hover {
    transform: scale(1.02);
}

/* Meme specific */
.meme-image {
    max-width: 250px;
}

/* Sticker specific */
.sticker-image {
    max-width: 150px;
    background: transparent;
}

/* Video styles */
.video-container {
    margin: 5px 0;
}

.message-video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    background: #000;
}

/* File styles */
.message-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

.message-file:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.file-icon {
    font-size: 24px;
    color: var(--primary);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.file-download {
    color: var(--primary);
}

/* System message styles */
.system-message {
    align-self: center;
    background: transparent !important;
    padding: 8px 16px !important;
    margin: 10px auto !important;
    max-width: fit-content !important;
}

.system-text {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fix for old audio messages */
.audio-message-container {
    min-width: 250px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 12px;
}

.message-bubble.sent .audio-message-container {
    background: rgba(255, 255, 255, 0.15);
}

/* Error image placeholder */
img[src*="placeholder"] {
    border: 1px dashed var(--border);
    padding: 20px;
}

/* =====================
   🎧 Eccho Icon Button
   ===================== */

   .echo-icon-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.2s ease;
}

.echo-icon-btn:hover {
    transform: scale(1.08);
}

.echo-icon-btn:active {
    transform: scale(0.95);
}

.echo-icon {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 6px 18px rgba(56,189,248,0.45));
}

/* Sound waves - STATIC by default */
.wave {
    fill: none;
    stroke: white;
    stroke-width: 5;
    stroke-linecap: round;
    opacity: 0.8;
    transform-origin: center;
    animation: none; /* No animation by default */
}

/* Wave positions for static state */
.wave.w1 { transform: scale(0.9); opacity: 0.3; }
.wave.w2 { transform: scale(0.85); opacity: 0.4; }
.wave.w3 { transform: scale(0.8); opacity: 0.3; }

/* Active when typing - waves animate */
.echo-icon-btn.active .wave {
    animation: wavePulse 1.8s infinite ease-in-out;
}

.echo-icon-btn.active .wave.w2 { animation-delay: 0.2s; }
.echo-icon-btn.active .wave.w3 { animation-delay: 0.4s; }

@keyframes wavePulse {
    0%   { opacity: 0.3; transform: scale(0.9); }
    50%  { opacity: 1;   transform: scale(1.05); }
    100% { opacity: 0.3; transform: scale(0.9); }
}

/* Active state glow */
.echo-icon-btn.active .echo-icon {
    filter: drop-shadow(0 0 12px rgba(56,189,248,0.9));
}

/* Sending animation */
.echo-icon-btn.sending {
    animation: sendBounce 0.5s ease;
}

@keyframes sendBounce {
    0% { transform: scale(1); }
    40% { transform: scale(0.85) rotate(-6deg); }
    100% { transform: scale(1); }
}

/* Recording state (when recording audio) */
.echo-icon-btn.recording {
    animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.echo-icon-btn.recording .echo-icon {
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.7));
}

/* Disabled state */
.echo-icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.echo-icon-btn:disabled:hover {
    transform: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .echo-icon-btn {
        width: 48px;
        height: 48px;
    }
    
    .echo-icon {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 375px) {
    .echo-icon-btn {
        width: 44px;
        height: 44px;
    }
    
    .echo-icon {
        width: 40px;
        height: 40px;
    }
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-text:hover {
    background: var(--surface-light);
    color: var(--primary);
}

.user-avatar {
    cursor: pointer;
    transition: transform 0.2s;
}

.user-avatar:hover {
    transform: scale(1.05);
}

/* profile */
.profile-page {
    min-height: 100vh;
    background: var(--surface);
}

.profile-cover {
    height: 200px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.profile-cover-content {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.profile-avatar-container {
    position: relative;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--surface);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    color: white;
    margin: 0 auto;
}

.profile-info-container {
    padding: 70px 20px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 5px;
    color: var(--text);
}

.profile-username {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0 0 10px;
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-indicator.offline {
    background: var(--text-muted);
}

.profile-actions {
    display: flex;
    gap: 10px;
}

.friend-request-actions {
    display: flex;
    gap: 10px;
}

.profile-bio-container {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.profile-bio-container h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--text);
}

.profile-bio {
    margin: 0;
    line-height: 1.6;
    color: var(--text);
    font-size: 15px;
}

.profile-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-activity-container {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
}

.profile-activity-container h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-rooms {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--surface);
    border-radius: 10px;
    font-size: 14px;
}

.recent-room-item i {
    color: var(--primary);
    margin-right: 10px;
}

.recent-room-item strong {
    color: var(--text);
}

.recent-room-item small {
    color: var(--text-muted);
    font-size: 12px;
}

.no-activity {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.profile-back-btn {
    position: sticky;
    top: 0;
    padding: 12px 16px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    z-index: 5;   /* below global header */
}

.profile-back-btn .btn {
    background: rgba(44, 44, 44, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--text);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}


@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .profile-actions {
        width: 100%;
    }
    
    .profile-actions .btn {
        flex: 1;
    }
}

/* Profile Page Styles */
.profile-page {
    min-height: 100vh;
    background: var(--surface);
}

.profile-cover {
    height: 200px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.profile-cover-content {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.profile-avatar-container {
    position: relative;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--surface);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    color: white;
    margin: 0 auto;
}

.profile-avatar-large.edit-mode {
    border: 4px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.online-status-large {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    border: 3px solid var(--surface);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.profile-info-container {
    padding: 70px 20px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 5px;
    color: var(--text);
}

.profile-username {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0 0 10px;
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-indicator.offline {
    background: var(--text-muted);
}

.profile-actions {
    display: flex;
    gap: 10px;
}

.profile-bio-container {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.profile-bio-container.empty {
    background: rgba(148, 163, 184, 0.05);
    border: 2px dashed var(--border);
}

.profile-bio-container h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-bio {
    margin: 0;
    line-height: 1.6;
    color: var(--text);
    font-size: 15px;
}

.profile-bio.empty {
    color: var(--text-muted);
    font-style: italic;
}

.profile-bio.empty a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.profile-bio.empty a:hover {
    text-decoration: underline;
}

.profile-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-activity-container {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.profile-activity-container h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-rooms {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-room-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--surface);
    border-radius: 10px;
    font-size: 14px;
}

.recent-room-item i {
    color: var(--primary);
    margin-right: 10px;
}

.recent-room-item strong {
    color: var(--text);
}

.recent-room-item small {
    color: var(--text-muted);
    font-size: 12px;
}

.no-activity {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

.profile-quick-actions {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.profile-quick-actions h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Edit Profile Styles */
.edit-avatar-wrapper {
    position: relative;
}

.avatar-actions {
    position: absolute;
    bottom: 0;
    right: -20px;
    display: flex;
    gap: 10px;
}

.btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h2 {
    font-size: 24px;
    color: var(--text);
    margin: 0 0 5px;
}

.form-header p {
    color: var(--text-muted);
    margin: 0;
}

.form-section {
    background: var(--surface-light);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.visibility-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.radio-option input {
    margin-right: 15px;
}

.radio-content {
    flex: 1;
}

.radio-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}

.radio-description {
    font-size: 13px;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-actions .btn {
    flex: 1;
    padding: 14px;
    font-size: 15px;
    font-weight: 500;
}

/* Settings Page */
.settings-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.settings-header {
    text-align: center;
    margin-bottom: 40px;
}

.settings-header h2 {
    font-size: 28px;
    color: var(--text);
    margin: 0 0 8px;
}

.settings-header p {
    color: var(--text-muted);
    margin: 0;
}

.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.settings-section {
    background: var(--surface-light);
    padding: 25px;
    border-radius: 15px;
}

.settings-section.danger {
    background: rgba(239, 68, 68, 0.05);
    border: 2px solid rgba(239, 68, 68, 0.2);
}

.settings-section h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section.danger h3 {
    color: var(--error);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--surface);
    transition: background 0.3s ease;
}

.settings-item:hover {
    background: var(--surface-light);
}

.settings-item-info {
    flex: 1;
}

.settings-item-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.settings-item-description {
    font-size: 13px;
    color: var(--text-muted);
}

.settings-back {
    margin-top: 40px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-actions {
        width: 100%;
        justify-content: center;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Renamed all classes with "room-" prefix to "chatroom-" prefix */

.chatroom-page {
    min-height: 100vh;
    background: var(--surface);
}

.chatroom-header {
    position: relative;
}

.chatroom-cover {
    height: 200px;
    position: relative;
    background-size: cover;
    background-position: center;
}

.chatroom-avatar-container {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
}

.chatroom-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--surface);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    color: white;
}

.chatroom-info-container {
    padding: 70px 20px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.chatroom-title-section {
    text-align: center;
    margin-bottom: 30px;
}

.chatroom-name {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 15px;
    color: var(--text);
}

.chatroom-meta {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.chatroom-type-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatroom-type-badge.private {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.chatroom-type-badge.public {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.chatroom-creator-badge {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatroom-member-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatroom-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.chatroom-actions .btn {
    padding: 12px 24px;
    font-size: 15px;
}

.chatroom-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.chatroom-key-container {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    max-width: 800px;
    margin: 0 auto 30px;
}

.chatroom-key-container h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatroom-key-display {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.chatroom-key-display code {
    flex: 1;
    background: var(--surface);
    padding: 12px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
    border: 1px solid var(--border);
}

.chatroom-key-note {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.chatroom-creator-container {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    max-width: 800px;
    margin: 0 auto 30px;
}

.chatroom-creator-container h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.creator-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--surface);
    border-radius: 10px;
}

.chatroom-avatar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.chatroom-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--surface);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    color: white;
    margin: 0 auto;
}

.chatroom-header {
    text-align: center;
    margin-bottom: 20px;
}

.chatroom-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.chatroom-meta {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.creator-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.creator-info {
    flex: 1;
}

.creator-name {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
    margin-bottom: 4px;
}

.creator-role {
    color: var(--text-muted);
    font-size: 14px;
}

.chatroom-members-container {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.chatroom-members-container h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--surface);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.member-card:hover {
    background: var(--border-light);
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    position: relative;
}

.member-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.member-status.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.member-status.offline {
    background: var(--text-muted);
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
    margin-bottom: 4px;
}

.member-online {
    color: var(--success);
    font-size: 14px;
}

.member-last-seen {
    color: var(--text-muted);
    font-size: 14px;
}

.member-actions {
    color: var(--text-muted);
}

.no-members {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.chatroom-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.chatroom-back-btn .btn {
    background: rgba(62, 61, 61, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--text);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .chatroom-actions {
        flex-direction: column;
    }
    
    .chatroom-actions .btn {
        width: 100%;
    }
}

.chatroom-header {
    position: relative;
    text-align: center;
}

.chatroom-cover {
    height: 200px;
    position: relative;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 50px;
}

.chatroom-avatar-container {
    position: absolute;
    bottom: -60px;
    text-align: center;
}

.chatroom-info-container {
    padding-top: 80px;
    text-align: center;
}

.chatroom-title-section {
    margin-bottom: 30px;
}

.chatroom-name {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 15px;
    color: var(--text);
}

.chatroom-meta {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.chatroom-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.chatroom-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
    text-align: center;
}

.chatroom-key-container,
.chatroom-creator-container,
.chatroom-members-container {
    background: var(--surface-light);
    padding: 20px;
    border-radius: 15px;
    max-width: 800px;
    margin: 0 auto 30px;
    text-align: left;
}

.chatroom-key-container h3,
.chatroom-creator-container h3,
.chatroom-members-container h3 {
    text-align: center;
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.member-card.admin {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05), transparent);
}

.admin-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.chatroom-admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.chatroom-admin-content {
    background: var(--surface);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.chatroom-admin-main {
    padding: 30px;
    text-align: center;
}

.chatroom-admin-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: white;
}

.chatroom-admin-role {
    color: #f59e0b;
    font-weight: 600;
    margin: 5px 0 20px;
}

.chatroom-admin-info {
    background: var(--surface-light);
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: left;
    font-size: 14px;
    color: var(--text-muted);
}

.chatroom-admin-info p {
    margin: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.chatroom-admin-info i {
    color: #f59e0b;
    margin-top: 2px;
}

.chatroom-admin-actions {
    padding: 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border);
}

.chatroom-admin-actions .btn {
    flex: 1;
}

/* New member-specific styles */
.chatroom-member-details {
    margin-top: 5px;
}

.chatroom-member-username {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
}

.chatroom-member-status {
    font-size: 13px;
    display: block;
    margin-top: 2px;
}

.chatroom-member-status.online {
    color: var(--success);
}

.chatroom-member-status.offline {
    color: var(--text-muted);
}

.chatroom-you-badge {
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.chatroom-members-section {
    margin-bottom: 25px;
}

.chatroom-members-section:last-child {
    margin-bottom: 0;
}

.chatroom-members-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== ROOMS ==================== */
/* Enhanced Rooms UI */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
    /* REMOVE THESE LINES: */
    /* max-height: calc(100vh - 200px); */
    /* overflow-y: auto; */
    /* padding-right: 10px; */
    /* Keep only: */
    overflow: visible; /* Change from auto to visible */
}

.room-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Keep all your other room card styles... */

/* Remove any fixed max-height from parent containers too */
.content-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Add this to allow natural scrolling */
    min-height: 0; /* Important for flex children */
}

/* Ensure main content only has ONE scroll */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden; /* This is fine */
}

/* Add this to handle long room lists naturally */
.rooms-section {
    flex: 1;
    min-height: 0; /* Crucial for proper scrolling */
}

/* If you want the grid to auto-expand based on content, use this: */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
    /* Remove overflow constraints, let it flow naturally */
    overflow: visible;
    /* Auto height based on content */
    height: auto;
    min-height: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rooms-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        /* No scroll on mobile either */
        overflow: visible;
    }

}


/* ==================== SIDEBAR PROFILE ==================== */

.sidebar .user-profile {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.sidebar .user-profile:hover {
    background: var(--surface-light);
}

.sidebar .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--surface);
}

.sidebar .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar .user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sidebar .user-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.sidebar .user-status {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar .status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.sidebar .status-indicator.offline {
    background: var(--text-muted);
}

.sidebar .edit-profile-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.sidebar .edit-profile-btn:hover {
    color: var(--primary);
}

/* ============================
   Member Avatar Container
============================ */

.member-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    overflow: visible;   /* IMPORTANT so dot can go outside */
}

/* ============================
   Status Dot (Online / Offline)
============================ */

.status-dot {
    position: absolute;
    bottom: -3px;        /* push outside avatar */
    right: -3px;         /* push outside avatar */
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--surface-light);
    background: var(--text-muted);
    pointer-events: none;
}

/* Online */
.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 2px var(--surface), 
                0 0 6px rgba(16, 185, 129, 0.8);

}

/* Offline */
.status-dot.offline {
    background: #64748b;
}

/* Pulse animation */
@keyframes statusPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================
   Fix Online Text Background
============================ */

.member-status-text.online,
.member-status-text.offline {
    background: transparent !important;
    padding: 0 !important;
}

/* Online text */
.member-status-text.online {
    color: var(--success);
    font-weight: 500;
}

/* Offline text */
.member-status-text.offline {
    color: var(--text-muted);
}
/* ============================
   Admin Crown Positioning
============================ */

.admin-crown {
    position: absolute;
    top: -6px;        /* push outside */
    left: -6px;       /* push outside */
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #facc15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #1e293b;
    border: 2px solid var(--surface);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    pointer-events: none;

}

:root {
    /* Primary Colors */
    --primary: #0066ff;
    --primary-rgb: 0, 102, 255;
    --secondary: #7b61ff;
    --success: #00cc88;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-tertiary: #999999;
}
.call-actions {
    display: flex;
    gap: 8px;
    margin-right: 6px;
}

.call-actions .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

/* ==================== CALL MODALS ==================== */
.incoming-call-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.incoming-call-modal.show {
    opacity: 1;
}

.incoming-call-content {
    background: #1e293b;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 2px solid #6366f1;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.call-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.call-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-radius: 50%;
    animation: ripple 3s infinite linear;
}

.call-ripple:nth-child(2) {
    animation-delay: 0.5s;
    border-color: rgba(99, 102, 241, 0.15);
}

.call-ripple:nth-child(3) {
    animation-delay: 1s;
    border-color: rgba(99, 102, 241, 0.1);
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.caller-info {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

.caller-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    background-size: cover;
    background-position: center;
    border: 4px solid #6366f1;
}

.caller-avatar.video {
    border-color: #10b981;
}

.caller-avatar.audio {
    border-color: #3b82f6;
}

.caller-name {
    color: white;
    font-size: 24px;
    margin: 10px 0 5px;
}

.call-type {
    color: #94a3b8;
    font-size: 16px;
    margin: 5px 0;
}

.call-type i {
    margin-right: 8px;
}

.call-status {
    color: #6366f1;
    font-size: 14px;
    margin-top: 10px;
}

.call-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0 20px;
    position: relative;
    z-index: 1;
}

.call-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.call-btn i {
    font-size: 24px;
    margin-bottom: 5px;
}

.call-btn.decline {
    background: #ef4444;
    color: white;
}

.call-btn.accept {
    background: #10b981;
    color: white;
}

.call-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.call-quick-actions {
    position: relative;
    z-index: 1;
}

.quick-action-btn {
    background: transparent;
    border: 1px solid #475569;
    color: #94a3b8;
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn:hover {
    background: #334155;
    color: white;
    border-color: #6366f1;
}

/* Calling Screen */
.calling-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calling-screen.show {
    opacity: 1;
}

.calling-content {
    text-align: center;
    color: white;
}

.calling-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 48px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.calling-name {
    font-size: 28px;
    margin: 10px 0;
}

.calling-status {
    color: #94a3b8;
    margin-bottom: 40px;
}

/* Active Call Screen */
.active-call-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.active-call-screen.show {
    opacity: 1;
}

.call-screen-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#localVideo {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 12px;
    border: 2px solid white;
    object-fit: cover;
    background: #000;
}

.audio-call-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.call-participant-avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin-bottom: 30px;
    border: 6px solid rgba(255, 255, 255, 0.1);
}

.call-participant-name {
    font-size: 32px;
    margin: 10px 0;
}

.call-status {
    color: #94a3b8;
    font-size: 18px;
}

.call-timer {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 20px;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

.call-controls {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.control-btn.active {
    background: #ef4444;
}

.control-btn.end-call {
    background: #ef4444;
    width: 70px;
    height: 70px;
}

.control-btn.end-call:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .caller-avatar {
        width: 100px;
        height: 100px;
        font-size: 30px;
    }
    
    .caller-name {
        font-size: 20px;
    }
    
    .call-btn {
        width: 60px;
        height: 60px;
    }
    
    #localVideo {
        width: 80px;
        height: 106px;
    }
    
    .call-controls {
        bottom: 20px;
        gap: 15px;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .control-btn.end-call {
        width: 60px;
        height: 60px;
    }
}

.incoming-call-modal.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.offline {
    background: var(--text-muted);
}

/* Audio message styles */
.audio-message-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    margin: 5px 0;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.audio-play-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.audio-waveform-container {
    flex: 1;
    position: relative;
    height: 30px;
}

.audio-waveform {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2px;
}

.audio-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 15px;
    z-index: 1;
}

.audio-duration {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 45px;
}
/* WebSocket Status Indicator */
.ws-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ws-connected {
    background-color: #10b981;
    color: white;
}

.ws-disconnected {
    background-color: #ef4444;
    color: white;
}

.ws-connecting {
    background-color: #f59e0b;
    color: white;
}

/* Call Participant Status */
.participant-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin: 5px 0;
}

.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.participant-status-indicators {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.mute-indicator {
    color: #ef4444;
    font-size: 12px;
}

.video-indicator {
    color: #3b82f6;
    font-size: 12px;
}

/* Call Controls */
.call-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn.active {
    background: #ef4444;
}

.control-btn.end-call {
    background: #ef4444;
}

.control-btn.end-call:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Active Call Screen */
.active-call-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.active-call-screen.show {
    display: block;
    opacity: 1;
}

.call-screen-content {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.video-container {
    position: relative;
    width: 100%;
    height: 70vh;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#localVideo {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 160px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.audio-call-display {
    text-align: center;
    color: white;
    padding: 40px 20px;
}

.call-participant-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.call-participant-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.call-status {
    font-size: 16px;
    opacity: 0.8;
    margin-bottom: 20px;
}

.call-timer {
    font-size: 36px;
    font-weight: 600;
    color: white;
    text-align: center;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

/* ===============================
   🌌 ECCHO FRIENDS (SCOPED UI)
   =============================== */

.eccho-friends {
    padding: 12px;
}

.eccho-friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

/* Card */
.eccho-friend-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(
        145deg,
        rgba(255,255,255,0.05),
        rgba(255,255,255,0.015)
    );
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    transition: 
        transform 0.35s ease,
        box-shadow 0.35s ease,
        border 0.35s ease;
    overflow: hidden;
}

/* Glow sweep */
.eccho-friend-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(99,102,241,0.35),
        transparent
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.eccho-friend-card:hover {
    transform: translateY(-4px) scale(1.015);
    border-color: rgba(99,102,241,0.5);
    box-shadow:
        0 12px 40px rgba(99,102,241,0.35);
}

.eccho-friend-card:hover::before {
    opacity: 1;
}

/* Avatar */
.eccho-friend-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
    box-shadow: 
        0 0 0 2px rgba(255,255,255,0.1),
        0 0 18px rgba(99,102,241,0.5);
}

/* Halo pulse */
.eccho-friend-avatar::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 20px;
    background: radial-gradient(circle, rgba(99,102,241,0.35), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.eccho-friend-card:hover .eccho-friend-avatar::after {
    opacity: 1;
}

/* Info */
.eccho-friend-info {
    flex: 1;
    min-width: 0;
}

.eccho-friend-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.3px;
}

.eccho-friend-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Status */
.eccho-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.eccho-status-dot.online {
    background: #22ffb2;
    box-shadow: 0 0 10px #22ffb2;
}

.eccho-status-dot.offline {
    background: #64748b;
}

/* Buttons inside card */
.eccho-friend-card .btn {
    border-radius: 12px;
    min-width: 38px;
    height: 36px;
    padding: 0;
    backdrop-filter: blur(6px);
    transition: 
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.eccho-friend-card .btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px rgba(99,102,241,0.4);
}

/* Mobile */
@media (max-width: 640px) {
    .eccho-friends-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   🎯 ECCHO FRIEND ICON ALIGN FIX
   =============================== */

.eccho-friend-card .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.eccho-friend-card .btn i {
    font-size: 15px;
    line-height: 1;
    display: block;
}

/* Make all action buttons equal size */
.eccho-friend-card .btn {
    width: 38px;
    height: 38px;
    padding: 0;
}

/* Remove font baseline shifting */
.eccho-friend-card .btn i::before {
    vertical-align: middle;
}

/* ===============================
   👤 ECCHO FRIEND META LAYOUT
   =============================== */

.eccho-friend-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.eccho-username {
    font-size: 12px;
    letter-spacing: 0.4px;
    color: var(--text-muted);
}

/* Keep dot subtle but visible */
.eccho-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.eccho-status-dot.online {
    background: #22ffb2;
    box-shadow: 0 0 10px #22ffb2;
}

.eccho-status-dot.offline {
    background: #475569;
    opacity: 0.6;
}


/* Mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .chat-header {
        height: 50px;
        padding: 8px 12px;
    }
    .messages-container {
        padding: 10px;
    }
    .message-bubble {
        max-width: 75%;
        padding: 8px 10px;
    }
    .message-input-container {
        padding: 8px 12px;
    }
}

.room-theme-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Fix for transparent buttons */
.btn-primary, .btn-success, .btn-danger, .btn-secondary {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
}

.btn-success {
    background: var(--success) !important;
}

.btn-danger {
    background: var(--danger) !important;
}

.btn-secondary {
    background: var(--surface-light) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

/* Ensure gradient buttons work */
.btn-primary[style*="gradient"] {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
}

.btn-success[style*="gradient"] {
    background: linear-gradient(135deg, var(--success), #10b981) !important;
}

/* Add to your styles.css */

/* Create Room PC Optimizations */
@media (min-width: 769px) {
    .card {
        transition: all 0.3s ease;
    }
    
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    
    /* Better button hover effects on PC */
    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5) !important;
    }
}

/* Mobile responsive - stack columns */
@media (max-width: 768px) {
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Mobile: stack join room inputs vertically */
    div[style*="display: flex; gap: 10px; flex: 1; max-width: 500px"] {
        flex-direction: column !important;
        max-width: 100% !important;
    }
}

/* Character counter animation */
#nameCharCount {
    transition: color 0.3s ease;
}

/* Warn when approaching limit */
input[maxlength="100"]:focus + div #nameCharCount {
    color: var(--warning);
}
/* ==================== MOBILE JOIN ROOM IMPROVEMENTS ==================== */

@media (max-width: 768px) {
    /* Mobile: stack join room inputs vertically */
    .join-room-container {
        flex-direction: column !important;
        max-width: 100% !important;
        gap: 12px !important;
    }
    
    .join-room-container input {
        width: 100% !important;
        padding: 14px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
        border-radius: 12px !important;
    }
    
    .join-room-container button {
        width: 100% !important;
        padding: 16px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
        height: auto !important;
        min-height: 50px !important;
    }
    
    /* Make room key input more touch-friendly */
    #joinRoomKeyInput {
        background: var(--surface) !important;
        border: 2px solid var(--border) !important;
        color: var(--text) !important;
        font-size: 16px !important;
        letter-spacing: 0.5px !important;
        height: 52px !important;
    }
    
    #joinRoomKeyInput::placeholder {
        color: var(--text-muted) !important;
        opacity: 0.7 !important;
    }
    
    #joinRoomKeyInput:focus {
        border-color: var(--primary) !important;
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    }
    
    /* Join button mobile styling */
    .join-room-container .btn-success {
        background: linear-gradient(135deg, var(--success), #10b981) !important;
        border: none !important;
        font-weight: 600 !important;
        margin-top: 5px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    
    /* Room creation card mobile improvements */
    .card {
        margin: 10px !important;
        padding: 20px !important;
        border-radius: 20px !important;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15) !important;
    }
    
    /* Room key display on mobile */
    #roomKeyDisplay {
        font-size: 14px !important;
        padding: 8px 12px !important;
        word-break: break-all !important;
        background: rgba(255, 255, 255, 0.15) !important;
        border-radius: 8px !important;
        margin-bottom: 5px !important;
    }
    
    /* Buttons inside cards on mobile */
    .card .btn {
        min-height: 48px !important;
        font-size: 15px !important;
    }
    
    /* Privacy toggle larger on mobile */
    .switch {
        transform: scale(1.1) !important;
    }
    
    /* Room name display on mobile */
    #displayRoomName {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
    
    #roomDescription {
        font-size: 14px !important;
        line-height: 1.5 !important;
        padding: 0 10px !important;
    }
    
    /* Create room button on mobile */
    .btn-primary[onclick="createRandomRoom()"] {
        min-height: 56px !important;
        font-size: 16px !important;
        border-radius: 16px !important;
        margin-top: 20px !important;
    }
}

/* Very small screens */
@media (max-width: 375px) {
    .card {
        padding: 16px !important;
        margin: 8px !important;
    }
    
    #displayRoomName {
        font-size: 20px !important;
    }
    
    #roomDescription {
        font-size: 13px !important;
    }
    
    .btn {
        padding: 14px !important;
    }
    
    input, textarea {
        padding: 12px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
    }
}

/* Landscape mode */
@media (max-width: 768px) and (orientation: landscape) {
    .join-room-container {
        flex-direction: row !important;
        gap: 10px !important;
    }
    
    .join-room-container input {
        flex: 3 !important;
    }
    
    .join-room-container button {
        flex: 2 !important;
    }
    
    .card {
        padding: 15px !important;
        margin: 8px !important;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    input, textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    .btn {
        min-height: 44px !important; /* Apple's recommended minimum touch target */
    }
    
    /* Better touch feedback */
    .btn:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
}

/* Add smooth transitions */
.join-room-container input,
.join-room-container button,
.card,
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Loading states */
.btn:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* Success state for join button */
.btn-success:active {
    background: linear-gradient(135deg, #0ea271, #0d9c6e) !important;
    transform: scale(0.98) !important;
}

/* Error state for input */
#joinRoomKeyInput:invalid {
    border-color: var(--danger) !important;
    animation: shake 0.5s ease-in-out !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Add focus ring for accessibility */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}
/* ===== Desktop polish remains unchanged ===== */
@media (min-width: 769px) {
    .card {
        transition: all 0.3s ease;
    }

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5) !important;
    }
}

/* ===== Mobile layout fixes ===== */
@media (max-width: 768px) {

    /* Stack create room sections vertically */
    .create-room-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    /* Join room input + button stacked */
    .join-room-row {
        flex-direction: column !important;
        width: 100% !important;
    }

    .join-room-row input,
    .join-room-row button {
        width: 100% !important;
    }

    /* Bigger tap targets */
    .btn {
        min-height: 48px;
        font-size: 16px;
    }

    /* Reduce card padding for small screens */
    .card {
        padding: 14px !important;
    }
}

/* Character counter animation */
#nameCharCount {
    transition: color 0.3s ease;
}

input[maxlength="100"]:focus + div #nameCharCount {
    color: var(--warning);
}

/* Add to your CSS */
.media-buttons-row {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.media-buttons-row.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.media-buttons {
    display: flex;
    gap: 10px;
    padding: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.attachment-toggle-btn {
    transition: all 0.3s ease;
}

.attachment-toggle-btn.active {
    background: var(--primary);
    color: white;
}

.attachment-toggle-btn.active i {
    transition: transform 0.3s ease;
}

.preview-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #ef4444;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    transition: transform 0.15s ease;
}

.preview-close-btn:hover {
    transform: scale(1.1);
}

.preview-card {
    position: relative;
    background: var(--surface-light);
    border-radius: 14px;
    padding: 14px;
    display: inline-block;
    max-width: 220px;
}

#stickerGrid,
#memeGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);  /* Fit inside screen */
}

/* ==================== TYPING INDICATOR ==================== */

.typing-indicator-status {
    display: flex;
    align-items: center;
    color: var(--primary);
    font-size: 13px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ==================== NEW MESSAGE INDICATOR ==================== */

.new-message-indicator {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 100;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.new-message-indicator.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.new-message-badge {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.new-message-badge:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.new-message-badge:active {
    transform: scale(0.98);
}

.badge-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.badge-icon {
    font-size: 16px;
    animation: bounceDown 1s infinite;
}

@keyframes bounceDown {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(3px);
    }
}

.badge-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

.badge-text {
    font-size: 13px;
}

/* Highlight unread message */
.message-bubble.highlight-unread {
    animation: highlightPulse 2s;
}

@keyframes highlightPulse {
    0%, 100% {
        background: var(--surface);
    }
    50% {
        background: rgba(99, 102, 241, 0.1);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    }
}

/* ==================== READ RECEIPTS ==================== */

.read-receipt {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 4px;
    gap: 4px;
}

.read-receipt-avatars {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.read-receipt-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--surface);
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-left: -6px;
    transition: all 0.2s;
}

.read-receipt-avatar:first-child {
    margin-left: 0;
}

.read-receipt-avatar:hover {
    transform: scale(1.3);
    z-index: 10;
    border-color: var(--primary);
}

.read-receipt-more {
    background: var(--text-muted);
    font-size: 7px;
}

/* Read receipt in sent messages */
.message-bubble.sent .read-receipt {
    justify-content: flex-end;
}

.message-bubble.received .read-receipt {
    justify-content: flex-start;
}

/* ==================== MENTION DROPDOWN ==================== */

.mention-dropdown {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 240px;
    overflow-y: auto;
    z-index: 10000;
    display: none;
    animation: slideUpFade 0.2s;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.mention-item:hover,
.mention-item.selected {
    background: var(--surface-light);
}

.mention-item.selected {
    background: rgba(99, 102, 241, 0.1);
}

.mention-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.mention-info {
    flex: 1;
    min-width: 0;
}

.mention-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-username {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== MENTION HIGHLIGHTING ==================== */

.mention {
    color: var(--danger);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.mention:hover {
    background: rgba(99, 102, 241, 0.2);
}

.mention-me {
    background: rgba(99, 102, 241, 0.2);
    animation: mentionGlow 2s infinite;
}

@keyframes mentionGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0);
    }
}

/* Message with mention of current user */
.message-bubble.has-mention-me {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
}

/* ==================== SCROLLBAR STYLING ==================== */

.mention-dropdown::-webkit-scrollbar {
    width: 6px;
}

.mention-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.mention-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.mention-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .new-message-indicator {
        bottom: 100px;
    }
    
    .new-message-badge {
        padding: 8px 16px;
    }
    
    .badge-content {
        font-size: 13px;
        gap: 6px;
    }
    
    .mention-dropdown {
        max-width: calc(100vw - 32px) !important;
        left: 16px !important;
        right: 16px;
        width: auto !important;
    }
    
    .read-receipt-avatar {
        width: 14px;
        height: 14px;
        font-size: 7px;
    }
}

/* ==================== DARK MODE ADJUSTMENTS ==================== */

@media (prefers-color-scheme: dark) {
    .mention-dropdown {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }
    
    .new-message-badge {
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
    }
    
    .mention {
        background: rgba(99, 102, 241, 0.15);
    }
    
    .mention-me {
        background: rgba(99, 102, 241, 0.25);
    }
}

/* Media buttons styling */
.media-buttons-row {
    padding: 10px 0;
    background: var(--surface-light);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.media-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.media-buttons .icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.media-buttons .icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Sticker specific styling */
.sticker-message .message-image,
.sticker-message .sticker-image {
    max-width: 150px !important;
    height: auto !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.meme-message .message-image,
.meme-message .meme-image {
    max-width: 200px !important;
    border-radius: 8px !important;
    cursor: pointer;
}

/* New message indicator */
.new-message-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.new-message-indicator.visible {
    opacity: 1;
}

.new-message-badge {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.new-message-badge:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.new-message-badge .badge-count {
    background: white;
    color: var(--primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.new-message-badge .badge-text {
    font-weight: 500;
    font-size: 14px;
}

/* Typing indicator animation */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: typing-dot 1.5s infinite ease-in-out;
}

.typing-dots .dot:nth-child(1) { animation-delay: -0.3s; }
.typing-dots .dot:nth-child(2) { animation-delay: -0.15s; }

@keyframes typing-dot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.inline-chat-notification {
    background: rgba(30, 41, 59, 0.95);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    margin: 8px 12px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.inline-chat-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.typing-indicator-bar {
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 14px;
    min-height: 20px;
}

.mention {
    color: #60a5fa;
    background: rgba(96,165,250,0.15);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}













/* Fix for mobile URL bar behavior */
@media (max-width: 768px) {
    html, body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }
    
    .app {
        min-height: 100vh;
        height: auto;
    }
    
/* ==================== MOBILE JOIN ROOM IMPROVEMENTS ==================== */

@media (max-width: 768px) {
    /* Mobile: stack join room inputs vertically */
    .join-room-container {
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
    }
    
    .join-room-container input {
        width: 100% !important;
        padding: 16px !important;
        font-size: 16px !important; /* Prevents iOS zoom */
        border-radius: 12px !important;
        min-height: 56px !important;
    }
    
    .join-room-container button {
        width: 100% !important;
        padding: 18px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
        height: auto !important;
        min-height: 56px !important;
    }
    
    /* Make room key input more touch-friendly */
    #joinRoomKeyInput {
        background: var(--surface) !important;
        border: 2px solid var(--border) !important;
        color: var(--text) !important;
        font-size: 16px !important;
        letter-spacing: 0.5px !important;
        height: 56px !important;
    }
    
    #joinRoomKeyInput::placeholder {
        color: var(--text-muted) !important;
        opacity: 0.7 !important;
    }
    
    #joinRoomKeyInput:focus {
        border-color: var(--primary) !important;
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    }
    
    /* Join button mobile styling */
    .join-room-container .btn-success {
        background: linear-gradient(135deg, var(--success), #10b981) !important;
        border: none !important;
        font-weight: 600 !important;
        margin-top: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
    }
    
    /* Hide "Join Room" text on very small screens, show icon only */
    @media (max-width: 375px) {
        .join-text {
            display: none;
        }
        
        .join-room-container button {
            justify-content: center !important;
        }
        
        .join-room-container button i {
            margin: 0 !important;
            font-size: 18px !important;
        }
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    #joinRoomKeyInput {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    .join-room-container button {
        min-height: 44px !important; /* Apple's recommended minimum touch target */
    }
    
    /* Better touch feedback */
    .join-room-container button:active {
        transform: scale(0.98) !important;
        transition: transform 0.1s ease !important;
    }
}

/* Success state for join button */
.join-room-container .btn-success:active {
    background: linear-gradient(135deg, #0ea271, #0d9c6e) !important;
    transform: scale(0.98) !important;
}

/* Error state for input */
#joinRoomKeyInput:invalid {
    border-color: var(--danger) !important;
    animation: shake 0.5s ease-in-out !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Add focus ring for accessibility */
#joinRoomKeyInput:focus-visible,
.join-room-container button:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* Loading state */
.join-room-container button:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}
    
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: 13px;
}

.typing-indicator .dot {
    width: 5px;
    height: 5px;
    background: var(--primary);
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% { opacity: .2; }
    20% { opacity: 1; }
    100% { opacity: .2; }
}





#typingIndicatorBar {
    padding: 12px 16px;
    background: transparent;
    border: none;
    display: none;
    animation: slideDown 0.3s ease-out;
    min-height: 30px;
}

#typingIndicatorBar.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.typing-indicator-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots .dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dots .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { opacity: 0.5; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-6px); }
}

/* New Message Indicator */
#newMessageIndicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    transition: all 0.3s ease-out;
    z-index: 100;
    pointer-events: none;
}

#newMessageIndicator.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.new-message-badge {
    background: var(--primary);
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.new-message-badge:hover {
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    transform: scale(1.05);
}

.badge-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mention Dropdown */
#mentionDropdown {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    animation: slideUp 0.2s ease-out;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.mention-item:hover,
.mention-item.selected {
    background: var(--surface-light);
}

.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    background-size: cover;
    flex-shrink: 0;
}

.mention-info {
    flex: 1;
    min-width: 0;
}

.mention-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mention-username {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mention-chip {
    background: rgba(99,102,241,0.15);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.mention-chip:hover {
    background: rgba(99,102,241,0.25);
}
/* ==================== PREMIUM LOGO BREATHING GLOW ==================== */

.auth-logo-img,
.sidebar-logo-img {
    animation: logoBreath 3.2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(99,102,241,0.45));
}

@keyframes logoBreath {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 6px rgba(99,102,241,0.35));
    }
    50% {
        transform: scale(1.06);
        filter:
            drop-shadow(0 0 14px rgba(99,102,241,0.9))
            drop-shadow(0 0 28px rgba(16,185,129,0.45));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 6px rgba(99,102,241,0.35));
    }
}


/* Cute close button on image preview */
.preview-image-container {
    position: relative;
    display: inline-block;
}

.image-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, background 0.15s ease;
}

.image-close-btn:hover {
    transform: scale(1.15);
    background: #dc2626;
}

.new-message-indicator {
    position: sticky;
    bottom: 80px;
    margin: 0 auto;
    width: fit-content;
    background: rgba(99,102,241,0.95);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    animation: fadeInUp 0.2s ease-out;
}

.new-message-badge {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}





/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
    .app {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    .chat-container {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    html {
        height: -webkit-fill-available;
    }
}

/* Fix for safe areas on modern mobile browsers */
@supports (padding: max(0px)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .chat-header {
        padding-top: max(15px, env(safe-area-inset-top));
    }
    
    .message-input-container {
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
}

/* Prevent iOS bounce/overscroll */
html {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body {
    overscroll-behavior-y: contain;
}

