/* ═══════════════════════════════════════════
   APROX v5.0 - Professional Design System
   ═══════════════════════════════════════════ */

/* === DEFAULT MODE (Simple Clean) === */
:root {
    --bg-master: #09090b;
    --bg-side: #0f0f13;
    --bg-chat: #09090b;
    --bg-header: rgba(15, 15, 19, 0.75);
    --bg-settings: #0f0f13;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-input: rgba(255, 255, 255, 0.07);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --primary: #ff4757;
    --primary-glow: rgba(255, 71, 87, 0.35);
    --primary-gradient: linear-gradient(135deg, #ff4757, #ff8c00);
    --accent: #2f3542;
    --accent-gradient: linear-gradient(135deg, #2f3542, #57606f);
    --text-main: #f8f9fa;
    --text-secondary: #dcdde1;
    --text-muted: #8e9aab;
    --text-dim: #4b5263;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --bubble-out: linear-gradient(135deg, #ff4757, #ff8c00);
    --bubble-in: rgba(255, 255, 255, 0.08);
    --bubble-out-text: #ffffff;
    --bubble-in-text: #f8f9fa;
    --bubble-out-border: transparent;
    --bubble-in-border: rgba(255, 255, 255, 0.15);
    --bubble-radius: 20px;
    --online: #2ed573;
    --offline: #a4b0be;
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --info: #1e90ff;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.25);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.45);
    --shadow-xl: 0 24px 64px rgba(0,0,0,0.55);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-main: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --gradient-mesh: none;
    --glass-blur: 24px;
    --msg-font-size: 0.95rem;
    --header-height: 64px;
    --nav-height: 68px;
}

/* === LIGHT MODE === */
body.light-mode {
    --bg-master: #ffffff;
    --bg-side: #f4f5f8;
    --bg-chat: #f9f9f9;
    --bg-header: rgba(255, 255, 255, 0.95);
    --bg-settings: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f1f3f6;
    --primary: #ff4757;
    --primary-glow: rgba(255, 71, 87, 0.25);
    --primary-gradient: linear-gradient(135deg, #ff4757, #ff7f50);
    --accent: #2f3542;
    --accent-gradient: linear-gradient(135deg, #2f3542, #57606f);
    --text-main: #111111;
    --text-secondary: #4b4b4b;
    --text-muted: #888888;
    --text-dim: #aaaaaa;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);
    --bubble-out: linear-gradient(135deg, #ff4757, #ff7f50);
    --bubble-in: #ffffff;
    --bubble-out-text: #ffffff;
    --bubble-in-text: #2f3542;
    --bubble-out-border: transparent;
    --bubble-in-border: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.03);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.05);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.08);
    --shadow-xl: 0 24px 64px rgba(0,0,0,0.12);
}

/* === GLOBAL STYLES === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    background: var(--bg-master);
    color: var(--text-main);
    min-height: 100dvh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, textarea, select { font-family: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === APP CONTAINER === */
#app-container {
    display: flex;
    width: 100%;
    height: 100dvh;
    position: relative;
    overflow: hidden;
    background: var(--bg-master);
}

/* === DESKTOP SIDEBAR === */
.desktop-sidebar {
    display: none;
    width: 68px;
    background: var(--bg-side);
    border-right: 1px solid var(--border);
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    z-index: 100;
}
@media (min-width: 768px) {
    .desktop-sidebar { display: flex; }
    #bottom-nav { display: none !important; }
}
.side-logo-icon {
    width: 42px; height: 42px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.1rem;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.side-nav-items { display: flex; flex-direction: column; gap: 8px; }
.side-nav-item {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.side-nav-item:hover { background: var(--bg-hover); color: var(--text-main); }
.side-nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
}
.side-nav-item.active::before {
    content: '';
    position: absolute; left: -12px;
    width: 3px; height: 20px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}
.side-nav-bottom { margin-top: auto; }
.side-user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; cursor: pointer;
    border: 2px solid var(--border);
    transition: var(--transition);
}
.side-user-avatar:hover { border-color: var(--primary); }
.side-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* === VIEWS === */
.view {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    background: var(--bg-master);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    overflow: hidden;
}
.view.active { transform: translateX(0); z-index: 10; }
.view.base-layer { transform: translateX(0); z-index: 1; }
.view.leaving { transform: translateX(-30%); z-index: 5; }
@media (min-width: 768px) {
    .view { left: 68px; width: calc(100% - 68px); }
}

/* === AUTH VIEW === */
#auth-view {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-master);
    z-index: 1000;
}
#auth-view.active { transform: translateX(0); }
.authBox {
    width: 90%; max-width: 400px;
    padding: 40px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}
