/* Variables loaded from css/variables.css */
/* Reset and Base Styles */

/* Base Typography - Arabic Optimized */
body {
    font-family: var(--font-body);
    font-size: var(--font-base);
    line-height: 1.6;
    color: #333;
    direction: rtl;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 var(--spacing-md) 0;
}

button, input, select, textarea {
    font-family: var(--font-body);
}

/* RTL Support */
[dir="rtl"] .message {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .message.own {
    flex-direction: row-reverse;
}

[dir="rtl"] .message-content {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .message-user {
    text-align: right;
}

[dir="rtl"] .p2p-input {
    text-align: right;
    direction: rtl;
}

/* Space Background */
.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    z-index: -1;
    overflow: hidden;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, #fff, transparent),
        radial-gradient(1px 1px at 90px 40px, #eee, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s ease-in-out infinite alternate;
}

.planets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.planet {
    position: absolute;
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.planet-1 {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    top: 15%;
    left: 10%;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    animation-delay: 0s;
}

.planet-2 {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #48cae4, #023e8a);
    top: 60%;
    right: 15%;
    box-shadow: 0 0 25px rgba(72, 202, 228, 0.5);
    animation-delay: 5s;
}

.planet-3 {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #d4a574, #8b5a2b);
    top: 30%;
    right: 5%;
    box-shadow: 0 0 15px rgba(212, 165, 116, 0.5);
    animation-delay: 10s;
}

.libya-map {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 150px;
    background: linear-gradient(45deg, #2d5a27, #4a7c59);
    clip-path: polygon(30% 10%, 70% 10%, 85% 30%, 90% 50%, 80% 70%, 60% 80%, 40% 85%, 20% 75%, 15% 50%);
    box-shadow: 0 0 40px rgba(45, 90, 39, 0.6);
    animation: glow 6s ease-in-out infinite alternate;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    direction: rtl;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: #e0e0e0;
    color: #333;
    overflow: hidden;
    height: 100vh;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

/* Auth Screen */
#auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.auth-container {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15) 0%, rgba(248, 249, 250, 0.15) 100%);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    width: 100%;
    max-width: 450px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: authGlow 4s ease-in-out infinite alternate;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.app-subtitle {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.auth-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-tab:hover::before {
    left: 100%;
}

.auth-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.auth-tab.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow:
        0 0 0 3px rgba(0, 123, 255, 0.15),
        0 4px 12px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

.form-group select {
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-group select:hover {
    border-color: rgba(0, 123, 255, 0.5);
    background: rgba(255, 255, 255, 0.95);
}

.form-group select:disabled {
    background: rgba(200, 200, 200, 0.3);
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.auth-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #333;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.auth-button:disabled {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: none;
}

.error-message {
    color: #dc3545;
    margin-top: 1rem;
    font-size: 0.9rem;
    padding: 0.75rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 8px;
    text-align: center;
}

.field-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    min-height: 1rem;
    display: none;
}

.form-group.error input, .form-group.error select {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.success input, .form-group.success select {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.auth-button.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.auth-button.loading .btn-text {
    display: none;
}

.auth-button.loading .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-button.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    cursor: default;
}

.auth-button.success .btn-text {
    display: none;
}

.auth-button.success .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-button.success .btn-loading::before {
    content: '✓';
    font-size: 1rem;
}

.auth-button.success .btn-loading i {
    display: none;
}

/* Auth UI refresh (login/register only) */
#auth-screen {
    padding: 24px;
    background:
        radial-gradient(circle at 18% 20%, rgba(16, 185, 129, 0.15), transparent 38%),
        radial-gradient(circle at 82% 80%, rgba(59, 130, 246, 0.18), transparent 42%),
        rgba(8, 13, 28, 0.84);
}

#auth-screen .auth-container {
    max-width: 520px;
    width: min(100%, 520px);
    padding: 32px 28px;
    border-radius: 24px;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.9));
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.3);
    animation: none;
}

#auth-screen .auth-brand {
    margin-bottom: 18px;
    text-align: center;
}

#auth-screen .auth-brand-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.7rem, 3.2vw, 2.2rem);
    font-weight: 800;
}

#auth-screen .auth-brand-subtitle {
    margin: 8px 0 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

#auth-screen .auth-tabs {
    margin-bottom: 18px;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.7);
}

#auth-screen .auth-tab {
    border-radius: 10px;
    color: #334155;
    font-weight: 700;
    padding: 12px 10px;
}

#auth-screen .auth-tab.active {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

#auth-screen .auth-form h2 {
    margin-bottom: 14px;
    text-align: center;
    color: #0f172a;
    font-size: 1.35rem;
}

#auth-screen .form-group {
    margin-bottom: 12px;
}

#auth-screen .auth-label {
    display: block;
    margin-bottom: 6px;
    color: #1e293b;
    font-weight: 700;
    font-size: 0.92rem;
}

#auth-screen .form-group input,
#auth-screen .form-group select {
    border-radius: 12px;
    border: 1.8px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    font-weight: 500;
    padding: 12px 14px;
    min-height: 48px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

#auth-screen .form-group input::placeholder {
    color: #94a3b8;
    font-style: normal;
}

#auth-screen .form-group input:focus,
#auth-screen .form-group select:focus {
    transform: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

#auth-screen .auth-button {
    margin-top: 8px;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

#auth-screen .auth-button:hover {
    transform: translateY(-1px);
    border-color: transparent;
    background: linear-gradient(135deg, #0284c7, #1d4ed8);
    box-shadow: 0 14px 28px rgba(30, 64, 175, 0.32);
}

#auth-screen .field-error {
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

#auth-screen .error-message {
    margin-top: 14px;
    border-radius: 12px;
    text-align: right;
    background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 640px) {
    #auth-screen {
        padding: 14px;
        align-items: flex-start;
    }

    #auth-screen .auth-container {
        max-width: 100%;
        padding: 20px 16px;
        border-radius: 18px;
    }

    #auth-screen .auth-tab {
        font-size: 0.92rem;
        padding: 10px 8px;
    }
}

