/* ==========================================
   HYPER MESSENGER — REDESIGNED CSS
   Modern dark theme with glassmorphism
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-base:     #07090f;
    --bg-surface:  #0d1018;
    --bg-elevated: #131820;
    --bg-hover:    #192030;
    --bg-active:   #1e2840;

    --accent:       #00c8d4;
    --accent-hover: #00dde9;
    --accent-glow:  rgba(0, 200, 212, 0.22);
    --accent-subtle:rgba(0, 200, 212, 0.08);

    --green:  #2dc76d;
    --red:    #ff4757;
    --purple: #a855f7;

    --text-primary:   #eef0f8;
    --text-secondary: #7d8899;
    --text-muted:     #3e4a5a;

    --border:        rgba(255,255,255,0.055);
    --border-accent: rgba(0,200,212,0.22);

    --radius-sm:   10px;
    --radius-md:   16px;
    --radius-lg:   22px;
    --radius-xl:   28px;
    --radius-full: 9999px;

    --shadow-sm:     0 2px 8px  rgba(0,0,0,0.35);
    --shadow-md:     0 8px 24px rgba(0,0,0,0.45);
    --shadow-lg:     0 16px 52px rgba(0,0,0,0.65);
    --shadow-accent: 0 6px 28px rgba(0,200,212,0.22);

    --glass: rgba(13,16,24,0.88);

    --sidebar-width: 300px;
    --header-height: 64px;
    --transition: 0.22s cubic-bezier(0.4,0,0.2,1);

    --transition-spring: 0.45s cubic-bezier(0.34,1.56,0.64,1);
    --transition-fast:   0.14s cubic-bezier(0.4,0,0.2,1);
    --aurora-1: rgba(0,200,212,0.16);
    --aurora-2: rgba(168,85,247,0.13);
    --aurora-3: rgba(0,120,180,0.12);
}

/* ==========================================
   RESET & BASE
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, select, button, textarea { font-family: inherit; font-size: 1rem; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ==========================================
   AUTH PAGES
   ========================================== */
.container { display: flex; width: 100%; height: 100%; }

.left-side {
    flex: 1;
    background: url('https://images.unsplash.com/photo-1639762681485-074b7f938ba0?w=1200&q=80') no-repeat center center / cover;
    position: relative;
    overflow: hidden;
    animation: kenBurns 24s ease-in-out infinite alternate;
}
@keyframes kenBurns {
    0%   { background-size: 100% 100%; }
    100% { background-size: 118% 118%; }
}
.left-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(0,200,212,0.18) 0%,
        rgba(7,9,15,0.55) 50%,
        rgba(7,9,15,0.97) 100%);
    z-index: 1;
}
.left-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 65%, rgba(0,200,212,0.10) 0%, transparent 55%);
    z-index: 2;
}

.right-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
}
.right-side::before {
    content: '';
    position: absolute;
    bottom: -120px; right: -120px;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(0,200,212,0.055) 0%, transparent 70%);
    pointer-events: none;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.45s cubic-bezier(0.4,0,0.2,1) both;
}

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

.auth-box h2 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.auth-box p { color: var(--text-secondary); margin-bottom: 30px; font-size: 14px; }
.auth-box a { color: var(--accent); text-decoration: none; font-weight: 600; transition: color var(--transition); }
.auth-box a:hover { color: var(--accent-hover); }

.input-group { margin-bottom: 18px; }
.input-group label { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.input-group input,
.input-group select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input-group input:focus,
.input-group select:focus {
    border-color: var(--accent);
    background: var(--bg-hover);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-group input::placeholder { color: var(--text-muted); }

/* Primary button */
.btn-round {
    width: 100%;
    padding: 15px 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent) 0%, #009baa 100%);
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 28px;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow-accent);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}
.btn-round::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
    pointer-events: none;
}
.btn-round:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(0,200,212,0.38); }
.btn-round:active { transform: translateY(0); }