.authBox { background: rgba(255,255,255,0.03); }
body.light-mode .authBox { background: var(--bg-card); }
.auth-logo-text {
    font-family: var(--font-heading);
    font-size: 2rem; font-weight: 800;
    text-align: center;
    background: var(--primary-gradient);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
}
.auth-tabs {
    display: flex; position: relative;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px; margin-bottom: 24px;
}
.auth-tabs label {
    flex: 1; text-align: center;
    padding: 10px; font-size: 0.85rem;
    font-weight: 600; letter-spacing: 0.5px;
    color: var(--text-muted);
    cursor: pointer; z-index: 2;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}
#login-trigger:checked ~ .auth-tabs label[for="login-trigger"],
#signup-trigger:checked ~ .auth-tabs label[for="signup-trigger"] {
    color: #fff; background: var(--primary-gradient);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.auth-forms { position: relative; }
.auth-form-content { display: none; }
#login-trigger:checked ~ .auth-forms #login-form-div,
#signup-trigger:checked ~ .auth-forms #signup-form-div { display: block; }
.auth-input-box {
    display: flex; align-items: center;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 14px; margin-bottom: 12px;
    transition: var(--transition);
}
.auth-input-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.auth-input-box i { color: var(--text-muted); font-size: 0.9rem; margin-right: 10px; }
.auth-input-box input {
    flex: 1; background: none; border: none; outline: none;
    padding: 13px 0; color: var(--text-main); font-size: 0.95rem;
}
.auth-btn {
    width: 100%; padding: 14px;
    background: var(--primary-gradient);
    color: #fff; border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem; font-weight: 700;
    letter-spacing: 0.5px;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--primary-glow);
    margin-top: 8px;
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
.auth-btn:active { transform: translateY(0); }

/* === GLASS HEADER === */
.glass-header {
    display: flex; align-items: center;
    padding: 10px 16px;
    min-height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    z-index: 50;
    gap: 8px;
}
.glass-header { background: rgba(15, 15, 24, 0.92); }
body.light-mode .glass-header { background: var(--bg-header); }
.header-title {
    font-family: var(--font-heading);
    font-size: 1.1rem; font-weight: 700;
    color: var(--text-main);
    flex: 1;
}
.icon-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent;
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 1rem;
    transition: var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-main); }
.icon-btn:active { transform: scale(0.92); }

/* === HOME HEADER === */
.home-header {
    display: flex; align-items: center;
    padding: 12px 16px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    gap: 10px;
}
.home-app-name {
    font-family: var(--font-heading);
    font-size: 1.3rem !important; font-weight: 800 !important;
    background: var(--primary-gradient) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    letter-spacing: -0.3px;
}
.header-search-wrap {
    flex: 1; display: flex; align-items: center;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 25px;
    padding: 0 14px;
    transition: var(--transition);
}
.header-search-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.header-search-wrap i { color: var(--text-muted); font-size: 0.85rem; margin-right: 8px; }
.header-search-wrap input {
    flex: 1; background: none; border: none; outline: none;
    padding: 9px 0; color: var(--text-main); font-size: 0.9rem;
}

/* === FILTERS === */
.home-filters-wrap { padding: 10px 16px 0; }
.home-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.home-filters::-webkit-scrollbar { display: none; }
.home-filter {
    padding: 7px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: var(--transition);
    cursor: pointer;
}
.home-filter:hover { border-color: var(--primary); color: var(--primary); }
.home-filter.active {
    background: var(--primary-gradient);
    color: #fff; border-color: transparent;
    box-shadow: 0 2px 10px var(--primary-glow);
}

/* === SCROLLABLE LIST === */
.scrollable-list {
    flex: 1; overflow-y: auto;
    padding: 8px 12px calc(var(--nav-height) + 16px);
}

/* === CHAT CARDS === */
.list-item, .user-card {
    display: flex; align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 2px;
    position: relative;
}
.list-item:hover, .user-card:hover { background: var(--bg-hover); }
.list-item:active, .user-card:active { transform: scale(0.985); }