/* ========== Responsive Nav Bar ========== */
.nav-bar,
#app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    min-height: 56px;
    background: #fff;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 4000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.app-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--spacing-md);
    gap: var(--spacing-sm);
    max-width: 100%;
}

.app-bar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.app-title {
    font-size: var(--font-xl);
    font-weight: 700;
    color: #007bff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
    max-width: 380px;
    margin: 0 var(--spacing-sm);
}

.nav-search,
#input-bar {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
    background: #f0f2f5;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 6px 12px;
    transition: background 0.2s, border-color 0.2s;
}

.nav-search:focus-within,
#input-bar:focus-within {
    background: #fff;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.app-bar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

/* Modern pill-shaped nav buttons (not circular) - clean professional */
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    min-width: 44px;
    min-height: 44px;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    font-size: var(--font-sm);
    font-weight: 600;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.nav-btn:active {
    transform: translateY(0);
}

.nav-btn-primary {
    background: #1877f2;
    color: #fff;
}

.nav-btn-primary:hover {
    background: #166fe5;
}

.nav-btn-secondary {
    background: #e4e6eb;
    color: #050505;
}

.nav-btn-secondary:hover {
    background: #d8dadf;
}

.nav-btn-label {
    font-size: var(--font-sm);
}

.nav-badge,
.unread-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e41e3f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px;
}

.nav-user:hover {
    background: #f0f2f5;
}

.nav-user-name {
    font-weight: 500;
    color: #1c1e21;
    font-size: var(--font-sm);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-icon {
    color: #007bff;
    font-size: 1.1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    min-height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 22px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-action-btn:hover {
    transform: translateY(-1px);
}

.nav-action-logout {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.nav-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #e9ecef;
    color: #495057;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.2s;
}

.nav-menu-toggle:hover {
    background: #dee2e6;
}

/* Nav drawer (mobile) */
.nav-drawer {
    position: fixed;
    inset: 0;
    top: 56px;
    z-index: 3100;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.25s ease;
}

.nav-drawer.open {
    pointer-events: auto;
    visibility: visible;
}

.nav-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.nav-drawer.open .nav-drawer-backdrop {
    opacity: 1;
}

.nav-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    max-width: 320px;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-drawer.open .nav-drawer-panel {
    transform: translateX(0);
}

.nav-drawer-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: var(--spacing-lg);
    border-bottom: 1px solid #e4e6ea;
    flex-shrink: 0;
    background: #fff;
}

.nav-drawer-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-drawer-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: #1c1e21;
}

.nav-drawer-close {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #65676b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s;
}

.nav-drawer-close:hover {
    background: #f0f2f5;
}

.nav-drawer-user-summary {
    width: 100%;
    min-height: 50px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: right;
}

.nav-drawer-user-summary i {
    width: 24px;
    text-align: center;
    color: #2563eb;
}

.nav-drawer-user-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-drawer-user-summary:hover {
    background: #dbeafe;
}

.nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-drawer-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #1c1e21;
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    text-align: right;
    transition: background 0.2s;
    min-height: 48px;
}

.nav-drawer-item:hover {
    background: #f0f2f5;
}

.nav-drawer-item i {
    width: 24px;
    font-size: 1.1rem;
    color: #65676b;
}

.nav-drawer-logout {
    color: #dc3545;
    margin-top: var(--spacing-md);
}

.nav-drawer-logout i {
    color: #dc3545;
}

/* Responsive: show hamburger and hide some actions on small screens */
@media (max-width: 767px) {
    .app-bar-center {
        display: none;
    }

    .nav-actions {
        display: none;
    }

    .nav-user {
        display: none;
    }

    .nav-btn {
        border-radius: 22px;
        padding: 10px 14px;
    }

    .nav-btn-label {
        display: none;
    }

    .nav-menu-toggle {
        display: flex;
    }

    .app-bar-right .nav-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .nav-btn-label {
        display: none;
    }

    .nav-btn {
        padding: 10px 14px;
        border-radius: 22px;
    }

    .nav-user-name {
        max-width: 80px;
    }
}

@media (min-width: 992px) {
    .nav-bar,
    #app-bar {
        height: 60px;
    }

    .nav-drawer {
        top: 60px;
    }

    .app-bar-inner {
        padding: 0 var(--spacing-lg);
    }

    .app-bar-center {
        display: flex;
        max-width: 400px;
    }
}

#current-user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-right: var(--spacing-lg);
}

.user-icon {
    color: #007bff;
    font-size: var(--font-lg);
    opacity: 0.8;
}

#current-user-name {
    font-weight: 500;
    color: var(--color-text);
    font-size: var(--font-base);
}

#user-controls {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.control-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-size: var(--font-sm);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.control-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.control-button.visibility-off {
    opacity: 0.9;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #dc3545;
}

.control-button.visibility-on {
    opacity: 1;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
}

.button-label {
    font-size: var(--font-xs);
    font-weight: 500;
    white-space: nowrap;
}

#current-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
}

.user-icon {
    color: #007bff;
    font-size: 1.1rem;
    opacity: 0.8;
}

#current-user-name {
    font-weight: 500;
    color: #333;
}

#user-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.control-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.visibility-icon-large {
    font-size: 1rem !important;
    opacity: 1 !important;
}

.control-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.control-button.visibility-off {
    opacity: 0.9;
    background: #dc3545 !important;
    border-color: #dc3545 !important;
}

.control-button.visibility-on {
    opacity: 1;
    background: #28a745 !important;
    border-color: #28a745 !important;
}

#manual-location-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#logout-button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    position: relative;
    overflow: hidden;
}

#logout-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#logout-button:hover::before {
    left: 100%;
}

#logout-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #a02622 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

/* Main Screen - Map container now handled in main content layout */