/* Loading dots */
.dots { display: none; justify-content: center; align-items: center; gap: 5px; }
.dots span { width: 7px; height: 7px; background: rgba(255,255,255,0.9); border-radius: 50%; animation: bounce 0.6s infinite alternate; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { to { transform: translateY(-8px); opacity: 0.55; } }

/* Toast */
.toast-error {
    position: fixed;
    bottom: -120px; left: 24px;
    background: linear-gradient(135deg, #1c0b0b, #2a1010);
    border: 1px solid rgba(255,71,87,0.3);
    color: #fff;
    padding: 16px 22px;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(255,71,87,0.22);
    transition: bottom 0.4s cubic-bezier(0.4,0,0.2,1);
    z-index: 9999;
    min-width: 280px;
}
.toast-error.show { bottom: 24px; }

/* ==========================================
   MESSENGER APP LAYOUT
   ========================================== */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: var(--bg-base);
    overflow: hidden;
}

/* ==========================================
   LEFT SIDEBAR
   ========================================== */
.sidebar-chats {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
    flex-shrink: 0;
}
.brand-header:hover { background: var(--bg-elevated); }
.brand-header span { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }

.section-title {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 18px 20px 6px 20px;
}

.chat-list-items {
    flex: 1;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.chat-link {
    display: flex;
    align-items: center;
    padding: 11px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    gap: 12px;
}
.chat-link:hover { background: var(--bg-hover); color: var(--text-primary); transform: translateX(2px); }
.chat-link.active {
    background: var(--bg-active);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent), 0 2px 10px rgba(0,200,212,0.07);
}
.chat-link .icon-box { font-size: 16px; width: 26px; text-align: center; flex-shrink: 0; }

/* Search */
input#userSearchInput {
    display: block;
    width: calc(100% - 20px);
    margin: 8px 10px;
    padding: 9px 14px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
input#userSearchInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
input#userSearchInput::placeholder { color: var(--text-muted); }

/* Profile footer */
.user-profile-footer {
    height: 68px;
    background: var(--bg-base);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 14px;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
.user-meta { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.meta-username { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Avatars */
.avatar-circle {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    background-color: var(--bg-elevated);
    border: 2px solid var(--accent);
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    transition: box-shadow var(--transition);
}
.avatar-circle:hover { box-shadow: 0 0 0 4px var(--accent-glow); }

.avatar-letter {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    text-transform: uppercase;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}

.btn-gear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 19px;
    transition: color var(--transition), transform var(--transition), background var(--transition);
    outline: none;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.btn-gear:hover { color: var(--accent); transform: rotate(45deg); background: var(--accent-subtle); }

/* ==========================================
   MAIN CHAT VIEWPORT
   ========================================== */
.main-chat-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    min-width: 0;
}

.viewport-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 16px;
    background: var(--bg-surface);
    gap: 12px;
    flex-shrink: 0;
}

.messages-scroller {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-row { display: flex; gap: 10px; align-items: flex-end; animation: msgIn 0.18s ease both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.msg-new-in { animation: msgNewIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both !important; }
@keyframes msgNewIn { 0% { opacity:0; transform:translateY(18px) scale(0.93); } 60% { opacity:1; transform:translateY(-3px) scale(1.02); } 100% { opacity:1; transform:translateY(0) scale(1); } }

.msg-bubble {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 18px 18px 18px 5px;
    padding: 10px 14px;
    max-width: 75%;
    box-shadow: var(--shadow-sm);
}
.msg-bubble h5 { color: var(--accent); font-size: 12px; font-weight: 700; margin-bottom: 4px; letter-spacing: 0.2px; }
.msg-bubble p  { color: var(--text-primary); font-size: 14px; line-height: 1.55; word-break: break-word; }

.msg-row.own { flex-direction: row-reverse; }
.msg-row.own .msg-bubble {
    background: linear-gradient(135deg, #009baa 0%, #007882 100%);
    border-color: transparent;
    border-radius: 18px 18px 5px 18px;
}
.msg-row.own .msg-bubble p  { color: #fff; }
.msg-row.own .msg-bubble h5 { color: rgba(255,255,255,0.75); }

/* Input bar */
.bottom-input-bar { padding: 0 16px 16px; flex-shrink: 0; }

.input-field-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 12px 16px;
    gap: 10px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input-field-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-field-wrapper input { flex: 1; background: none; border: none; outline: none; color: var(--text-primary); font-size: 14px; }
.input-field-wrapper input::placeholder { color: var(--text-muted); }

/* Send button */
.btn-send {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #008a96);
    border: none; color: #fff;
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform var(--transition), box-shadow var(--transition);
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-send:hover { transform: scale(1.1); box-shadow: 0 4px 16px var(--accent-glow); }

/* ==========================================
   RIGHT SIDEBAR
   ========================================== */
.sidebar-members {
    width: 240px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    flex-shrink: 0;
    overflow-y: auto;
}

/* ==========================================
   EMPTY CHAT PLACEHOLDER
   ========================================== */
.empty-chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100vh;
    position: relative;
    background: var(--bg-base);
    animation: delicateGradient 12s ease infinite;
    background-size: 400% 400%;
}
.empty-chat-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 35%, rgba(0,200,212,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 70%, rgba(168,85,247,0.04) 0%, transparent 50%);
    pointer-events: none;
}
@keyframes delicateGradient {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}
.empty-chat-box {
    background: rgba(13,16,24,0.88);
    padding: 48px 60px;
    border-radius: var(--radius-xl);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-accent);
    box-shadow: var(--shadow-lg);
    z-index: 5;
    position: relative;
}
.empty-chat-box h2 { font-size: 25px; color: var(--text-primary) !important; margin-bottom: 10px; font-weight: 700; letter-spacing: -0.3px; }
.empty-chat-box p  { color: var(--text-secondary) !important; font-size: 15px; }

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(4,6,10,0.82);
    backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center;
    z-index: 2000;
}
.modal-overlay.active { display: flex; }

.modal-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 36px;
    border-radius: var(--radius-xl);
    width: 100%; max-width: 460px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.22s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

.modal-box h3 { color: var(--text-primary); font-size: 22px; margin-bottom: 10px; font-weight: 700; }
.modal-box p  { color: var(--text-secondary); font-size: 14px; margin-bottom: 26px; line-height: 1.6; }

.modal-buttons { display: flex; gap: 12px; justify-content: center; width: 100%; }

.modal-btn {
    padding: 12px 28px; border-radius: var(--radius-full);
    border: none; font-weight: 700; cursor: pointer; font-size: 14px;
    transition: all var(--transition);
}
.modal-btn.primary   { background: linear-gradient(135deg, var(--accent), #008a96); color: #fff; box-shadow: var(--shadow-accent); }
.modal-btn.primary:hover   { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,200,212,0.38); }
.modal-btn.secondary { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.modal-btn.secondary:hover { background: var(--bg-active); color: var(--text-primary); }
.modal-btn.decline   { background: linear-gradient(135deg, #ff4757, #cc3344); color: #fff; }
.modal-btn.decline:hover   { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,71,87,0.38); }

/* ==========================================
   CALL UI
   ========================================== */
.btn-call {
    background: linear-gradient(135deg, var(--green), #1a9a50);
    color: #fff; border: none; padding: 8px 18px;
    border-radius: var(--radius-full); cursor: pointer;
    font-weight: 700; font-size: 13px; margin-left: auto;
    transition: all var(--transition);
    box-shadow: 0 2px 12px rgba(45,199,109,0.25);
}
.btn-call:hover { box-shadow: 0 4px 20px rgba(45,199,109,0.4); transform: scale(1.03); }

.calling-ui { text-align: center; padding: 24px; }

.crypto-badge {
    background: var(--accent-subtle); color: var(--accent);
    border: 1px solid var(--border-accent);
    padding: 5px 14px; border-radius: var(--radius-full);
    font-size: 11px; font-weight: 700;
    display: inline-block; margin-bottom: 20px;
    letter-spacing: 0.5px; text-transform: uppercase;
}

.pulse-circle {
    width: 88px; height: 88px;
    background: linear-gradient(135deg, var(--green), #1a9a50);
    border-radius: 50%;
    margin: 0 auto 20px; display: flex;
    align-items: center; justify-content: center;
    font-size: 34px;
    animation: pulseGlow 1.5s infinite alternate;
}
@keyframes pulseGlow {
    0%   { box-shadow: 0 0 0 0   rgba(45,199,109,0.45); }
    100% { box-shadow: 0 0 0 24px rgba(45,199,109,0);   }
}

/* ==========================================
   EMOJI
   ========================================== */
.btn-emoji-trigger { background: none; border: none; font-size: 20px; cursor: pointer; margin-right: 8px; outline: none; transition: transform var(--transition); }
.btn-emoji-trigger:hover { transform: scale(1.2); }

.emoji-picker-popup {
    position: absolute; bottom: 64px; left: 16px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    padding: 12px; border-radius: var(--radius-lg);
    display: none; gap: 8px; z-index: 100;
    box-shadow: var(--shadow-lg); flex-wrap: wrap; max-width: 240px;
}
.emoji-picker-popup.active { display: flex; }
.emoji-item { font-size: 22px; cursor: pointer; transition: transform var(--transition); padding: 2px; border-radius: 6px; }
.emoji-item:hover { transform: scale(1.3); }

/* ==========================================
   CONTEXT MENU
   ========================================== */
.context-menu {
    position: fixed; display: none; z-index: 9999; width: 188px;
    background: var(--glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    animation: fadeIn 0.14s ease;
}
.context-item {
    padding: 10px 14px; font-size: 13px;
    color: var(--text-primary); cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    font-weight: 500;
}
.context-item:hover { background: var(--accent-subtle); color: var(--accent); }
.divider { height: 1px; background: var(--border); margin: 4px 0; }

@keyframes fadeIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }

/* ==========================================
   SETTINGS
   ========================================== */
.settings-container { display: flex; width: 100vw; height: 100vh; background: var(--bg-base); overflow: hidden; }

.settings-sidebar {
    width: 270px; background: var(--bg-surface);
    display: flex; flex-direction: column; align-items: flex-end;
    padding: 56px 20px; border-right: 1px solid var(--border);
    flex-shrink: 0;
}
.settings-menu { width: 190px; display: flex; flex-direction: column; gap: 3px; }

.settings-link {
    color: var(--text-secondary); padding: 10px 14px;
    border-radius: var(--radius-md); font-size: 14px;
    font-weight: 500; cursor: pointer; transition: all var(--transition);
}
.settings-link:hover { background: var(--bg-hover); color: var(--text-primary); transform: translateX(2px); }
.settings-link.active { background: var(--bg-active); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }

.settings-main { flex: 1; padding: 56px 52px; max-width: 720px; overflow-y: auto; }
.settings-content-pane { display: none; }
.settings-content-pane.active { display: block; }
.settings-main h2 { color: var(--text-primary); margin-bottom: 28px; font-size: 24px; font-weight: 800; letter-spacing: -0.3px; }

.settings-form-row { display: flex; gap: 20px; margin-bottom: 20px; }
.settings-form-row .input-group { flex: 1; margin-bottom: 0; }

.close-settings-zone { width: 90px; padding-top: 56px; display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-close-settings {
    width: 40px; height: 40px;
    border: 1px solid var(--border); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); cursor: pointer;
    transition: all var(--transition); font-weight: bold;
    background: var(--bg-elevated);
}
.btn-close-settings:hover { color: var(--text-primary); border-color: var(--accent); background: var(--accent-subtle); transform: rotate(90deg); }

/* 2FA */
.two-factor-box {
    background: var(--bg-elevated); border: 1px solid var(--border);
    padding: 24px; border-radius: var(--radius-lg); margin-top: 32px;
}
.two-factor-box h3 { color: var(--text-primary); font-size: 17px; font-weight: 700; margin-bottom: 8px; }

.2fa-status-badge { display: inline-block; padding: 4px 12px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; margin-bottom: 14px; letter-spacing: 0.4px; text-transform: uppercase; }
.2fa-status-badge.disabled { background: rgba(255,71,87,0.1); color: var(--red); border: 1px solid rgba(255,71,87,0.28); }
.2fa-status-badge.enabled  { background: rgba(45,199,109,0.1); color: var(--green); border: 1px solid rgba(45,199,109,0.28); }

.qr-loading-text { color: var(--accent); font-size: 14px; font-weight: 600; margin: 14px 0; }

.qr-display-zone { display: none; text-align: left; margin-top: 20px; background: var(--bg-base); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.qr-display-zone img { display: block; margin: 0 auto 20px; background: white; padding: 10px; border-radius: var(--radius-md); width: 180px; height: 180px; }

.instruction-list { list-style: none; padding: 0; margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.instruction-list li { color: var(--text-secondary); font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.instruction-list li span { color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* Logout */
.btn-logout {
    background: rgba(255,71,87,0.09);
    color: var(--red); border: 1px solid rgba(255,71,87,0.22);
    padding: 12px 24px; border-radius: var(--radius-full);
    font-weight: 700; cursor: pointer; margin-top: 40px;
    transition: all var(--transition); display: block;
    width: 100%; max-width: 200px; text-align: center; font-size: 14px;
}
.btn-logout:hover { background: var(--red); color: #fff; box-shadow: 0 4px 20px rgba(255,71,87,0.3); transform: translateY(-1px); }

/* ==========================================
   LIGHT THEME
   ========================================== */
body.light-theme {
    --bg-base:       #f0f4f8;
    --bg-surface:    #ffffff;
    --bg-elevated:   #e8edf5;
    --bg-hover:      #dde5f0;
    --bg-active:     #cce4f0;
    --text-primary:  #111827;
    --text-secondary:#374151;
    --text-muted:    #6b7280;
    --border:        rgba(0,0,0,0.10);
    --border-accent: rgba(0,150,160,0.25);
    --glass:         rgba(255,255,255,0.94);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:     0 8px 24px rgba(0,0,0,0.12);
    --shadow-lg:     0 16px 52px rgba(0,0,0,0.15);
    color: var(--text-primary);
    background: var(--bg-base);
}
body.light-theme .input-group input,
body.light-theme .input-group select,
body.light-theme .input-field-wrapper input { color: var(--text-primary); background: var(--bg-surface); }
body.light-theme .sidebar-chats { background: var(--bg-surface); border-right: 1px solid var(--border); }
body.light-theme .brand-header { color: var(--text-primary); }
body.light-theme .chat-link { color: var(--text-secondary); }
body.light-theme .chat-link:hover { background: var(--bg-hover); color: var(--text-primary); }
body.light-theme .msg-bubble { background: var(--bg-surface); border-color: var(--border); }
body.light-theme .msg-bubble p { color: var(--text-primary); }
body.light-theme .messages-scroller { background: var(--bg-base); }
body.light-theme .viewport-header { background: var(--bg-surface); color: var(--text-primary); }
body.light-theme .user-profile-footer { background: var(--bg-surface); }
body.light-theme .meta-username { color: var(--text-primary); }
body.light-theme input#userSearchInput { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border); }
body.light-theme input#userSearchInput::placeholder { color: var(--text-muted); }
body.light-theme .section-title { color: var(--text-muted); }
body.light-theme .info-panel { background: var(--bg-surface); border-left: 1px solid var(--border); }
body.light-theme .modal-box { background: var(--bg-surface); }
body.light-theme .context-menu { background: var(--bg-surface); border-color: var(--border); }
body.light-theme .context-item { color: var(--text-secondary); }
body.light-theme .context-item:hover { background: var(--bg-hover); color: var(--text-primary); }
body.light-theme ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }

/* ==========================================
   THEME SELECTOR
   ========================================== */
.theme-selector { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.theme-option {
    flex: 1; min-width: 120px;
    padding: 18px 16px; background: var(--bg-elevated);
    border: 2px solid var(--border); border-radius: var(--radius-lg);
    cursor: pointer; text-align: center; font-weight: 600; font-size: 14px;
    transition: all var(--transition); color: var(--text-secondary);
}
.theme-option:hover { background: var(--bg-hover); border-color: rgba(0,200,212,0.3); color: var(--text-primary); transform: translateY(-2px); }
.theme-option.active { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); box-shadow: 0 4px 16px var(--accent-glow); }

/* ==========================================
   PREMIUM
   ========================================== */
.premium-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-accent);
    padding: 32px; border-radius: var(--radius-xl);
    text-align: center; max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,200,212,0.07);
}
.premium-card h3 { font-size: 20px; color: var(--text-primary); margin-bottom: 10px; font-weight: 700; }

.btn-premium {
    background: linear-gradient(135deg, var(--accent) 0%, #009baa 100%);
    color: #fff; border: none; padding: 13px 32px;
    font-weight: 700; border-radius: var(--radius-full);
    cursor: pointer; margin-top: 20px;
    display: inline-block; text-decoration: none;
    transition: all var(--transition); font-size: 14px;
    box-shadow: var(--shadow-accent);
}
.btn-premium:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 8px 28px rgba(0,200,212,0.4); }

.premium-unlocked-zone {
    display: none;
    background: linear-gradient(135deg, rgba(0,200,212,0.06), rgba(168,85,247,0.04));
    border: 1px solid var(--border-accent);
    padding: 28px; border-radius: var(--radius-xl);
}
.premium-unlocked-zone h3 { color: var(--text-primary); font-size: 20px; margin-bottom: 14px; font-weight: 700; }

.secret-section {
    background: rgba(168,85,247,0.06);
    padding: 16px; border-radius: var(--radius-md);
    border: 1px dashed rgba(168,85,247,0.3); margin-top: 20px;
}

/* ==========================================
   PROFILE CARD POP
   ========================================== */
.profile-card-pop {
    background: var(--bg-elevated); border: 1px solid var(--border);
    padding: 32px 24px; border-radius: var(--radius-xl);
    width: 100%; max-width: 360px;
    text-align: center; box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; align-items: center;
}
.profile-card-pop .large-avatar {
    width: 90px !important; height: 90px !important;
    min-width: 90px !important; min-height: 90px !important;
    border-radius: 50% !important;
    margin: 0 auto 16px auto !important;
    border: 3px solid var(--accent) !important;
    background-size: cover; background-position: center;
    display: flex !important; align-items: center !important; justify-content: center !important;
    font-size: 32px !important; font-weight: bold; color: #fff;
    flex-shrink: 0 !important;
    box-shadow: 0 0 0 6px var(--accent-glow);
}

/* ==========================================
   CROP
   ========================================== */
.crop-container { width: 150px; height: 150px; border-radius: 50%; margin: 20px auto; overflow: hidden; position: relative; border: 2px dashed var(--accent); background: var(--bg-base); }
#previewCropImg { position: absolute; top: 0; left: 0; transform-origin: center center; }
.crop-controls { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; background: var(--bg-elevated); padding: 16px; border-radius: var(--radius-md); }
.crop-controls label { font-size: 12px; color: var(--text-secondary); text-align: left; display: block; }
.crop-controls input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ==========================================
   HYPER PREMIUM ANIMATIONS
   ========================================== */
body.hyper-animations-active .sidebar-chats,
body.hyper-animations-active .main-chat-viewport,
body.hyper-animations-active .sidebar-members,
body.hyper-animations-active .settings-container {
    animation: hyperFloat 6s ease-in-out infinite alternate;
}
@keyframes hyperFloat {
    0%   { transform: translateY(0)   rotate(0deg);   }
    50%  { transform: translateY(-3px) rotate(0.1deg); }
    100% { transform: translateY(3px)  rotate(-0.1deg);}
}

/* ==========================================
   PRIVACY BLOCK
   ========================================== */
.privacy-block-zone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--bg-base); padding: 30px; }
.privacy-box-card {
    background: var(--bg-elevated);
    border: 1px dashed rgba(255,71,87,0.3);
    padding: 40px 28px; border-radius: var(--radius-xl);
    max-width: 420px; box-shadow: 0 8px 32px rgba(255,71,87,0.06);
}
.privacy-box-card h2 { color: var(--red); font-size: 24px; margin-bottom: 10px; font-weight: 700; }
.privacy-box-card p  { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }

/* ==========================================
   MOBILE
   ========================================== */
.btn-mobile-back { display: none; background: none; border: none; color: var(--accent); font-size: 22px; cursor: pointer; padding-right: 10px; outline: none; }

@media (max-width: 768px) {
    .app-container { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
    .sidebar-chats { width: 100vw !important; height: 100% !important; position: absolute; top: 0; left: 0; z-index: 10; border-right: none; transition: transform 0.32s cubic-bezier(0.4,0,0.2,1); }
    .main-chat-viewport, .empty-chat-placeholder, .privacy-block-zone { width: 100vw !important; height: 100% !important; position: absolute; top: 0; left: 0; z-index: 5; }
    .app-container.chat-open .sidebar-chats { transform: translateX(-100vw); }
    .btn-mobile-back { display: block; }
    .sidebar-members { display: none !important; }
    .chat-link { padding: 14px 12px; border-radius: 0; border-bottom: 1px solid var(--border); }
    .chat-link:hover { transform: none; }
    .bottom-input-bar { padding: 10px; }
    .viewport-header { padding: 0 16px; }
    .empty-chat-box { padding: 32px 28px; }
    .right-side { padding: 32px 24px; }
}

/* ==========================================
   FRIENDS PAGE
   ========================================== */
.friends-container { display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--bg-base); overflow: hidden; }

.friends-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px; gap: 8px;
    background: var(--bg-surface); flex-shrink: 0;
}
.friends-tab {
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    cursor: pointer; padding: 7px 16px; border-radius: var(--radius-full);
    transition: all var(--transition); border: 1px solid transparent;
}
.friends-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.friends-tab.active { color: var(--accent); background: var(--accent-subtle); border-color: var(--border-accent); }

.btn-add-friend-top {
    margin-left: auto; padding: 8px 18px;
    background: linear-gradient(135deg, var(--accent), #008a96);
    color: #fff; border-radius: var(--radius-full);
    font-size: 13px; font-weight: 700; cursor: pointer; border: none;
    transition: all var(--transition); box-shadow: 0 2px 12px var(--accent-glow);
    white-space: nowrap;
}
.btn-add-friend-top:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,200,212,0.38); }

.friends-content { flex: 1; overflow-y: auto; padding: 16px; }
#friendsContentList { display: flex; flex-direction: column; gap: 8px; padding: 4px; }

/* Friend cards */
.friend-card,
.friend-row {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
    transition: all var(--transition); gap: 12px;
}
.friend-card:hover,
.friend-row:hover {
    background: var(--bg-hover); border-color: var(--border-accent);
    transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.friend-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.friend-name { font-weight: 600; font-size: 15px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Action buttons */
.friend-actions,
.action-buttons { display: flex; gap: 8px; flex-shrink: 0; }

.btn-action,
.action-btn {
    padding: 7px 14px; border-radius: var(--radius-md);
    border: none; cursor: pointer; font-size: 13px;
    font-weight: 600; transition: all var(--transition);
}
.btn-msg,
.chat-btn { background: var(--accent-subtle); color: var(--accent); border: 1px solid var(--border-accent); }
.btn-msg:hover,
.chat-btn:hover { background: var(--accent); color: #fff; transform: scale(1.03); }

.accept { background: rgba(45,199,109,0.1); color: var(--green); border: 1px solid rgba(45,199,109,0.25); }
.accept:hover { background: var(--green); color: #fff; transform: scale(1.03); }

.btn-delete,
.decline { background: rgba(255,71,87,0.08); color: var(--red); border: 1px solid rgba(255,71,87,0.2); }
.btn-delete:hover,
.decline:hover { background: var(--red); color: #fff; transform: scale(1.03); }

/* ==========================================
   SESSIONS
   ========================================== */
.session-card {
    display: flex; align-items: center; gap: 14px; padding: 16px;
    border-radius: var(--radius-lg); background: var(--bg-elevated);
    border: 1px solid var(--border); margin-bottom: 10px;
    transition: all var(--transition);
}
.session-card:hover { border-color: var(--border-accent); background: var(--bg-hover); }
.session-device-icon { font-size: 26px; }
.session-device-name { font-size: 15px; color: var(--text-primary); font-weight: 600; }
.session-meta { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ==========================================
   SUBSCRIBE / SHOP
   ========================================== */
.shop-wrapper {
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; width: 100vw; min-height: 100vh;
    background: var(--bg-base); padding: 60px 20px 40px;
    overflow-y: auto;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(0,200,212,0.055) 0%, transparent 55%);
}
.shop-header { text-align: center; margin-bottom: 40px; max-width: 600px; }
.shop-header h1 { font-size: 38px; font-weight: 900; color: var(--text-primary); letter-spacing: -1px; margin-bottom: 12px; line-height: 1.15; }
.shop-header h1 span { color: var(--accent); text-shadow: 0 0 28px var(--accent-glow); }
.shop-header p { color: var(--text-secondary); font-size: 15px; line-height: 1.6; }

.promo-banner {
    background: linear-gradient(135deg, rgba(168,85,247,0.11), rgba(0,200,212,0.11));
    border: 1px solid rgba(0,200,212,0.18);
    padding: 12px 28px; border-radius: var(--radius-full);
    color: var(--text-primary); font-size: 14px; font-weight: 600;
    margin-bottom: 44px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 4px 20px rgba(0,200,212,0.07);
}
.promo-banner span { color: var(--purple); }

.tariffs-grid { display: flex; gap: 24px; max-width: 1020px; width: 100%; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }

.tariff-card {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 32px 26px;
    width: 100%; max-width: 290px; text-align: center;
    position: relative; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column;
}
.tariff-card:hover { transform: translateY(-6px); border-color: rgba(0,200,212,0.22); box-shadow: var(--shadow-lg); }
.tariff-card.popular {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(0,200,212,0.14);
    background: linear-gradient(180deg, var(--bg-elevated) 0%, rgba(0,200,212,0.04) 100%);
}
.tariff-card.popular:hover { box-shadow: 0 16px 48px rgba(0,200,212,0.24); }

.badge-discount {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(90deg, var(--purple), #7f00ff);
    color: #fff; padding: 5px 16px; border-radius: var(--radius-full);
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.8px; box-shadow: 0 4px 16px rgba(127,0,255,0.4); white-space: nowrap;
}
.badge-discount.cyan { background: linear-gradient(90deg, var(--accent), #00e5f2); box-shadow: 0 4px 16px rgba(0,200,212,0.4); }

.tariff-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.price-zone { margin-bottom: 28px; }
.old-price { font-size: 14px; color: var(--text-muted); text-decoration: line-through; margin-bottom: 4px; display: block; }
.current-price { font-size: 34px; font-weight: 900; color: var(--text-primary); line-height: 1; letter-spacing: -1px; }
.current-price span { font-size: 16px; color: var(--text-secondary); font-weight: 400; letter-spacing: 0; }

.card-features { list-style: none; padding: 0; margin: 0 0 32px; text-align: left; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-features li { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; line-height: 1.4; }
.card-features li::before { content: "✓"; color: var(--accent); font-weight: 700; flex-shrink: 0; }

.btn-buy-tariff {
    background: var(--bg-hover); border: 1px solid var(--border);
    color: var(--text-primary); padding: 13px 20px;
    border-radius: var(--radius-full); font-weight: 700; font-size: 14px;
    text-decoration: none; transition: all var(--transition); display: block; text-align: center;
}
.btn-buy-tariff:hover { background: var(--bg-active); border-color: rgba(0,200,212,0.3); transform: translateY(-1px); }
.popular .btn-buy-tariff { background: linear-gradient(135deg, var(--accent), #008a96); border: none; color: #fff; box-shadow: var(--shadow-accent); }
.popular .btn-buy-tariff:hover { box-shadow: 0 8px 28px rgba(0,200,212,0.4); transform: translateY(-2px); }

/* ==========================================
   FLOATING SEPARATED LAYOUT
   Sidebar and chat area as floating panels
   ========================================== */
.app-container {
    padding: 12px;
    gap: 10px;
    background:
        radial-gradient(ellipse 900px 600px at 12% 8%,  var(--aurora-1) 0%, transparent 60%),
        radial-gradient(ellipse 800px 700px at 92% 18%, var(--aurora-2) 0%, transparent 60%),
        radial-gradient(ellipse 900px 800px at 50% 100%,var(--aurora-3) 0%, transparent 60%),
        var(--bg-base);
    background-size: 200% 200%, 200% 200%, 200% 200%, auto;
    animation: auroraDrift 22s ease-in-out infinite;
    position: relative;
}
@keyframes auroraDrift {
    0%   { background-position: 0% 0%,   100% 0%,   50% 100%; }
    50%  { background-position: 30% 20%, 70% 30%,   40% 80%; }
    100% { background-position: 0% 0%,   100% 0%,   50% 100%; }
}

.sidebar-chats {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.main-chat-viewport {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.sidebar-members {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.empty-chat-placeholder {
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.privacy-block-zone {
    border-radius: var(--radius-xl);
    overflow: hidden;
}

/* Brand header no top radius (already covered by sidebar) */
.sidebar-chats .brand-header { border-radius: 0; }

/* ==========================================
   SEARCH BAR INSIDE SIDEBAR
   ========================================== */
.search-wrapper { padding: 10px 12px 4px; }
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-icon { font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-size: 13px;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* ==========================================
   ADD GROUP BUTTON
   ========================================== */
.add-group-btn {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #008a96);
    border: none; color: #fff;
    font-size: 16px; font-weight: 700;
    cursor: pointer; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    box-shadow: 0 2px 8px var(--accent-glow);
    flex-shrink: 0;
}
.add-group-btn:hover { transform: scale(1.15) rotate(90deg); box-shadow: 0 4px 16px var(--accent-glow); }

/* ==========================================
   GROUP CREATION MODAL
   ========================================== */
.group-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(4,6,10,0.82);
    backdrop-filter: blur(10px);
    display: none; justify-content: center; align-items: center;
    z-index: 3000;
    animation: fadeIn 0.2s ease;
}
.group-modal-overlay.active { display: flex; }

.group-modal-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.22s cubic-bezier(0.4,0,0.2,1) both;
}

.group-modal-box h3 {
    font-size: 20px; font-weight: 800;
    color: var(--text-primary); margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.group-modal-box p {
    color: var(--text-secondary); font-size: 13px; margin-bottom: 24px;
}

.group-members-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 240px; overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px;
}

.group-member-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}
.group-member-row:hover { background: var(--bg-hover); border-color: var(--border-accent); }
.group-member-row.selected {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.group-member-name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 10px;
}

.group-member-check {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; transition: all var(--transition);
    flex-shrink: 0;
    color: transparent;
}
.group-member-row.selected .group-member-check {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.group-modal-actions {
    display: flex; gap: 10px; margin-top: 4px;
}

/* Settings save button */
.btn-settings-save {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #009baa);
    border: none; color: #fff;
    font-size: 14px; font-weight: 700;
    cursor: pointer; margin-top: 24px;
    transition: all var(--transition);
    box-shadow: var(--shadow-accent);
}
.btn-settings-save:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(0,200,212,0.38); }
.btn-settings-save:active { transform: translateY(0); }

/* Invite button */
.invite-button {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px; padding: 13px 28px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    border: 1.5px solid var(--border);
    color: var(--text-primary);
    font-size: 14px; font-weight: 600;
    cursor: pointer; margin-top: 16px;
    transition: all var(--transition);
}
.invite-button:hover { border-color: var(--border-accent); background: var(--bg-active); color: var(--accent); }


/* ==========================================
   CONTEXT MENU — UPGRADED
   ========================================== */
.context-menu {
    display: none;
    position: fixed;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 180px;
    z-index: 5000;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.12s cubic-bezier(0.4,0,0.2,1);
}
.context-item {
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition);
}
.context-item:hover { background: var(--bg-hover); }
.context-item.danger { color: #ff4d4d; }
.context-item.danger:hover { background: rgba(255,77,77,0.1); }
.context-menu .divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ==========================================
   FILE ATTACHMENT BUTTON
   ========================================== */
.btn-attach {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    opacity: 0.7;
}
.btn-attach:hover { opacity: 1; background: var(--bg-hover); transform: scale(1.1); }

/* File message bubble */
.file-msg-bubble {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-hover);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-top: 4px;
    cursor: pointer;
    transition: border-color var(--transition);
    text-decoration: none;
    max-width: 260px;
}
.file-msg-bubble:hover { border-color: var(--border-accent); }
.file-msg-icon { font-size: 24px; flex-shrink: 0; }
.file-msg-info { flex: 1; overflow: hidden; }
.file-msg-name { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-msg-size { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ==========================================
   SHARED FILES IN RIGHT PANEL
   ========================================== */
.shared-file-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer; text-decoration: none;
}
.shared-file-item:hover { border-color: var(--border-accent); }
.shared-file-item .icon { font-size: 16px; flex-shrink: 0; }
.shared-file-item .name { font-size: 12px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================
   GROUP MEMBER IN RIGHT PANEL
   ========================================== */
.group-panel-member {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition);
}
.group-panel-member:hover { background: var(--bg-hover); }
.group-panel-member .name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.group-panel-member .tag { font-size: 11px; color: var(--accent); font-weight: 600; }

/* ==========================================
   RIGHT PANEL DM AVATAR CENTER
   ========================================== */
#dmPanelAvatar .avatar-letter,
#dmPanelAvatar .avatar-circle {
    width: 64px !important; height: 64px !important;
    font-size: 26px !important;
    border-radius: 50% !important;
}
/* ==========================================
   ERROR PAGE 404
   ========================================== */
.error-page-wrapper {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; width: 100vw; height: 100vh;
    background: var(--bg-base); text-align: center; padding: 20px;
    background-image: radial-gradient(ellipse at 50% 50%, rgba(0,200,212,0.04) 0%, transparent 65%);
}
.error-code {
    font-size: 130px; font-weight: 900;
    color: var(--bg-elevated);
    text-shadow: 0 0 40px rgba(0,200,212,0.28);
    line-height: 1; margin-bottom: 16px; letter-spacing: -6px;
}
.error-code span { color: var(--accent); }
.empty-chat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.empty-chat-image {
    width: 180px;
    height: auto;
    margin-bottom: 20px;
    opacity: 0.9;
}
/* ==========================================
   MOBILE — ANIMATIONS (global additions)
   ========================================== */

@keyframes slideInUp {
  from { opacity:0; transform:translateY(28px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes slideInLeft {
  from { opacity:0; transform:translateX(-28px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes slideInRight {
  from { opacity:0; transform:translateX(28px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes bounceIn {
  0%   { opacity:0; transform:scale(0.82); }
  60%  { opacity:1; transform:scale(1.04); }
  80%  { transform:scale(0.97); }
  100% { opacity:1; transform:scale(1); }
}
@keyframes pulseGlow {
  0%,100% { box-shadow:0 0 0 0 rgba(0,200,212,0); }
  50%      { box-shadow:0 0 0 10px rgba(0,200,212,0.14); }
}
@keyframes floatUp {
  0%,100% { transform:translateY(0); }
  50%     { transform:translateY(-8px); }
}
@keyframes rippleOut {
  0%   { transform:scale(0); opacity:0.6; }
  100% { transform:scale(3.5); opacity:0; }
}
@keyframes scanLine {
  0%,100% { top:12%; }
  50%     { top:80%; }
}
@keyframes paneSlideIn {
  from { opacity:0; transform:translateX(32px); }
  to   { opacity:1; transform:translateX(0); }
}

/* Card staggered entrance on all pages */
.s-card { animation: slideInUp 0.32s cubic-bezier(0.4,0,0.2,1) both; }
.s-card:nth-child(1) { animation-delay:0.02s; }
.s-card:nth-child(2) { animation-delay:0.07s; }
.s-card:nth-child(3) { animation-delay:0.12s; }
.s-card:nth-child(4) { animation-delay:0.17s; }
.s-card:nth-child(5) { animation-delay:0.22s; }

/* Active pane animates in */
.s-pane.active { animation: paneSlideIn 0.28s cubic-bezier(0.4,0,0.2,1) both; }

/* Auth box animation */
.auth-box { animation: bounceIn 0.45s cubic-bezier(0.4,0,0.2,1) both; }

/* Friend rows */
.friend-row { animation: slideInUp 0.3s both; }
.friend-row:nth-child(2) { animation-delay:0.04s; }
.friend-row:nth-child(3) { animation-delay:0.08s; }
.friend-row:nth-child(4) { animation-delay:0.12s; }
.friend-row:nth-child(5) { animation-delay:0.16s; }

/* Chat link hover lift */
.chat-link { transition: transform var(--transition), background var(--transition), border-color var(--transition); }
.chat-link:hover { transform: translateX(3px); }

/* Message new-in animation */
.msg-row { transition: opacity 0.2s; }
.msg-new-in { animation: slideInUp 0.25s cubic-bezier(0.4,0,0.2,1) both; }

/* Button tap feedback */
.s-btn, .btn-round, .action-btn {
  transition: transform 0.12s, box-shadow 0.12s, background 0.2s;
}
.s-btn:active, .action-btn:active { transform: scale(0.96); }
.btn-round:active { transform: scale(0.97); }

/* Nav item icon pulse on hover */
.s-nav-item:hover .s-nav-icon { animation: pulseGlow 0.6s ease; }

/* ==========================================
   MOBILE — AUTH PAGES (login, register, verify)
   ========================================== */

@media (max-width: 768px) {
  body { overflow-y: auto; }

  .container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .left-side { display: none; }

  .right-side {
    flex: 1;
    padding: 56px 24px 40px;
    justify-content: flex-start;
    padding-top: max(56px, env(safe-area-inset-top, 0px) + 40px);
  }

  .auth-box {
    max-width: 100%;
    width: 100%;
  }

  .auth-box h2 { font-size: 26px; }
  .auth-box p  { font-size: 14px; }

  .input-group input,
  .input-group select { padding: 13px 16px; font-size: 16px; }

  .btn-round { padding: 15px; font-size: 15px; }
}

@media (max-width: 480px) {
  .right-side { padding: 48px 18px 32px; }
  .auth-box h2 { font-size: 23px; }
}

/* ==========================================
   MOBILE — HOME PAGE
   ========================================== */

@media (max-width: 768px) {
  body { overflow: hidden; }

  #appRoot {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  /* Sidebar: full-screen by default on mobile */
  #appRoot > .sidebar-chats,
  .app-container > .sidebar-chats:first-child {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: unset !important;
    z-index: 100;
    border-right: none !important;
    border-radius: 0 !important;
    transform: translateX(0);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  }

  /* Slide sidebar left when chat open */
  #appRoot.chat-open > .sidebar-chats {
    transform: translateX(-100%);
    pointer-events: none;
  }

  /* Main chat: hidden by default, slides in */
  .main-chat-viewport {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    z-index: 90;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    border-radius: 0 !important;
  }

  #appRoot.chat-open .main-chat-viewport {
    transform: translateX(0);
  }

  /* Empty zone */
  #emptyChatZone {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    z-index: 90;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    border-radius: 0 !important;
  }

  #appRoot.chat-open #emptyChatZone {
    transform: translateX(0);
  }

  /* Privacy blocked zone */
  #privacyBlockedZone {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    z-index: 90;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  }
  #appRoot.chat-open #privacyBlockedZone { transform: translateX(0); }

  /* Show mobile back button */
  .btn-mobile-back {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Hide right info panel */
  .sidebar-members {
    display: none !important;
  }

  /* Wider bubbles on mobile */
  .msg-bubble { max-width: 78vw; }

  /* Larger input */
  .message-input-wrapper textarea,
  .message-input-wrapper input,
  #messageInput { font-size: 16px !important; }

  /* Chat header */
  .chat-header { padding: 0 10px; }
  .chat-input-row,
  .input-area    { padding: 10px 10px; }
}

/* ==========================================
   MOBILE — SETTINGS PAGE
   ========================================== */

/* QR scanner button — hidden on desktop */
.mobile-qr-section { display: none; }

/* Back button — hidden on desktop */
.s-mobile-back-btn { display: none; }

@media (max-width: 768px) {
  .s-root {
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  /* Sidebar fullscreen on mobile */
  .s-sidebar {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    border-right: none !important;
    z-index: 100;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .s-root.pane-open .s-sidebar {
    transform: translateX(-100%);
    pointer-events: none;
  }

  /* Main content slides in */
  .s-main {
    position: fixed !important;
    inset: 0 !important;
    z-index: 90;
    padding: 0 !important;
    background: var(--bg-base);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .s-root.pane-open .s-main {
    transform: translateX(0);
  }

  /* Active pane padding on mobile */
  .s-pane.active {
    padding: 0 14px 40px;
    min-height: 100dvh;
    animation: none;
  }

  /* Sticky back button */
  .s-mobile-back-btn {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 12px;
    color: var(--accent);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    margin: 0 -14px 16px;
    width: calc(100% + 28px);
  }

  .s-mobile-back-btn .material-symbols-rounded {
    font-size: 22px;
  }

  /* Show mobile QR scanner section */
  .mobile-qr-section {
    display: block !important;
  }

  /* Layout adjustments */
  .s-pane-title  { font-size: 20px; padding-top: 6px; }
  .s-close-btn   { display: flex !important; }

  .s-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .s-row-left { min-width: 0; flex: 1; }

  /* Select full-width */
  .s-select { width: 100% !important; margin-top: 8px; }

  /* Version badge stays at bottom */
  .s-version-badge-wrap { margin-top: auto; }

  /* Section label spacing */
  .s-section-label { margin-top: 20px; }

  /* First label no top margin */
  .s-sidebar-inner > .s-section-label:first-child { margin-top: 8px; }
}

/* ==========================================
   MOBILE — QR SCANNER MODAL
   ========================================== */

.qr-scan-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: none;
  flex-direction: column;
}

.qr-scan-modal.active { display: flex; }

.qr-scan-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(48px, env(safe-area-inset-top,0px)+24px) 18px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
  z-index: 2;
  color: #fff;
}

.qr-scan-header h3 { font-size: 17px; font-weight: 700; }

.qr-scan-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.qr-scan-back:hover { background: rgba(255,255,255,0.25); }

.qr-scan-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qrScanVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-scan-frame {
  position: relative;
  width: min(65vw, 260px);
  height: min(65vw, 260px);
  z-index: 1;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
}

/* Corner brackets */
.qr-scan-frame::before,
.qr-scan-corner-tr,
.qr-scan-corner-bl,
.qr-scan-corner-br {
  content:'';
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--accent);
  border-style: solid;
}
.qr-scan-frame::before {
  top: -2px; left: -2px;
  border-width: 4px 0 0 4px;
  border-radius: 14px 0 0 0;
}
.qr-scan-corner-tr {
  top: -2px; right: -2px;
  border-width: 4px 4px 0 0;
  border-radius: 0 14px 0 0;
}
.qr-scan-corner-bl {
  bottom: -2px; left: -2px;
  border-width: 0 0 4px 4px;
  border-radius: 0 0 0 14px;
}
.qr-scan-corner-br {
  bottom: -2px; right: -2px;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 14px 0;
}

/* Animated scan line */
.qr-scan-line {
  position: absolute;
  left: 4px; right: 4px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 1px;
  top: 12%;
  animation: scanLine 1.8s ease-in-out infinite;
  z-index: 1;
  box-shadow: 0 0 8px 2px rgba(0,200,212,0.5);
}

.qr-scan-status-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 20px max(28px, env(safe-area-inset-bottom,0px)+16px);
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  z-index: 2;
  text-align: center;
}

.qr-scan-status {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: background 0.3s, color 0.3s;
}

.qr-scan-status.success {
  background: rgba(0,200,212,0.85);
}

.qr-scan-status.error {
  background: rgba(255,71,87,0.85);
}

/* ==========================================
   MOBILE — FRIENDS PAGE
   ========================================== */

@media (max-width: 768px) {
  .app-container { flex-direction: column; }

  /* Hide friends-page sidebar on mobile */
  .app-container > .sidebar-chats:not(#appRoot .sidebar-chats) {
    display: none;
  }

  .friends-container {
    border-radius: 0;
    flex: 1;
    min-height: 100dvh;
  }

  .friends-header { flex-wrap: wrap; row-gap: 8px; }

  .btn-add-friend-top {
    margin-left: 0;
    width: 100%;
    order: 3;
  }

  .friend-row {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 14px;
  }

  .action-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================
   ICON STYLES (Material Symbols)
   ========================================== */

.material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

.s-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}

.s-nav-icon .material-symbols-rounded {
  font-size: 20px;
  color: var(--accent);
}

.danger-item .s-nav-icon {
  background: rgba(255,71,87,0.08);
}
.danger-item .s-nav-icon .material-symbols-rounded {
  color: #ff4757;
}

.s-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.s-nav-item .s-icon { display: none; } /* hide old emoji icons */

/* Ripple effect on nav items */
.s-nav-item {
  position: relative;
  overflow: hidden;
}
.s-nav-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-subtle);
  opacity: 0;
  border-radius: var(--radius-md);
  transition: opacity 0.15s;
}
.s-nav-item:active::after { opacity: 1; }

/* ==========================================
   MOBILE GENERAL POLISH
   ========================================== */

@media (max-width: 768px) {
  .toast-error {
    left: 12px !important;
    right: 12px !important;
    bottom: 16px !important;
    width: auto !important;
  }

  .modal-overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .modal-box, .profile-card-pop {
    border-radius: 20px 20px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .addfriend-modal-box {
    border-radius: 20px !important;
  }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  .chat-input-row, .input-area {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .s-sidebar { padding-bottom: env(safe-area-inset-bottom); }
  .sidebar-chats { padding-bottom: env(safe-area-inset-bottom); }
}

/* ==========================================================
   MODERN REFRESH — GLASS EDGES, MICRO-INTERACTIONS, POLISH
   (CSS-only visual upgrade layer, added on top of everything above)
   ========================================================== */

/* Smooth page entrance */
body { animation: pageFadeIn 0.5s cubic-bezier(0.4,0,0.2,1) both; }
@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Global colour-transition on theme switch */
body, .sidebar-chats, .main-chat-viewport, .sidebar-members,
.viewport-header, .user-profile-footer, .msg-bubble, .friend-card, .friend-row,
.settings-sidebar, .friends-header {
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

/* Soft animated glow ring around the floating panels */
.sidebar-chats, .main-chat-viewport, .sidebar-members {
    position: relative;
}
.sidebar-chats::after, .main-chat-viewport::after, .sidebar-members::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0,200,212,0.05);
    animation: ringGlow 7s ease-in-out infinite;
}
.main-chat-viewport::after { animation-delay: 1.2s; }
.sidebar-members::after    { animation-delay: 2.4s; }
@keyframes ringGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(0,200,212,0.045), 0 0 24px 0 rgba(0,200,212,0); }
    50%      { box-shadow: 0 0 0 1px rgba(0,200,212,0.16),  0 0 28px 2px rgba(0,200,212,0.06); }
}

/* Refined scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0,200,212,0.35), rgba(0,200,212,0.12));
    border-radius: 8px;
    transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--accent), rgba(0,200,212,0.35)); }

/* Selection colour */
::selection { background: var(--accent-glow); color: var(--text-primary); }

/* Accessible focus ring, replaces default outline everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
    border-radius: var(--radius-sm);
}

/* Button sheen sweep on primary CTAs */
.btn-round, .btn-premium, .btn-settings-save, .btn-add-friend-top, .modal-btn.primary, .btn-buy-tariff {
    position: relative;
    overflow: hidden;
}
.btn-round::before, .btn-premium::before, .btn-settings-save::before,
.btn-add-friend-top::before, .modal-btn.primary::before, .btn-buy-tariff::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.28), transparent);
    transform: skewX(-20deg);
    transition: left 0.55s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
}
.btn-round:hover::before, .btn-premium:hover::before, .btn-settings-save:hover::before,
.btn-add-friend-top:hover::before, .modal-btn.primary:hover::before, .btn-buy-tariff:hover::before {
    left: 130%;
}

/* Message bubbles: lift on hover + smoother own-message gradient */
.msg-bubble { transition: transform var(--transition-fast), box-shadow var(--transition), border-color var(--transition); }
.msg-row:hover .msg-bubble { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.msg-row.own .msg-bubble {
    background-size: 160% 160%;
    background-position: 0% 0%;
    transition: background-position 0.6s ease, transform var(--transition-fast), box-shadow var(--transition);
}
.msg-row.own:hover .msg-bubble { background-position: 100% 100%; }

/* Avatars: satisfying hover pop */
.avatar-circle, .avatar-letter { transition: box-shadow var(--transition), transform var(--transition-spring); }
.chat-link:hover .avatar-circle, .friend-info:hover .avatar-circle,
.chat-link:hover .avatar-letter, .friend-info:hover .avatar-letter { transform: scale(1.06); }

/* Nav items — sliding underline hint + icon micro-bounce */
.chat-link, .settings-link, .friends-tab {
    position: relative;
}
.chat-link .icon-box, .s-nav-icon { transition: transform var(--transition-spring); }
.chat-link:hover .icon-box, .friends-tab:hover { transform: translateX(1px); }
.s-nav-item:hover .s-nav-icon { transform: scale(1.08) rotate(-4deg); }

/* Cards — springier hover lift */
.friend-card, .friend-row, .tariff-card, .session-card, .theme-option {
    transition: transform var(--transition-spring), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

/* Modal / overlay — softer entrance and stronger blur */
.modal-overlay { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background 0.25s ease; }
.modal-box, .profile-card-pop { animation: modalPop 0.28s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes modalPop { from { opacity: 0; transform: scale(0.9) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* Shop page — shimmering promo banner + badge glow */
.promo-banner {
    background-size: 200% 100%;
    animation: shimmerSweep 6s linear infinite;
}
@keyframes shimmerSweep {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}
.badge-discount { animation: badgeFloat 2.6s ease-in-out infinite; }
@keyframes badgeFloat { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-3px); } }

/* Send button subtle idle breathing when input has content is handled by JS toggling; hover/active polish here */
.btn-send:active { transform: scale(0.92); }

/* Input focus glow pulse (one-shot) */
.input-field-wrapper:focus-within, .input-group input:focus, .input-group select:focus {
    animation: focusPulse 0.4s ease-out;
}
@keyframes focusPulse {
    0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
    100% { box-shadow: 0 0 0 3px var(--accent-glow); }
}

/* Brand header logo subtle glow breathing */
.brand-header span { animation: logoGlow 4s ease-in-out infinite; }
@keyframes logoGlow {
    0%, 100% { text-shadow: 0 0 18px var(--accent-glow); }
    50%      { text-shadow: 0 0 30px rgba(0,200,212,0.4); }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Slightly richer depth on the whole app on large screens */
@media (min-width: 769px) {
    .app-container { box-shadow: inset 0 0 120px rgba(0,0,0,0.25); }
}

/* ==========================================================
   SVG ICON SYSTEM (replaces emoji glyphs used as UI icons)
   ========================================================== */
.ico {
    width: 1.15em;
    height: 1.15em;
    display: inline-block;
    vertical-align: -0.22em;
    flex-shrink: 0;
    color: currentColor;
    transition: transform var(--transition), color var(--transition), opacity var(--transition);
}
.ico-star { color: #f5b301; }
.ico-lock { color: var(--accent); }
.ico-warn { color: #ffb020; }
.ico-check-circle { color: var(--green); }
.ico-ban  { color: var(--red); }

/* Buttons/elements that are icon-only: center the svg, drop stray line-height quirks */
.btn-gear .ico, .btn-mobile-back .ico, .btn-attach .ico, .btn-emoji-trigger .ico,
.btn-call .ico, .search-icon .ico, .react-trigger .ico, .context-item .ico,
.file-msg-icon .ico, .icon .ico, .shared-file-item .icon .ico {
    vertical-align: middle;
}
.btn-gear, .btn-mobile-back, .btn-attach, .btn-emoji-trigger, .search-icon, .react-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-gear:hover .ico { transform: rotate(45deg); }
.btn-attach:hover .ico { transform: rotate(-8deg) scale(1.08); }
.btn-emoji-trigger:hover .ico, .react-trigger:hover .ico { transform: scale(1.15); }
.context-item .ico { margin-right: 8px; }
.chat-link .icon-box .ico, .friend-info .icon-box .ico { width: 1.3em; height: 1.3em; }

/* File type bubble icon sizing */
.file-msg-icon { display: flex; align-items: center; justify-content: center; }
.file-msg-icon .ico { width: 22px; height: 22px; }

/* Theme option icons row */
.theme-option .ico { margin-bottom: 6px; }

/* Auth sparkles */
.spark-ico { color: var(--accent); width: 0.9em; height: 0.9em; vertical-align: -0.12em; opacity: 0.85; }

/* ==========================================================
   FINAL POLISH PASS — typography rhythm & icon color cohesion
   ========================================================== */
body { letter-spacing: -0.01em; }
h1, h2, h3, .auth-box h2, .shop-header h1, .modal-box h3 { letter-spacing: -0.02em; }

/* Icon color inherits current text color by default, accents override per-context */
.chat-link .ico, .settings-link .ico, .friends-tab .ico { opacity: 0.85; }
.chat-link.active .ico, .settings-link.active .ico, .friends-tab.active .ico { opacity: 1; }

/* Context menu danger icon coloring */
.context-item.danger .ico { color: #ff4d4d; }

/* Empty-state icon container sizing (settings sessions / friends lists) */
.s-empty-icon, .empty-icon { display: flex; align-items: center; justify-content: center; }
.s-empty-icon .ico, .empty-icon .ico { width: 40px; height: 40px; opacity: 0.55; }

/* Session device icon */
.s-session-icon { display: flex; align-items: center; justify-content: center; }
.s-session-icon .ico { width: 22px; height: 22px; color: var(--accent); }