/* === AVATAR === */
.avatar {
    width: 50px; height: 50px; min-width: 50px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin-right: 12px;
    border: 2.5px solid var(--offline);
    transition: var(--transition);
    position: relative;
}
.avatar.online-border { border-color: var(--online); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar i { color: var(--text-muted); font-size: 1.2rem; }

/* === USER INFO === */
.user-info { flex: 1; min-width: 0; }
.user-name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-name {
    font-weight: 600; font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; align-items: center; gap: 6px;
}
.online-dot {
    width: 8px; height: 8px;
    background: var(--online);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.user-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
    display: flex; align-items: center; gap: 4px;
}
.user-status.active { color: var(--online); }
.last-msg-preview {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 200px;
    margin-top: 1px;
}
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.status-online { background: var(--online); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.status-dot.status-offline { background: var(--offline); }

/* === UNREAD BADGE === */
.unread-badge {
    min-width: 20px; height: 20px;
    background: var(--primary-gradient);
    color: #fff; font-size: 0.7rem; font-weight: 700;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 6px var(--primary-glow);
}
.star-icon {
    color: var(--warning);
    font-size: 0.75rem;
    margin-left: 6px;
}

/* === CHAT VIEW === */
#chat-view { background: var(--bg-chat); }
.chat-header-info { display: flex; align-items: center; flex: 1; min-width: 0; cursor: pointer; }
.chat-header-text { min-width: 0; flex: 1; }
.chat-header-name {
    font-weight: 700; font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-header-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-action-group { display: flex; align-items: center; gap: 2px; }

/* === MESSAGES === */
.messages-container {
    flex: 1; overflow-y: auto;
    padding: 16px 12px 10px;
    scroll-behavior: smooth;
}
#messages-list { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.message-wrapper {
    display: flex; flex-direction: column;
    max-width: 82%;
    margin-bottom: 2px;
    animation: msgIn 0.25s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.message-wrapper.sent { align-self: flex-end; align-items: flex-end; }
.message-wrapper.received { align-self: flex-start; align-items: flex-start; }

.message-bubble {
    padding: 10px 16px;
    border-radius: var(--bubble-radius);
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: var(--transition);
    max-width: 100%;
}
.sent .message-bubble {
    background: var(--bubble-out);
    color: var(--bubble-out-text);
    border: 1px solid var(--bubble-out-border);
    border-bottom-right-radius: 4px;
    box-shadow: 0 3px 10px var(--primary-glow);
}
.received .message-bubble {
    background: var(--bubble-in);
    color: var(--bubble-in-text);
    border: 1px solid var(--bubble-in-border);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}


.bubble-content { font-size: var(--msg-font-size); line-height: 1.5; }
.message-meta {
    display: flex; align-items: center; gap: 4px;
    margin-top: 4px;
    font-size: 0.7rem;
    opacity: 0.7;
    justify-content: flex-end;
}
.sent .message-meta { color: rgba(255,255,255,0.7); }
.received .message-meta { color: var(--text-muted); }

.tick { font-size: 0.7rem; }
.tick.seen { color: #60a5fa; }
.edited-label { font-size: 0.68rem; font-style: italic; opacity: 0.6; }

/* Large Emoji */
.large-emoji-bubble {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 2.8rem !important;
    padding: 4px !important;
}
.received .large-emoji-bubble { background: transparent !important; }

/* Reply */
.reply-snippet {
    background: rgba(0,0,0,0.08);
    border-left: 3px solid var(--primary);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.85;
}
.reply-snippet { background: rgba(255,255,255,0.06); }
body.light-mode .reply-snippet { background: rgba(0,0,0,0.08); }

.msg-forwarded { font-size: 0.75rem; opacity: 0.6; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }

/* Reactions */
.msg-reactions-bag { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg-reaction-tag {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}
.msg-reaction-tag:hover { border-color: var(--primary); }

/* Date Divider */
.date-divider {
    text-align: center; margin: 16px 0;
    position: relative;
}
.date-divider span {
    background: var(--bg-chat);
    color: var(--text-muted);
    font-size: 0.75rem; font-weight: 600;
    padding: 4px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    letter-spacing: 0.3px;
}
.date-divider span { background: rgba(255,255,255,0.04); }
body.light-mode .date-divider span { background: var(--bg-chat); }

/* Image in bubble */
.bubble-img {
    border-radius: var(--radius-md);
    max-width: 260px;
    cursor: pointer;
    transition: var(--transition);
}
.bubble-img:hover { opacity: 0.9; }
.message-img { margin: -4px -4px 4px; }

/* === INPUT AREA === */
.input-wrapper {
    display: flex; align-items: flex-end;
    padding: 8px 12px;
    background: var(--bg-header);
    border-top: 1px solid var(--border);
    gap: 8px;
}
.input-wrapper { background: rgba(15,15,24,0.95); }
body.light-mode .input-wrapper { background: var(--bg-header); }
.chat-input-container {
    flex: 1; display: flex; align-items: flex-end;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 4px 8px;
    transition: var(--transition);
    position: relative;
}
.chat-input-container:focus-within { border-color: var(--primary); }
.chat-input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-main); font-size: 0.95rem;
    padding: 8px 4px; resize: none;
    max-height: 120px; line-height: 1.4;
}
.chat-input::placeholder { color: var(--text-muted); }
.send-btn-circle {
    width: 42px; height: 42px; min-width: 42px;
    background: var(--primary-gradient);
    color: #fff; border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    box-shadow: 0 3px 12px var(--primary-glow);
    transition: var(--transition);
}
.send-btn-circle:hover { transform: scale(1.05); }
.send-btn-circle:active { transform: scale(0.95); }

/* === REPLY PREVIEW === */
#reply-preview {
    display: none; align-items: center;
    padding: 8px 16px;
    background: var(--bg-input);
    border-top: 1px solid var(--border);
    gap: 8px;
}
.reply-info { flex: 1; border-left: 3px solid var(--primary); padding-left: 10px; }
#reply-title { font-size: 0.8rem; font-weight: 700; color: var(--primary); }
#reply-text { font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px; }

/* === TYPING INDICATOR === */
.typing-indicator-wrapper { padding: 8px 0; }
.typing-indicator { display: flex; gap: 4px; padding: 10px 16px; background: var(--bubble-in); border-radius: 18px; border: 1px solid var(--bubble-in-border); width: fit-content; }
.typing-indicator { background: rgba(255,255,255,0.04); }
body.light-mode .typing-indicator { background: var(--bubble-in); }
.typing-dot {
    width: 7px; height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* === BOTTOM NAV === */
.bottom-nav {
    position: fixed; bottom: 0; left: 0;
    width: 100%;
    display: flex; align-items: center; justify-content: space-around;
    background: var(--bg-header);
    border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    z-index: 200;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}
.bottom-nav { background: rgba(15,15,24,0.95); }
body.light-mode .bottom-nav { background: var(--bg-header); }
.nav-item {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 20px;
    color: var(--text-muted);
    font-size: 0.7rem; font-weight: 600;
    transition: var(--transition-bounce);
    cursor: pointer;
    border-radius: var(--radius-lg);
    gap: 4px;
}
.nav-item i { font-size: 1.25rem; transition: transform 0.3s ease; }
.nav-item.active { color: var(--primary); background: var(--primary-glow); }
.nav-item.active i { transform: scale(1.1); }
.nav-item:hover { color: var(--primary); }
.nav-hidden { display: none !important; }
@media (min-width: 768px) { .bottom-nav { display: none !important; } }

/* === AUTHENTICATION VIEW === */
#auth-view {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-master);
}
.authBox {
    background: var(--bg-card);
    padding: 32px 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.auth-logo-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    color: var(--primary);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}
.auth-tabs {
    display: flex;
    justify-content: space-around;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}
.auth-tabs label {
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
}
#login-trigger:checked ~ .authBox .auth-tabs label[for="login-trigger"],
#signup-trigger:checked ~ .authBox .auth-tabs label[for="signup-trigger"] {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}
.auth-forms {
    position: relative;
}
.auth-form-content {
    display: none;
    flex-direction: column;
    gap: 16px;
}
#login-trigger:checked ~ .authBox .auth-forms #login-form-div,
#signup-trigger:checked ~ .authBox .auth-forms #signup-form-div {
    display: flex;
}
.auth-input-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}
.auth-input-box i {
    color: var(--text-muted);
    margin-right: 12px;
}
.auth-input-box input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 1rem;
}
.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin-top: 8px;
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* === SETTINGS VIEW === */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 0 4px 12px;
    overflow: hidden;
}
.settings-card { background: rgba(255,255,255,0.02); }
body.light-mode .settings-card { background: var(--bg-card); }
.settings-item {
    display: flex; align-items: center;
    padding: 14px 16px;
    transition: var(--transition);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg-hover); }