/* Main Content Layout (top matches nav bar height: 56px mobile, 60px desktop) */
#main-content {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    height: calc(100vh - 56px);
}

@media (min-width: 992px) {
    #main-content {
        top: 60px;
        height: calc(100vh - 60px);
    }
}

/* Map Container */
#map-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    min-width: 300px;
    box-sizing: border-box;
    background: #f0f0f0; /* Temporary background to ensure visibility */
}

/* Input Bar in App Bar */
#input-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e1e5e9;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xs) var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 350px;
}

#word-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: var(--font-sm);
    padding: var(--spacing-xs);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#word-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

#submit-word {
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: var(--font-sm);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s ease;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs) var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 32px;
}

#submit-word:hover:not(:disabled) {
    background: #2563eb;
}

#submit-word:active:not(:disabled) {
    background: #1d4ed8;
}

#submit-word:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

#word-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    font-weight: 400;
    color: #2c3e50;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    text-align: center;
}

#word-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

#word-input:focus {
    outline: none;
}

#submit-word {
    padding: 16px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s ease;
    border-right: 1px solid #e1e5e9;
    flex-shrink: 0;
}

#submit-word:hover:not(:disabled) {
    background: #2563eb;
}

#submit-word:active:not(:disabled) {
    background: #1d4ed8;
}

#submit-word:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

#submit-word:hover:not(:disabled) {
    background: #0056b3;
}

#submit-word:disabled {
    background: #ccc;
    cursor: not-allowed;
}





/* Chat Conversation Panel */
.chat-conversation {
    width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: var(--z-modal);
}

.chat-conversation.hidden {
    display: none;
}

.conversation-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.conversation-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-lg);
    position: relative;
}

.conversation-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #28a745;
    border: 2px solid white;
    border-radius: 50%;
}

.conversation-details {
    display: flex;
    flex-direction: column;
}

.conversation-name {
    font-weight: 600;
    font-size: var(--font-base);
    color: var(--color-text);
}

.conversation-status {
    font-size: var(--font-xs);
    color: #666;
}

.conversation-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    background: #f8f9fa;
}

.conversation-input-container {
    padding: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    gap: var(--spacing-sm);
}

.conversation-input-container #conversation-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #e1e5e9;
    border-radius: var(--radius-xl);
    outline: none;
    font-size: var(--font-base);
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s;
}

.conversation-input-container #conversation-input:focus {
    border-color: #007bff;
}

.conversation-input-container #send-conversation-message {
    background: #007bff;
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.conversation-input-container #send-conversation-message:hover:not(:disabled) {
    background: #0056b3;
}

.conversation-input-container #send-conversation-message:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Group Chat Panel (styled like P2P chat) */
#chat-panel {
    width: 400px;
    height: 500px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#chat-panel:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#chat-panel.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid #e4e6ea;
    border-radius: 16px 16px 0 0;
    color: #050505;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.chat-info {
    display: flex;
    flex-direction: column;
}

#chat-group-name {
    font-weight: 600;
    font-size: 1.1rem;
}

#chat-member-count {
    font-size: 0.8rem;
    color: #666;
}

.leave-button {
    background: none;
    border: none;
    color: #65676b;
    font-size: 16px;
    font-weight: normal;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.leave-button:hover {
    background: #f2f3f5;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
    max-height: 400px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Modern Messenger-style Messages */
.message {
    display: flex;
    margin-bottom: 12px;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease-out;
}

.message.own {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message:not(.own) {
    margin-right: auto;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    margin: 0 8px;
    flex-shrink: 0;
}

.message-content-wrapper {
    background: white;
    border-radius: 18px;
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    max-width: calc(100% - 40px);
    position: relative;
}

.message.own .message-content-wrapper {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.message-content-wrapper::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    top: 12px;
}

.message:not(.own) .message-content-wrapper::before {
    left: -6px;
    border-right-color: #e1e5e9;
    border-left: 0;
}

.message.own .message-content-wrapper::before {
    right: -6px;
    border-left-color: #007bff;
    border-right: 0;
}

.message-user {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #666;
}

.message.own .message-user {
    color: rgba(255, 255, 255, 0.8);
}

.message-content {
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 0.95rem;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

.message.system {
    margin: 8px auto;
    max-width: 70%;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 16px;
    text-align: center;
    box-shadow: none;
}

.message.system .message-content-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
}

.message.system .message-content {
    color: #856404;
    font-style: italic;
    font-size: 0.85rem;
}

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

.chat-input-container {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e4e6ea;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    gap: 12px;
    border-radius: 0 0 16px 16px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e4e6ea;
    border-radius: 24px;
    outline: none;
    font-size: 0.95rem;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

#chat-input:focus {
    border-color: #007bff;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#chat-input::placeholder {
    color: #8a8d91;
    font-style: italic;
}

#send-message {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

#send-message:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.4);
}

#send-message:active {
    transform: translateY(0) scale(0.98);
}

#send-message:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.typing-indicator {
    padding: 0.5rem 1rem;
    font-style: italic;
    color: #666;
    font-size: 0.8rem;
}

.typing-indicator.hidden {
    display: none;
}

/* Location Prompt */
.location-prompt {
    position: absolute;
    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: 2000;
}

.location-prompt.hidden {
    display: none;
}

.location-prompt-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
}

.location-button {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background 0.2s;
}

.location-button:hover {
    background: #0056b3;
}

/* Popular Words Dropdown */
.popular-words-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1100;
    display: none;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.popular-words-list {
    padding: 8px;
}

.popular-word-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 16px;
    color: #374151;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.popular-word-item:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.popular-word-item.highlighted {
    background: rgba(0, 123, 255, 0.15);
    color: #007bff;
    font-weight: 500;
}

.popular-word-item:active {
    transform: scale(0.98);
}

