.opsik-sidebar-icons {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
}

.user-icon {
    width: 44px;
    height: 44px;
    border: 1.5px solid #8a2be2;
    border-radius: 6px;
    background: rgba(10, 10, 10, 0.8);
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.user-icon img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.user-icon:hover {
    box-shadow: 0 0 10px #8a2be2;
    transform: scale(1.1);
}

.online-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #00ffcc;
    border-radius: 50%;
    box-shadow: 0 0 5px #00ffcc;
}

.offline-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #e90808;
    border-radius: 50%;
    box-shadow: 0 0 5px #00ffcc;
}

/* --- الحاوية الكبيرة لي كجمع الشات و الكاميرات برّا --- */
.opsik-chat-container-wrapper {
    position: fixed;
    right: 65px;
    top: 50%;
    transform: translateY(-50%);
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 1001;
}

/* --- الصندوق الرئيسي للشات في الوسط --- */
.opsik-chat-window {
    width: 100%;
    height: 420px;
    background: rgba(10, 10, 10, 0.98);
    border: 1.5px solid #8a2be2;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(15px);
    position: relative;
}

/* --- تصغير وتثبيت حجم الـ Avatar في الهيدر --- */
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-circle {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    border-radius: 6px !important;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

/* --- Styling ديال الـ Video Call Widgets --- */
.video-call-widget-card {
    background: rgba(20, 10, 35, 0.9);
    border: 1.5px solid rgba(168, 85, 247, 0.5);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.cam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #d8b4fe;
    font-family: monospace;
    position: relative;
}

.cam-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cam-status-dot {
    width: 7px;
    height: 7px;
    background-color: #ff4d4d;
    border-radius: 50%;
}

.cam-status-dot.active {
    background-color: #00ffcc;
    box-shadow: 0 0 8px #00ffcc;
}

/* --- زر الإغلاق الخاص بالكاميرا (Fermer) --- */
.cam-close-btn {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.4);
    color: #ff4444;
    font-size: 12px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
    line-height: 1;
}

.cam-close-btn:hover {
    background: rgba(255, 68, 68, 0.3);
    color: #ff1111;
    transform: scale(1.15);
    box-shadow: 0 0 6px rgba(255, 68, 68, 0.6);
}

.video-feed-container {
    position: relative;
    width: 100%;
    height: 160px;
    background-color: #0d0614;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-feed-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.cam-placeholder-overlay {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    font-size: 11px;
    z-index: 1;
}

/* --- الهيدر الكامل --- */
.chat-header-window {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.name-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(20, 20, 20, 0.5);
}