.settings-item:active { transform: scale(0.99); }
.settings-icon {
    width: 36px; height: 36px; min-width: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-size: 0.95rem;
    margin-right: 14px;
}
.item-info { flex: 1; min-width: 0; }
.item-title {
    font-size: 0.92rem; font-weight: 500;
    color: var(--text-main);
}
.item-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 1px;
}
.settings-section-title {
    font-size: 0.72rem; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 20px 8px;
}
.settings-item-col { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.settings-item-col:last-child { border-bottom: none; }
.item-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: block; }

/* Toggle Switch */
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; inset: 0;
    background: var(--bg-input);
    border: 1.5px solid var(--border-strong);
    border-radius: 26px;
    cursor: pointer;
    transition: var(--transition);
}
.slider::before {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    left: 2px; top: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}
.switch input:checked + .slider { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); background: #fff; }

/* Input with icon */
.input-with-icon {
    display: flex; align-items: center;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 12px;
    transition: var(--transition);
}
.input-with-icon:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.input-with-icon i { color: var(--text-muted); margin-right: 10px; }
.input-with-icon input {
    flex: 1; background: none; border: none; outline: none;
    padding: 11px 0; color: var(--text-main); font-size: 0.92rem;
}

/* === PROFILE VIEW === */
.profile-card {
    display: flex; flex-direction: column; align-items: center;
    padding: 32px 20px 24px;
    text-align: center;
}
.profile-img-lg {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 3px solid var(--primary);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 30px var(--primary-glow);
    position: relative;
}
.profile-img-lg:hover { transform: scale(1.03); }
.profile-img-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-img-lg i { color: var(--text-muted); font-size: 2rem; }
.profile-main-info { margin-top: 16px; }
.profile-main-info h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem; font-weight: 700;
    color: var(--text-main);
}
.profile-main-info p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === CALL OVERLAY === */
#call-overlay {
    position: fixed; inset: 0;
    background: linear-gradient(180deg, #0a0a0f 0%, #1a1a2e 100%);
    z-index: 5000;
    display: none; flex-direction: column;
    align-items: center; justify-content: center;
    color: #fff;
}
#call-overlay.active { display: flex; }
.call-user-info { text-align: center; z-index: 10; }
#call-avatar-container {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    border: 3px solid rgba(255,255,255,0.2);
}
.call-username { font-size: 1.4rem; font-weight: 700; }
.call-status { font-size: 0.9rem; opacity: 0.7; margin-top: 6px; }
.call-actions {
    display: flex; gap: 24px;
    margin-top: 48px; z-index: 10;
}
.call-btn {
    width: 60px; height: 60px;
    border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff;
    transition: var(--transition);
}
.call-btn.accept { background: var(--success); box-shadow: 0 4px 20px rgba(34,197,94,0.4); }
.call-btn.decline { background: var(--danger); box-shadow: 0 4px 20px rgba(239,68,68,0.4); }
.call-btn:hover { transform: scale(1.1); }
.call-floating-bar {
    position: absolute; bottom: 40px;
    display: flex; gap: 12px;
    background: rgba(0,0,0,0.6);
    padding: 12px 20px;
    border-radius: 30px;
    backdrop-filter: blur(20px);
}
.floating-btn {
    width: 48px; height: 48px;
    border-radius: 50%; border: none;
    background: rgba(255,255,255,0.15);
    color: #fff; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.floating-btn:hover { background: rgba(255,255,255,0.25); }
.floating-btn.active { background: var(--primary); }
.floating-btn.danger { background: var(--danger); }

/* Video container */
#video-container { display: none; position: absolute; inset: 0; z-index: 1; }
#remote-video { width: 100%; height: 100%; object-fit: cover; }
#local-video {
    position: absolute; bottom: 100px; right: 16px;
    width: 120px; height: 160px;
    border-radius: var(--radius-lg);
    object-fit: cover; z-index: 20;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* === CONTEXT MENU === */
#context-menu {
    position: fixed; z-index: 9000;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: none; min-width: 180px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}