/* Chat Invitation Notifications */
.notifications-container {
    position: fixed;
    top: calc(var(--spacing-xl) + 80px);
    right: var(--spacing-xl);
    z-index: var(--z-toast);
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.chat-invitation-notification {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    animation: slideInRight 0.3s ease forwards;
    border-right: 4px solid #007bff;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.invitation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.invitation-icon {
    color: #007bff;
    font-size: 1.5rem;
    background: rgba(0, 123, 255, 0.1);
    padding: 8px;
    border-radius: 50%;
}

.invitation-content {
    flex: 1;
}

.invitation-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.invitation-message {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.4;
}

.invitation-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.invitation-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invitation-btn:hover {
    transform: translateY(-1px);
}

.accept-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.accept-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.decline-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.decline-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease forwards;
    max-width: 400px;
    text-align: center;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.toast-notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-notification.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Marker Labels */
.marker-label {
    position: absolute;
    z-index: 100;
    pointer-events: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Marker offset indicator */
.marker-offset-indicator {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 123, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.5); opacity: 0.3; }
    100% { transform: scale(1); opacity: 0.6; }
}

.other-user-label {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 123, 255, 0.3);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    text-align: center;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.other-user-label:hover {
    transform: translateY(2px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 123, 255, 0.5);
}

.marker-label-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.marker-label-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.marker-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.marker-icon-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.marker-icon-placeholder i {
    margin: 0;
}

.marker-label-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}

.marker-label-profession {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.marker-label-category {
    font-size: 0.7rem;
    color: #059669;
    font-weight: 600;
    background: rgba(5, 150, 105, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    margin-top: 2px;
}

/* ==============================================
   MOBILE-FIRST RESPONSIVE DESIGN SYSTEM
   ============================================== */

/* BASE MOBILE STYLES (320px and up) */
@media (min-width: var(--breakpoint-xs)) {
    /* Touch-friendly base styles */
    button, input, select, textarea {
        min-height: var(--touch-target-min);
        min-width: var(--touch-target-min);
    }

    /* App bar mobile adjustments */
    #app-bar {
        padding: 0 var(--spacing-sm);
    }

    .app-title {
        font-size: var(--font-lg);
    }

    .app-bar-center {
        display: none; /* Hide input bar in app bar on mobile */
    }

    #current-user-name {
        display: none; /* Hide username on small screens */
    }

    #user-controls {
        gap: var(--spacing-2xs);
    }

    .control-button {
        padding: var(--spacing-xs);
        min-width: 40px;
        min-height: 40px;
    }

    /* Add floating input bar for mobile */
    #input-bar {
        position: fixed;
        top: 70px;
        left: var(--spacing-xs);
        right: var(--spacing-xs);
        width: auto;
        min-width: unset;
        max-width: unset;
        padding: var(--spacing-xs);
        border-radius: var(--radius-md);
        z-index: var(--z-sticky);
        box-shadow: var(--shadow-lg);
    }

    #word-input {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-base);
        min-height: var(--touch-target-min);
    }

    #submit-word {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-sm);
        min-width: 80px;
        min-height: var(--touch-target-min);
    }

    /* Main content mobile adjustments */
    #main-content {
        top: 140px; /* Account for app bar + floating input bar */
    }


    /* Group chat panel mobile behavior */
    #chat-panel {
        position: fixed;
        right: -400px;
        top: 140px; /* Below app bar + input bar */
        bottom: var(--spacing-sm);
        left: var(--spacing-sm);
        width: auto;
        height: auto;
        z-index: var(--z-modal);
        box-shadow: var(--shadow-xl);
        transition: transform 0.3s ease;
        max-height: calc(100vh - 160px);
    }

    #chat-panel:not(.hidden) {
        transform: translateX(-400px);
    }

    #chat-panel.hidden {
        transform: translateX(0);
    }

    .chat-conversation {
        position: fixed;
        right: -400px;
        top: 60px;
        bottom: 0;
        z-index: var(--z-modal);
        box-shadow: var(--shadow-xl);
        transition: transform 0.3s ease;
    }

    .chat-conversation.open {
        transform: translateX(-400px);
    }

    /* P2P Chats - stacked on mobile */
    .p2p-chats-container {
        bottom: calc(var(--touch-target-min) + var(--spacing-lg));
        left: var(--spacing-xs);
        right: var(--spacing-xs);
        max-width: unset;
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        z-index: var(--z-tooltip);
    }

    .p2p-chat {
        width: 100%;
        height: 280px;
        margin-bottom: 0;
        border-radius: var(--radius-xl);
    }

    .p2p-chat-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .p2p-chat-name {
        font-size: var(--font-sm);
    }

    .p2p-chat-status {
        font-size: var(--font-2xs);
    }

    .p2p-messages {
        padding: var(--spacing-sm) var(--spacing-md);
        max-height: 180px;
    }

    .p2p-input-container {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .p2p-input {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-base);
        min-height: var(--touch-target-min);
    }

    .send-p2p-message {
        width: var(--touch-target-min);
        height: var(--touch-target-min);
        padding: var(--spacing-xs);
    }

    /* Notifications - full width on mobile */
    .notifications-container {
        top: calc(var(--spacing-xl) + 140px); /* Account for app bar + input bar */
        left: var(--spacing-xs);
        right: var(--spacing-xs);
        max-width: unset;
        z-index: var(--z-toast);
    }

    .chat-invitation-notification {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-xs);
        border-radius: var(--radius-lg);
        max-width: unset;
    }

    .invitation-header {
        gap: var(--spacing-sm);
    }

    .invitation-title {
        font-size: var(--font-sm);
    }

    .invitation-message {
        font-size: var(--font-xs);
    }

    .invitation-actions {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .invitation-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-xs);
        width: 100%;
        justify-content: center;
        min-height: var(--touch-target-min);
    }

    /* Toast notifications */
    .toast-notification {
        max-width: calc(100vw - 2 * var(--spacing-md));
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-sm);
        border-radius: var(--radius-md);
    }

    /* Popular words dropdown */
    .popular-words-dropdown {
        width: calc(100vw - 2 * var(--spacing-xs));
        max-width: unset;
        margin-top: var(--spacing-xs);
        border-radius: var(--radius-md);
    }

    .popular-words-list {
        padding: var(--spacing-xs);
    }

    .popular-word-item {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-sm);
        border-radius: var(--radius-sm);
        min-height: var(--touch-target-min);
    }

    /* Location prompt */
    .location-prompt-content {
        padding: var(--spacing-2xl);
        max-width: calc(100vw - 2 * var(--spacing-lg));
        border-radius: var(--radius-lg);
    }

    .location-button {
        padding: var(--spacing-md) var(--spacing-2xl);
        font-size: var(--font-base);
        margin-top: var(--spacing-lg);
        border-radius: var(--radius-md);
        min-height: var(--touch-target-min);
    }

    /* Marker labels - optimized for mobile */
    .other-user-label {
        min-width: 100px;
        padding: var(--spacing-xs) var(--spacing-sm);
        border-radius: var(--radius-md);
        font-size: var(--font-xs);
    }

    .marker-label-name {
        font-size: var(--font-xs);
    }

    .marker-label-profession {
        font-size: var(--font-2xs);
    }

    .marker-label-category {
        font-size: var(--font-2xs);
        padding: 1px var(--spacing-xs);
        border-radius: var(--radius-xs);
    }

    /* Messages - touch-friendly */
    .message {
        margin-bottom: var(--spacing-sm);
        max-width: 85%;
        min-height: var(--touch-target-min);
    }

    .message-content-wrapper {
        padding: var(--spacing-xs) var(--spacing-sm);
        border-radius: var(--radius-xl);
    }
}