.user-name-text {
    color: #00ffcc;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

.close-x {
    color: #ff4444;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: bold;
    margin-left: 5px;
    font-size: 16px;
}

.address-bar-violet {
    background-color: #8a2be2;
    padding: 2px 12px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.wallet-text-white {
    color: #ffffff;
    font-size: 10px;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.copy-btn-cyber {
    background: transparent;
    border: none;
    color: #39ff14;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    filter: drop-shadow(0 0 2px #39ff14);
}

.copy-btn-cyber:hover {
    color: #ffffff;
    filter: drop-shadow(0 0 10px #ffffff);
    transform: scale(1.1);
}

/* --- باقي مكونات الشات --- */
.chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    color: white;
}

.message-wrapper {
    display: flex !important;
    align-items: flex-end !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
    position: relative;
    overflow: visible !important;
}

.message-wrapper.received {
    flex-direction: row !important;
}

.message-wrapper.sent {
    flex-direction: row-reverse !important;
}

.msg-avatar {
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
    border: 1.5px solid #8a2be2 !important;
    background: linear-gradient(45deg, #8a2be2, #00ffcc) !important;
    flex-shrink: 0 !important;
    box-shadow: 0 0 5px rgba(138, 43, 226, 0.4);
}

.msg-avatar img {
    max-width: 100%;
    height: auto;
}

.msg-content {
    display: flex !important;
    flex-direction: column !important;
    max-width: 70% !important;
    position: relative;
    overflow: visible !important;
}

.received .msg-content {
    align-items: flex-start !important;
}

.sent .msg-content {
    align-items: flex-end !important;
}

.msg-bubble {
    padding: 10px 14px !important;
    border-radius: 15px !important;
    font-size: 13px !important;
    color: white !important;
    backdrop-filter: blur(5px);
}

.received-bubble {
    background: rgba(138, 43, 226, 0.2) !important;
    border: 1px solid #8a2be2 !important;
    border-bottom-left-radius: 2px !important;
}

.sent-bubble {
    background: rgba(0, 255, 204, 0.1) !important;
    border: 1px solid #00ffcc !important;
    border-bottom-right-radius: 2px !important;
}

.msg-time {
    font-size: 9px !important;
    opacity: 0.5 !important;
    margin-top: 4px !important;
    display: block !important;
    text-transform: uppercase;
}

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

.message-wrapper {
    animation: msgAppear 0.3s ease-out forwards;
}

/* --- الـ Footer والـ Tools --- */
.chat-footer-window {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(10, 10, 10, 0.95);
    border-top: 1px solid rgba(138, 43, 226, 0.3);
    box-sizing: border-box;
}

.footer-tools {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.emoji-btn-style {
    background: transparent;
    border: none;
    color: #8a2be2;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0;
    font-size: 20px;
}

.emoji-btn-style:hover {
    color: #00ffff;
    filter: drop-shadow(0 0 8px #8a2be2);
    transform: scale(1.1);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    min-width: 0;
    font-size: 13px;
    padding-left: 5px;
}

.send-btn {
    background: transparent;
    border: none;
    color: #8a2be2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    padding: 5px;
    flex-shrink: 0;
}

.send-btn:hover {
    color: #00ffcc;
    transform: scale(1.1) rotate(-10deg);
    filter: drop-shadow(0 0 5px #00ffcc);
}

/* --- الإيموجي بيكر والـ Search --- */
#emoji-picker {
    position: absolute;
    bottom: 110px;
    left: 15px;
    right: 15px;
    background: rgba(10, 10, 10, 0.98);
    border: 1.5px solid #8a2be2;
    border-radius: 12px;
    padding: 10px;
    z-index: 2000;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.emoji-tabs {
    display: flex;
    justify-content: space-around;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
    margin-bottom: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
    filter: grayscale(100%);
}

.tab-btn.active,
.tab-btn:hover {
    filter: grayscale(0%);
    transform: scale(1.2);
}

.emoji-list-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.emoji-list-container span {
    cursor: pointer;
    font-size: 20px;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* --- شريط Listen Now --- */
.listen-now-bar {
    position: relative;
    z-index: 10;
    background: rgba(33, 31, 34, 0.9);
    border-top: 1px solid rgba(138, 43, 226, 0.3);
    border-bottom: 1px solid rgba(138, 43, 226, 0.3);
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00ffcc;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.pulse-icon {
    width: 6px;
    height: 6px;
    background: #ff4444;
    border-radius: 50%;
    animation: pulse-red 1.5s infinite;
}

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

marquee {
    flex: 1;
    font-family: 'Courier New', monospace;
}

/* --- الـ Typing Indicator --- */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(168, 85, 247, 0.08);
    border-left: 2px solid #A855F7;
    border-radius: 2px;
    width: fit-content;
    margin: 5px 0 10px 10px;
    min-height: 18px;
}

.dot {
    width: 4px;
    height: 4px;
    background: #A855F7;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

.typing-text {
    font-size: 10px;
    color: #A855F7;
    margin-left: 5px;
    font-family: sans-serif;
    text-transform: lowercase;
}

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-3px); opacity: 1; }
}

/* --- الإشعارات و الـ Menu --- */
.encryption-notice {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    margin: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
}

.enc-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aaa;
    font-size: 10px;
}

.close-enc {
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
}

.close-enc:hover { color: #FFD700; }

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

.action-btn-neon {
    background: transparent;
    border: none;
    color: #8a2be2;
    cursor: pointer;
    padding: 2px;
    transition: 0.3s ease;
    display: flex;
    align-items: center;
}

.action-btn-neon:hover {
    color: #00ffcc;
    filter: drop-shadow(0 0 5px #00ffcc);
    transform: scale(1.1);
}

.like-heart:hover {
    color: #ff4444 !important;
    filter: drop-shadow(0 0 5px #ff4444) !important;
}

.more-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: 35px;
    right: 0;
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid rgba(138, 43, 226, 0.5);
    border-radius: 8px;
    width: 150px;
    z-index: 3000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 5px;
}

.dropdown-menu button {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    padding: 8px 10px;
    text-align: left;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
    border-radius: 4px;
}

.dropdown-menu button:hover {
    background: rgba(138, 43, 226, 0.2);
    color: #00ffcc;
}

.dropdown-menu .delete-btn:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #eee;
    font-size: 12px;
}

.report-option:hover {
    background: rgba(255, 165, 0, 0.1) !important;
}
.report-option:hover span, .report-option:hover svg {
    color: #ffa500;
    stroke: #ffa500;
}

.delete-option:hover {
    background: rgba(255, 68, 68, 0.1) !important;
}
.delete-option:hover span { color: #ff4444; }
.delete-option:hover svg { stroke: #ff4444; }

/* --- Search Box داخل الشات --- */
#chatSearchBox {
    display: none;
    position: absolute;
    top: 10px;
    left: 5%;
    width: 90%;
    z-index: 99999 !important;
    background: #111;
    border: 1px solid #A855F7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    border-radius: 4px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
}

#searchInputField {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-family: inherit;
    font-size: 13px;
}

.close-search-btn {
    background: transparent;
    border: none;
    color: #A855F7;
    cursor: pointer;
    font-size: 18px;
}

.highlight {
    background-color: rgba(168, 85, 247, 0.4);
    color: #fff;
    border-radius: 2px;
}

/* --- الأيقونات الجانبية (Ghost Users & Scroll) --- */
html {
    scroll-behavior: smooth;
}

.scroll-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: pointer;
}

.scroll-btn svg:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 4px #00ffcc);
}

.ghost-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
}

.user-avatar.ghost {
    width: 44px;
    height: 44px;
    background-color: #1a1a1a;
    border: 1px solid rgba(9, 216, 182, 0.8);
    border-radius: 8px;
    opacity: 0.5;
}

.top { margin-bottom: 4px; }
.bottom { margin-top: 4px; }

.user-avatar.ghost img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    filter: grayscale(100%) contrast(80%);
    opacity: 0.3;
    display: block;
}