#context-menu { background: rgba(30,30,50,0.95); }
body.light-mode #context-menu { background: var(--bg-card); }
#context-menu.show { display: block; }
.ctx-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item.danger { color: var(--danger); }
.ctx-item i { width: 18px; text-align: center; }

/* === TOAST === */
#toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 500;
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.9s forwards;
    max-width: 320px;
    backdrop-filter: blur(20px);
}
.toast.info { background: rgba(59, 130, 246, 0.9); }
.toast.success { background: rgba(34, 197, 94, 0.9); }
.toast.error { background: rgba(239, 68, 68, 0.9); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* === NOTIFICATION BANNER === */
#notif-banner {
    position: fixed; top: -80px; left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 400px;
    display: flex; align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    box-shadow: var(--shadow-xl);
    z-index: 8000;
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    gap: 10px;
}
#notif-banner { background: rgba(30,30,50,0.95); }
body.light-mode #notif-banner { background: var(--bg-card); }
#notif-banner.show { top: 20px; }
.nb-av {
    width: 40px; height: 40px; min-width: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-glow);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.nb-info { flex: 1; min-width: 0; }
.nb-title { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }
.nb-body { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === MODALS / DIALOGS === */
.ndx-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 8500;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.ndx-overlay.hidden { display: none; }
.ndx-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    width: 100%; max-width: 380px;
    box-shadow: var(--shadow-xl);
    animation: dialogIn 0.3s ease;
}
.ndx-dialog { background: rgba(20,20,35,0.98); }
body.light-mode .ndx-dialog { background: var(--bg-card); }
@keyframes dialogIn { from { transform: scale(0.9); opacity: 0; } }
.ndx-dialog h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: var(--text-main); }
.ndx-dialog p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 16px; }
.ndx-input {
    width: 100%; padding: 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none; font-size: 0.92rem;
    margin-bottom: 16px;
}
.ndx-input:focus { border-color: var(--primary); }
.ndx-btn-row { display: flex; gap: 10px; justify-content: flex-end; }
.ndx-btn {
    padding: 10px 20px;
    border: none; border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.88rem;
    transition: var(--transition);
}
.ndx-btn.cancel { background: var(--bg-input); color: var(--text-secondary); }
.ndx-btn.confirm { background: var(--primary-gradient); color: #fff; box-shadow: 0 2px 8px var(--primary-glow); }
.ndx-btn.danger { background: var(--danger); color: #fff; }

/* === SEARCH BAR IN CHAT === */
.search-bar-inner {
    display: none; align-items: center;
    flex: 1; gap: 8px;
    background: var(--bg-input);
    border-radius: 25px;
    padding: 0 12px;
}
.search-bar-inner.active { display: flex; }
.search-bar-inner input {
    flex: 1; background: none; border: none; outline: none;
    padding: 8px 0; color: var(--text-main); font-size: 0.9rem;
}
.search-bar-inner i { color: var(--text-muted); }

/* === IMAGE VIEWER === */
#img-viewer {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 9500;
    display: flex; flex-direction: column;
}
#img-viewer.hidden { display: none; }
.img-viewer-bar {
    display: flex; justify-content: space-between;
    padding: 12px 16px;
}
#img-viewer-img { flex: 1; object-fit: contain; }

/* === LINK SHEET === */
#link-sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 7000; }
#link-sheet-backdrop.hidden { display: none; }
#link-sheet {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px;
    z-index: 7001;
    display: flex; flex-direction: column; gap: 10px;
}
#link-sheet { background: rgba(20,20,35,0.98); }
body.light-mode #link-sheet { background: var(--bg-card); }
#link-sheet.hidden { display: none; }
#link-sheet-url { font-size: 0.85rem; color: var(--primary); word-break: break-all; margin-bottom: 8px; }
.sheet-btn {
    padding: 13px; border: none; border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: var(--transition);
}
.sheet-btn.open { background: var(--primary-gradient); color: #fff; }
.sheet-btn.copy { background: var(--bg-input); color: var(--text-main); }
.sheet-btn.cancel2 { background: transparent; color: var(--text-muted); }

/* === MORE MENU === */
#menu-overlay { position: fixed; inset: 0; z-index: 6000; }
#menu-overlay.hidden { display: none; }
#header-more-menu {
    position: fixed; top: 55px; right: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 6001;
    min-width: 200px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}