/* SMALL DEVICES (576px and up) */
@media (min-width: var(--breakpoint-sm)) {
    .auth-container {
        padding: var(--spacing-2xl);
        margin: var(--spacing-lg);
        width: var(--container-sm);
    }

    .app-title {
        font-size: var(--font-3xl);
    }

    .app-subtitle {
        font-size: var(--font-base);
    }

    /* Input bar - center positioned */
    #input-bar {
        top: var(--spacing-sm);
        left: 50%;
        right: auto;
        width: 90vw;
        min-width: 350px;
        max-width: 500px;
        transform: translateX(-50%);
    }

    #word-input {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-lg);
    }

    #submit-word {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-base);
    }

    /* User info bar - top right */
    #user-info-bar {
        top: var(--spacing-xl);
        bottom: auto;
        right: var(--spacing-xl);
        left: auto;
        width: auto;
        max-width: 300px;
    }

    #current-user-name {
        max-width: 150px;
    }

    #user-controls {
        gap: var(--spacing-sm);
    }

    .control-button, #manual-location-btn, #logout-button {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-sm);
    }

    /* Chat panel - left side */
    #chat-panel {
        bottom: var(--spacing-xl);
        left: var(--spacing-xl);
        right: auto;
        width: 350px;
        max-height: 55vh;
    }

    .chat-messages {
        max-height: 30vh;
    }

    /* P2P Chats - right side */
    .p2p-chats-container {
        bottom: var(--spacing-xl);
        right: var(--spacing-xl);
        left: auto;
        max-width: calc(100vw - 400px);
        flex-direction: row-reverse;
    }

    .p2p-chat {
        width: 300px;
        height: 400px;
        margin-bottom: 0;
    }

    /* Notifications */
    .notifications-container {
        left: var(--spacing-xl);
        right: var(--spacing-xl);
        max-width: calc(100vw - 2 * var(--spacing-xl));
    }

    .chat-invitation-notification {
        max-width: 400px;
        margin: 0 auto var(--spacing-xs);
    }

    .invitation-actions {
        flex-direction: row;
        gap: var(--spacing-sm);
    }

    .invitation-btn {
        width: auto;
        flex: 1;
    }

    /* Location prompt */
    .location-prompt-content {
        max-width: 320px;
    }
}

/* MEDIUM DEVICES (768px and up) */
@media (min-width: var(--breakpoint-md)) {
    body {
        font-size: var(--font-base);
    }

    .auth-container {
        width: var(--container-md);
        max-width: var(--container-md);
        margin: var(--spacing-xl) auto;
    }

    /* Input bar */
    #input-bar {
        width: 70vw;
        min-width: 400px;
        max-width: 600px;
    }

    /* User info bar */
    #user-info-bar {
        top: var(--spacing-2xl);
        right: var(--spacing-2xl);
    }

    /* Chat panel */
    #chat-panel {
        bottom: var(--spacing-2xl);
        left: var(--spacing-2xl);
        width: 400px;
        max-height: 60vh;
    }

    .chat-messages {
        max-height: 35vh;
    }

    /* P2P Chats */
    .p2p-chats-container {
        right: var(--spacing-2xl);
        bottom: var(--spacing-2xl);
        max-width: calc(100vw - 470px);
    }

    .p2p-chat {
        width: 320px;
        height: 450px;
    }

    /* Notifications */
    .notifications-container {
        left: var(--spacing-2xl);
        right: var(--spacing-2xl);
        max-width: calc(100vw - 4 * var(--spacing-2xl));
    }
}

/* LARGE DEVICES (992px and up) */
@media (min-width: var(--breakpoint-lg)) {
    .auth-container {
        width: var(--container-lg);
        max-width: var(--container-lg);
    }

    /* Input bar */
    #input-bar {
        width: 60vw;
        min-width: 500px;
        max-width: 700px;
    }

    /* Chat panel */
    #chat-panel {
        width: 450px;
    }

    /* P2P Chats */
    .p2p-chats-container {
        max-width: calc(100vw - 520px);
    }

    .p2p-chat {
        width: 350px;
        height: 480px;
    }
}