#header-more-menu { background: rgba(25,25,40,0.98); }
body.light-mode #header-more-menu { background: var(--bg-card); }
#header-more-menu.hidden { display: none; }
.menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 18px;
    font-size: 0.88rem;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}
.menu-item:hover { background: var(--bg-hover); }
.menu-item.danger { color: var(--danger); }
.menu-item i { width: 20px; text-align: center; font-size: 0.9rem; }

/* === PINNED BAR === */
#pinned-bar {
    display: flex; align-items: center;
    padding: 6px 12px;
    background: var(--primary-glow);
    border-radius: 8px;
    margin: 0 12px;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82rem;
}
#pinned-bar.hidden { display: none; }
#pinned-bar i { color: var(--primary); }
#pinned-text { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === FORWARD MODAL === */
#forward-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 8000; display: flex; align-items: flex-end; justify-content: center; padding: 20px; }
#forward-modal.hidden { display: none; }
.forward-sheet {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px; width: 100%; max-width: 400px;
    max-height: 70vh; overflow-y: auto;
}
.forward-sheet { background: rgba(20,20,35,0.98); }
body.light-mode .forward-sheet { background: var(--bg-card); }
.forward-sheet h3 { font-family: var(--font-heading); margin-bottom: 16px; }

/* === DISAPPEARING MODAL === */
#disappearing-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    z-index: 8000;
    display: flex; align-items: flex-end; justify-content: center;
}
#disappearing-modal.hidden { display: none; }
.disappearing-sheet {
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px; width: 100%; max-width: 480px;
}
.disappearing-sheet { background: rgba(20,20,35,0.98); }
body.light-mode .disappearing-sheet { background: var(--bg-card); }
.sheet-header { margin-bottom: 16px; }
.sheet-header h3 { font-family: var(--font-heading); font-size: 1.1rem; }
.sheet-header p { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.duration-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.duration-opt {
    padding: 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.duration-opt:hover { border-color: var(--primary); color: var(--primary); }

/* === EMOJI PICKER === */
.emoji-picker-flyout {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px;
    display: flex; flex-wrap: wrap; gap: 6px;
    box-shadow: var(--shadow-xl);
    z-index: 7000;
    max-width: 280px;
}
.emoji-picker-flyout { background: rgba(25,25,40,0.98); }
body.light-mode .emoji-picker-flyout { background: var(--bg-card); }
.emoji-picker-flyout span { cursor: pointer; font-size: 1.2rem; padding: 4px; border-radius: 6px; transition: var(--transition); }
.emoji-picker-flyout span:hover { background: var(--bg-hover); transform: scale(1.2); }

/* === FILE STAGE === */
#file-stage-bar {
    padding: 8px 16px;
    background: var(--bg-input);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
#file-stage-bar.hidden { display: none; }
#file-stage-preview img { max-height: 80px; border-radius: 8px; }
.file-stage-actions { display: flex; gap: 8px; }

/* === VOICE === */
.voice-rec-overlay {
    position: fixed; bottom: 0; left: 0; width: 100%;
    display: none; align-items: center;
    padding: 16px 20px;
    background: var(--primary-gradient);
    color: #fff;
    z-index: 300;
    gap: 12px;
}
.voice-rec-overlay.active, #voice-overlay.active { display: flex; }
.v-wave { display: flex; gap: 3px; align-items: center; }
.v-bar {
    width: 3px; background: #fff;
    border-radius: 3px;
    animation: waveBar 0.8s infinite;
}
.v-bar:nth-child(1) { height: 12px; animation-delay: 0s; }
.v-bar:nth-child(2) { height: 20px; animation-delay: 0.15s; }
.v-bar:nth-child(3) { height: 16px; animation-delay: 0.3s; }
.v-bar:nth-child(4) { height: 24px; animation-delay: 0.45s; }
@keyframes waveBar { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1.2); } }