/* EXTRA LARGE DEVICES (1200px and up) */
@media (min-width: var(--breakpoint-xl)) {
    .auth-container {
        width: var(--container-xl);
        max-width: var(--container-xl);
    }

    /* Input bar */
    #input-bar {
        width: 50vw;
        max-width: 800px;
    }

    /* Chat panel */
    #chat-panel {
        width: 480px;
    }

    /* P2P Chats */
    .p2p-chats-container {
        max-width: calc(100vw - 560px);
    }

    .p2p-chat {
        width: 380px;
        height: 500px;
    }
}

/* 2XL DEVICES (1400px and up) */
@media (min-width: var(--breakpoint-2xl)) {
    .auth-container {
        width: var(--container-2xl);
        max-width: var(--container-2xl);
    }

    /* Input bar */
    #input-bar {
        width: 40vw;
        max-width: 900px;
    }

    /* Chat panel */
    #chat-panel {
        width: 520px;
    }

    /* P2P Chats */
    .p2p-chats-container {
        max-width: calc(100vw - 600px);
    }

    .p2p-chat {
        width: 420px;
        height: 520px;
    }
}

/* SPECIAL CASES */

/* Touch devices - ensure minimum touch targets */
@media (pointer: coarse) {
    button, input, select, textarea, .popular-word-item, .message {
        min-height: var(--touch-target-min) !important;
        min-width: var(--touch-target-min) !important;
    }

    input, textarea {
        font-size: var(--font-base) !important; /* Prevents zoom on iOS */
    }
}

/* Landscape orientation on small screens */
@media (max-height: 500px) and (orientation: landscape) {
    #input-bar {
        top: var(--spacing-2xs);
        padding: var(--spacing-2xs);
    }

    #word-input {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-sm);
    }

    #submit-word {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-xs);
    }

    #user-info-bar {
        top: var(--spacing-2xs);
        bottom: auto;
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    #chat-panel {
        max-height: 35vh;
    }

    .chat-messages {
        max-height: 20vh;
    }

    .p2p-chat {
        height: 250px;
    }

    .p2p-messages {
        max-height: 150px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-container, #chat-panel, .p2p-chat, .other-user-label {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .space-background .stars,
    .space-background .planets {
        transform: scale(0.8);
    }

    .planet {
        filter: blur(0.5px);
    }
}

/* Print styles */
@media print {
    .space-background, .stars, .planets,
    #input-bar, #user-info-bar, #chat-panel,
    .p2p-chats-container, .notifications-container {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* Group Notification Toast */
.group-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    animation: slideDown 0.5s ease-out;
}

.group-notification-content {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    font-weight: 500;
}

.dismiss-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-left: 16px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.dismiss-btn:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* P2P Chat Window */
.p2p-chats-container {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    z-index: var(--z-tooltip);
    display: flex;
    flex-direction: row-reverse;
    gap: var(--spacing-md);
    align-items: flex-end;
    max-width: calc(100vw - 480px); /* Leave space for main chat panel */
    overflow-x: auto;
    padding-bottom: var(--spacing-xs);
}

.p2p-chat {
    width: 350px;
    min-width: 320px;
    max-width: calc(100vw - 40px);
    height: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    animation: slideInChat 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e4e6ea;
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.p2p-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 6px 20px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.p2p-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid #e4e6ea;
    border-radius: 16px 16px 0 0;
    color: #050505;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.p2p-chat-header:hover {
    background: linear-gradient(135deg, #f0f2f5 0%, #e9ecef 100%);
    transform: translateY(-1px);
}

.p2p-chat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.p2p-chat-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #050505;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p2p-chat-status {
    font-size: 0.75rem;
    color: #8a8d91;
    margin-top: 2px;
}

.p2p-chat-status {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 400;
    margin-top: 2px;
}

.p2p-chat-actions {
    display: flex;
    gap: 4px;
}

.minimize-btn, .close-btn {
    background: none;
    border: none;
    color: #65676b;
    font-size: 16px;
    font-weight: normal;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.minimize-btn:hover, .close-btn:hover {
    background: #f2f3f5;
}

.minimize-btn {
    font-size: 14px;
    line-height: 1;
}

.p2p-chat.collapsed {
    height: auto;
    cursor: pointer;
    transition: all 0.2s ease;
}

.p2p-chat.collapsed .p2p-messages,
.p2p-chat.collapsed .p2p-input-container {
    display: none;
}

.p2p-chat.collapsed:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.p2p-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.p2p-messages::-webkit-scrollbar {
    width: 6px;
}

.p2p-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.p2p-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.p2p-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.p2p-input-container {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e4e6ea;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    gap: 12px;
    border-radius: 0 0 16px 16px;
}

.p2p-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e4e6ea;
    border-radius: 24px;
    outline: none;
    font-size: 0.95rem;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

.p2p-input:focus {
    border-color: #007bff;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.p2p-input::placeholder {
    color: #8a8d91;
    font-style: italic;
}

.send-p2p-message {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.send-p2p-message:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.4);
}

.send-p2p-message:active {
    transform: translateY(0) scale(0.98);
}

.send-p2p-message:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#send-p2p-message:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@keyframes slideInChat {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Space Background Animations */
@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) rotate(-5deg);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 40px rgba(45, 90, 39, 0.6);
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        box-shadow: 0 0 60px rgba(45, 90, 39, 0.9);
        transform: translate(-50%, -50%) scale(1.05);
    }
}


.title-text {
    background: linear-gradient(90deg, #ffffff 0%, #e0e0ff 50%, #ffffff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes letterBounce {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes authGlow {
    0% {
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.2),
            0 4px 16px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
        border-color: rgba(255, 255, 255, 0.3);
    }
    100% {
        box-shadow:
            0 12px 40px rgba(0, 123, 255, 0.15),
            0 6px 20px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 123, 255, 0.4);
    }
}

/* Filter Dialog */
.filter-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    backdrop-filter: blur(5px);
}

.filter-dialog.hidden {
    display: none;
}

.filter-dialog-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    max-width: 90vw;
    direction: rtl;
}

.filter-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.filter-dialog-header h3 {
    margin: 0;
    font-size: var(--font-lg);
    font-weight: 600;
    color: #333;
}

.close-filter-btn {
    background: none;
    border: none;
    font-size: var(--font-xl);
    cursor: pointer;
    color: #666;
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.close-filter-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.filter-dialog-body {
    padding: var(--spacing-lg);
}

.filter-group {
    margin-bottom: var(--spacing-lg);
}

.filter-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: #333;
    font-size: var(--font-sm);
}

.filter-group select {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter-group select:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.filter-dialog-actions {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.filter-action-btn {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: var(--touch-target-min);
}

.apply-btn {
    background: #007bff;
    color: white;
}

.apply-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* Profile Dialog */
.profile-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    backdrop-filter: blur(5px);
}

.profile-dialog.hidden {
    display: none;
}

.profile-dialog-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    direction: rtl;
}

.profile-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.profile-dialog-header h3 {
    margin: 0;
    font-size: var(--font-lg);
    font-weight: 600;
    color: #333;
}

.close-profile-btn {
    background: none;
    border: none;
    font-size: var(--font-xl);
    cursor: pointer;
    color: #666;
    width: var(--touch-target-min);
    height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.close-profile-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.profile-dialog-body {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: #f8f9fa;
    border-radius: var(--radius-md);
}

.current-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
}

#current-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.avatar-upload {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.upload-btn, .delete-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-sm);
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.upload-btn {
    background: #007bff;
    color: white;
}

.upload-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.upload-info {
    text-align: center;
    color: #6c757d;
    font-size: var(--font-xs);
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: var(--font-sm);
}

.form-group input {
    padding: var(--spacing-md);
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-group input[readonly] {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.profile-dialog-actions {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.profile-action-btn {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.save-btn {
    background: #28a745;
    color: white;
}

.save-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-text, .btn-loading {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Islamic & Arabic Themed Components */

/* Islamic Star Decorations */
.islamic-star::before {
    content: "★";
    color: #28a745;
    font-size: 1.2em;
    opacity: 0.7;
}

.islamic-star-large::before {
    content: "★";
    color: #007bff;
    font-size: 2em;
    opacity: 0.5;
    position: absolute;
    top: -10px;
    right: -10px;
}

/* Arabic Calligraphy Elements */
.calligraphy-decoration {
    position: relative;
    padding: var(--spacing-lg);
    border: 2px solid #28a745;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.02) 100%);
}

.calligraphy-decoration::before {
    content: "بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ";
    position: absolute;
    top: -15px;
    right: 20px;
    background: white;
    padding: 0 var(--spacing-sm);
    font-family: 'Scheherazade New', 'Amiri', serif;
    font-size: 0.9rem;
    color: #28a745;
    font-weight: 700;
}

/* Islamic Geometric Patterns */
.geometric-pattern {
    background-image:
        radial-gradient(circle at 25% 25%, #28a745 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, #007bff 2px, transparent 2px);
    background-size: 20px 20px;
    opacity: 0.1;
}

/* Arabic Welcome Message */
.arabic-welcome {
    font-family: 'Scheherazade New', 'Amiri', serif;
    font-size: var(--font-xl);
    font-weight: 700;
    color: #28a745;
    text-align: center;
    margin: var(--spacing-xl) 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Islamic Icon Styles */
.islamic-icon {
    color: #28a745;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.islamic-icon:hover {
    color: #218838;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Arabic Text Effects */
.arabic-glow {
    text-shadow:
        0 0 5px rgba(40, 167, 69, 0.3),
        0 0 10px rgba(40, 167, 69, 0.2),
        0 0 15px rgba(40, 167, 69, 0.1);
}

/* Islamic Border Decorations */
.islamic-border {
    position: relative;
    border: 3px solid #28a745;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.islamic-border::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(40, 167, 69, 0.1) 10px,
        rgba(40, 167, 69, 0.1) 20px
    );
    pointer-events: none;
}

/* Arabic Button Styles */
.btn-arabic {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 600;
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.btn-arabic:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Islamic Loading Animation */
.islamic-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
    border-radius: 50%;
    animation: islamic-spin 1s linear infinite;
}

@keyframes islamic-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Arabic Notification Styles */
.notification-arabic {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
    font-weight: 500;
    border-right: 4px solid #28a745;
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
}

/* Islamic Card Styles */
.card-islamic {
    border: 2px solid #28a745;
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.9) 100%);
    backdrop-filter: blur(10px);
}

/* Arabic Form Styles */
.form-arabic input,
.form-arabic select,
.form-arabic textarea {
    font-family: 'Noto Sans Arabic', 'Tajawal', sans-serif;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
}

.form-arabic input:focus,
.form-arabic select:focus,
.form-arabic textarea:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    transform: translateY(-1px);
}

/* ==============================================
   MESSENGER PAGE (Facebook-style)
   ============================================== */
.messenger-screen {
    position: fixed;
    inset: 0;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    background: #f0f2f5;
    z-index: 2050;
    transition: opacity 0.25s ease;
}

@media (min-width: 992px) {
    .messenger-screen {
        top: 60px;
    }
}

.messenger-screen.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.messenger-layout {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.messenger-sidebar {
    width: 320px;
    min-width: 280px;
    max-width: 100%;
    background: #fff;
    border-left: 1px solid #e4e6ea;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.messenger-sidebar-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid #e4e6ea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.messenger-sidebar-header h2 {
    margin: 0;
    font-size: var(--font-xl);
    font-weight: 700;
    color: #050505;
}

.messenger-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: #e4e6ea;
    color: #050505;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.messenger-back-btn:hover {
    background: #d8dadf;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xs);
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
    border: none;
    width: 100%;
    text-align: right;
    background: transparent;
    font-family: inherit;
}

.chat-list-item:hover {
    background: #f0f2f5;
}

.chat-list-item.active {
    background: #e7f3ff;
}

.chat-list-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: var(--font-lg);
    flex-shrink: 0;
}

.chat-list-item-body {
    flex: 1;
    min-width: 0;
}

.chat-list-item-name {
    font-weight: 600;
    font-size: var(--font-base);
    color: #050505;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-list-item-preview {
    font-size: var(--font-sm);
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-list-empty {
    padding: var(--spacing-2xl);
    text-align: center;
    color: #65676b;
    font-size: var(--font-sm);
}

.messenger-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
}

.messenger-conversation-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid #e4e6ea;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: #fff;
}

.messenger-conversation-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    flex-shrink: 0;
}

.messenger-conversation-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    color: #65676b;
    font-size: var(--font-lg);
    padding: var(--spacing-2xl);
}