/* === QR MODAL === */
.qr-dialog { text-align: center; }
.qr-box {
    width: 180px; height: 180px;
    background: var(--bg-input);
    border-radius: var(--radius-lg);
    margin: 16px auto;
    display: flex; align-items: center; justify-content: center;
}
.qr-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.qr-logo {
    position: absolute;
    width: 40px; height: 40px;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800;
}

/* === THEME GRID === */
.theme-card {
    padding: 20px 12px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.78rem; font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.theme-card:hover { border-color: rgba(255,255,255,0.3); }
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }

/* === MULTI SELECT === */
.multi-select-bar {
    display: none; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: var(--primary-glow);
    border-bottom: 1px solid var(--border);
}
#ms-count { font-weight: 700; color: var(--primary); }

/* === GALLERY === */
.gallery-view { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px !important; }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; cursor: pointer; }

/* === MEDIA GALLERY VIEW === */
#media-gallery-view { background: var(--bg-master); }

/* === MISC === */
.hidden { display: none !important; }
.hidden-btn { opacity: 0; pointer-events: none; }
.ds-branding {
    text-align: center; padding: 16px;
    font-size: 0.7rem; font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1px;
}
.btn-primary {
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: #fff; border: none;
    border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 3px 12px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-danger { background: var(--danger); box-shadow: 0 3px 12px rgba(239,68,68,0.3); }
.stylish-alert {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 20px var(--primary-glow);
    display: flex; align-items: center; gap: 8px;
    transition: all 0.5s ease;
}
.animate-slide-in { animation: slideDown 0.4s ease; }
@keyframes slideDown { from { top: -60px; opacity: 0; } }

.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Code span */
.code-span {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}
.code-span { background: rgba(255,255,255,0.08); }
body.light-mode .code-span { background: rgba(0,0,0,0.1); }

.msg-link { color: var(--info); text-decoration: underline; cursor: pointer; }

.highlight-msg { animation: highlightPulse 1.2s ease; }
@keyframes highlightPulse { 0%, 100% { background: transparent; } 50% { background: var(--primary-glow); } }

/* File bubble */
.file-bubble {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
}
.file-bubble { background: rgba(255,255,255,0.06); }
body.light-mode .file-bubble { background: rgba(0,0,0,0.1); }

/* Selection */
.selection-indicator { display: none; color: var(--primary); margin-left: auto; }
.list-item.selected .selection-indicator { display: block; }
.list-item.selected { background: var(--primary-glow); }

/* Voice join bubble */
.voice-join-bubble {
    background: var(--primary-gradient);
    color: #fff;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    text-align: center;
}
.voice-join-bubble .join-btn {
    margin-top: 10px;
    padding: 8px 20px;
    background: rgba(0,0,0,0.2);
    border: none; border-radius: 20px;
    color: #fff; font-weight: 700;
    cursor: pointer;
}

/* Search bar container */
.search-bar-container { padding: 8px 16px; }
.search-input {
    width: 100%; padding: 10px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 25px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* Input base */
.input-base {
    width: 100%; padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    font-size: 0.9rem;
    transition: var(--transition);
}
.input-base:focus { border-color: var(--primary); }

/* System msg */
.system-msg {
    text-align: center;
    padding: 6px 14px;
    background: var(--bg-input);
    border-radius: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 8px auto;
    width: fit-content;
}

/* Upload loader */
.upload-loader {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
}
.loader-ring {
    width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* One time */
.file-bubble.view-once { cursor: pointer; }
.file-bubble.opened { opacity: 0.5; }

/* Language options */
.lang-option {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}
.lang-option:hover { background: var(--bg-hover); }
.lang-option.active { background: var(--primary-glow); color: var(--primary); font-weight: 700; }

/* FAB */
.fab {
    position: absolute; bottom: 80px; right: 20px;
    width: 56px; height: 56px;
    background: var(--primary-gradient);
    color: #fff; border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px var(--primary-glow);
    display: flex; align-items: center; justify-content: center;
    z-index: 50;
    transition: var(--transition);
}
.fab:hover { transform: scale(1.08); }

/* Voice activation overlay */
#voice-activation-overlay {
    backdrop-filter: blur(12px);
}
.voice-activation-circle-wrap { position: relative; width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }
.voice-progress-svg { position: absolute; transform: rotate(-90deg); }
.voice-progress-bg { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 4; }
.voice-progress-bar { fill: none; stroke: var(--primary); stroke-width: 4; stroke-dasharray: 314; stroke-dashoffset: 314; stroke-linecap: round; transition: stroke-dashoffset 0.1s; }
.voice-mic-icon { font-size: 2rem; color: #fff; }

/* Pulse */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* User info view */
#user-info-view { background: var(--bg-master); }
#info-user-img {
    border: 3px solid var(--primary);
    box-shadow: 0 12px 40px var(--primary-glow);
}
#info-user-name { color: var(--text-main); }
#info-user-handle { color: var(--text-muted); }
#info-user-bio { color: var(--text-secondary); }

/* Group info */
#group-info-view { background: var(--bg-master); }

/* Selection for multi-select messages */
.message-wrapper.ms-selected { background: var(--primary-glow); border-radius: var(--radius-md); }