.messenger-conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    background: #f0f2f5;
}

.messenger-conversation-input-row {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid #e4e6ea;
    background: #fff;
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.messenger-conversation-input-row input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #e4e6ea;
    border-radius: 24px;
    font-size: var(--font-base);
    outline: none;
    min-height: var(--touch-target-min);
}

.messenger-conversation-input-row input:focus {
    border-color: #007bff;
}

.messenger-conversation-input-row button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #007bff;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.messenger-conversation-input-row button:hover:not(:disabled) {
    background: #0056b3;
}

.messenger-conversation-input-row button:disabled {
    background: #e4e6ea;
    color: #65676b;
    cursor: not-allowed;
}

/* Mobile polish: clear navbar/search/drawer/notifications */
@media (max-width: 767px) {
    .nav-bar,
    #app-bar {
        height: 64px;
        min-height: 64px;
    }

    #main-content {
        top: 64px;
        height: calc(100vh - 64px);
    }

    .app-bar-inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px;
        padding: 0 8px;
    }

    .app-bar-left {
        min-width: 56px;
    }

    .app-title {
        font-size: 1rem;
        max-width: 68px;
    }

    .app-bar-center {
        display: flex !important;
        max-width: none;
        margin: 0;
    }

    #input-bar {
        width: 100%;
        max-width: none;
        min-height: 42px;
        border-radius: 14px;
        border: 1px solid #d9dee6;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
        background: #fff;
    }

    #word-input {
        font-size: 14px !important;
        padding: 10px 8px !important;
        text-align: right;
    }

    #submit-word {
        min-width: 40px;
        min-height: 34px;
        border-radius: 10px;
        padding: 8px 10px;
    }

    .app-bar-right {
        gap: 6px;
    }

    .app-bar-right .nav-btn {
        display: none;
    }

    #notifications-bell.nav-btn {
        display: inline-flex;
    }

    #current-user-info {
        display: none !important;
    }

    .nav-menu-toggle {
        display: inline-flex;
        border-radius: 12px;
        width: 42px;
        height: 42px;
        background: #eef2f7;
        color: #1f2937;
    }

    .messenger-back-btn {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: #e7f0ff;
        color: #1d4ed8;
        border: 1px solid #bfdbfe;
    }

    .messenger-conversation-header {
        position: sticky;
        top: 0;
        z-index: 3;
    }

    .messenger-conversation-back-btn {
        display: inline-flex;
    }

    .messenger-conversation-back-btn.hidden {
        display: none !important;
    }

    .nav-drawer {
        top: 0 !important;
        z-index: 3100 !important;
    }

    .nav-drawer-panel {
        width: min(340px, 90vw);
        max-width: 90vw;
        padding-top: env(safe-area-inset-top);
        border-left: 1px solid #e5e7eb;
        box-shadow: -12px 0 36px rgba(2, 6, 23, 0.25);
    }

    .notification-center {
        top: 0 !important;
        right: 0 !important;
        width: min(360px, 92vw) !important;
        max-width: 92vw !important;
        height: 100vh !important;
        z-index: 4200 !important;
        border-left: 1px solid #e5e7eb !important;
        box-shadow: -12px 0 32px rgba(2, 6, 23, 0.2) !important;
    }
}

/* Notification center - Facebook-style, no collapse */
.notification-center {
    position: fixed;
    top: 56px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 16px);
    height: calc(100vh - 56px);
    min-height: 320px;
    max-height: 560px;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 0;
    border-top: none;
    z-index: 3900;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s;
}

body.notification-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.35);
    z-index: 4190;
}

.notification-center.open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
}

.notification-center-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: #fff;
}

.notification-center-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #050505;
}

.notification-center-dismiss-all {
    background: none;
    border: none;
    color: #1877f2;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.notification-center-dismiss-all:hover {
    background: #f0f2f5;
}

.notification-center-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.notification-center-empty {
    padding: 48px 24px;
    text-align: center;
    color: #65676b;
    font-size: 0.9375rem;
}

/* Facebook-style notification item */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border: none;
    border-radius: 0;
    width: 100%;
    text-align: right;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.notification-item:hover {
    background: #f0f2f5;
}

.notification-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-item-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

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

.notification-item-text {
    font-size: 0.9375rem;
    color: #050505;
    line-height: 1.333;
    margin-bottom: 2px;
}

.notification-item-time {
    font-size: 0.8125rem;
    color: #65676b;
}

.notification-item .notification-item-avatar i {
    font-size: 1.25rem;
}

/* App bar messages button */
#messages-nav-btn {
    position: relative;
}

#messages-nav-btn .unread-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 992px) {
    .notification-center {
        top: 60px;
        max-height: 580px;
    }
}

/* Messenger responsive */
@media (max-width: 767px) {
    .messenger-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .messenger-conversation.has-conversation {
        position: absolute;
        inset: 0;
        z-index: 2;
        background: #fff;
    }

    .messenger-conversation-placeholder {
        display: none;
    }
}

@media (min-width: 768px) {
    .messenger-sidebar {
        width: 360px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}
