/* ============================================================
   BULLET SERVER - FIGMA PIXEL-PERFECT COMMUNITY FORUM & CHAT CSS
   ============================================================ */

:root {
    --bg-dark-main: #090a0f;
    --bg-panel: #111219;
    --bg-card: #171821;
    --bg-card-hover: #1f202b;
    --bg-input: #15161e;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-highlight: rgba(124, 58, 237, 0.3);
    
    --accent-violet: #7c3aed;
    --accent-violet-light: #8b5cf6;
    --accent-violet-glow: rgba(124, 58, 237, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --status-online: #22c55e;
}

/* Base Body Override */
body.sp-body {
    background-color: var(--bg-dark-main) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* App Container Wrapper */
.figma-app-wrapper {
    max-width: 1520px;
    margin: 100px auto 40px auto;
    padding: 0 24px;
    box-sizing: border-border-box;
}

.figma-chat-frame {
    display: flex;
    height: calc(100vh - 140px);
    min-height: 680px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(124, 58, 237, 0.08);
}

/* ════════════════════════════════════════════════════════════
   LEFT SIDEBAR (CHATS LIST)
   ════════════════════════════════════════════════════════════ */
.chat-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #0d0e14;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-violet-light), var(--accent-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px var(--accent-violet-glow);
}

.sidebar-app-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.sidebar-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-action-btn:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #ffffff;
    border-color: var(--accent-violet);
}

/* Search Box */
.sidebar-search-box {
    padding: 0 20px 14px 20px;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sidebar-search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s ease;
}

.sidebar-search-input:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 12px var(--accent-violet-glow);
}

/* Navigation Filter Tabs */
.sidebar-tabs {
    display: flex;
    padding: 0 20px 16px 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
}

.tab-item {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    padding-bottom: 6px;
    transition: color 0.2s ease;
}

.tab-item:hover {
    color: var(--text-secondary);
}

.tab-item.active {
    color: var(--accent-violet-light);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-violet-light);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent-violet-light);
}

/* Section Header Label */
.sidebar-section-label {
    padding: 16px 20px 8px 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Chat Items List */
.chat-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 16px 12px;
}

.chat-list-container::-webkit-scrollbar {
    width: 4px;
}

.chat-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.chat-item:hover {
    background: var(--bg-card);
}

.chat-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(139, 92, 246, 0.15));
    border: 1px solid var(--border-highlight);
}

.chat-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(124, 58, 237, 0.3);
    image-rendering: -webkit-optimize-contrast;
}

.avatar-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--status-online);
    border-radius: 50%;
    border: 2px solid #0d0e14;
}

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

.chat-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-item-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-item-preview {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pin-icon {
    font-size: 0.75rem;
    color: var(--accent-violet-light);
}

/* ════════════════════════════════════════════════════════════
   CENTER MAIN CHAT WINDOW
   ════════════════════════════════════════════════════════════ */
.chat-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #111218;
}

/* Chat Header */
.main-chat-header {
    padding: 16px 24px;
    background: #14151e;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-user-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-avatar-wrap {
    position: relative;
}

.header-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #090a0f;
    border: 2px solid var(--accent-violet-light);
    box-shadow: 0 0 14px rgba(124, 58, 237, 0.4);
    image-rendering: -webkit-optimize-contrast;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
}

.header-user-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.header-user-status {
    font-size: 0.8rem;
    color: var(--status-online);
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-user-status::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--status-online);
    border-radius: 50%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.header-search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #181924;
    border: 1px solid var(--accent-violet-light);
    border-radius: 20px;
    padding: 4px 10px;
    box-shadow: 0 4px 16px var(--accent-violet-glow);
    animation: searchExpand 0.2s ease-out;
}

@keyframes searchExpand {
    from { opacity: 0; transform: scaleX(0.8); }
    to { opacity: 1; transform: scaleX(1); }
}

.header-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    width: 170px;
}

.search-match-count {
    font-size: 0.75rem;
    color: var(--accent-violet-light);
    font-weight: 700;
    white-space: nowrap;
    padding: 0 4px;
}

.header-search-nav-btn, .header-search-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.header-search-nav-btn:hover, .header-search-close-btn:hover {
    color: #ffffff;
}

.header-icon-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-icon-btn:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #ffffff;
    border-color: var(--accent-violet);
}

.msg-bubble.search-highlight {
    border: 2px solid #f59e0b !important;
    background: rgba(245, 158, 11, 0.25) !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6) !important;
    animation: searchPulse 1.5s infinite alternate;
}

@keyframes searchPulse {
    from { box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
    to { box-shadow: 0 0 25px rgba(245, 158, 11, 0.8); }
}

/* Messages Stream Area */
.messages-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background-color: #0b0c12;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
    background-size: 36px 36px, 36px 36px, 100% 100%;
}

.messages-viewport::-webkit-scrollbar {
    width: 5px;
}

.messages-viewport::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

/* Message Groups */
.msg-group {
    display: flex;
    flex-direction: column;
    max-width: 68%;

}

.msg-group.incoming {
    align-self: flex-start;
}

.msg-group.outgoing {
    align-self: flex-end;
}

/* Message Bubble Styling */
.msg-bubble {
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.55;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.msg-group.incoming .msg-bubble {
    background: #1c1d26;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top-left-radius: 4px;
}

.msg-group.outgoing .msg-bubble {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.35);
}

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
}

.msg-group.outgoing .msg-meta {
    color: rgba(255, 255, 255, 0.75);
}

.msg-ticks {
    color: #38bdf8;
    font-size: 0.8rem;
}

/* Media Attachment Card (Dashboard Image Preview) */
.msg-media-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #181922;
    margin-top: 4px;
    max-width: 420px;
}

.msg-media-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* Audio Voice Message Bubble */
.audio-msg-bubble {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #1c1d26;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 18px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    min-width: 260px;
}

.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-violet);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px var(--accent-violet-glow);
    cursor: pointer;
}

.audio-waveform {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    height: 24px;
}

.wave-bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
}

.wave-bar.active {
    background: var(--accent-violet-light);
}

.audio-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Typing Indicator */
.typing-indicator-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--accent-violet-light);
    margin-top: 4px;
}

.dots-spinner {
    display: flex;
    gap: 4px;
}

.dot-anim {
    width: 6px;
    height: 6px;
    background: var(--accent-violet-light);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.dot-anim:nth-child(1) { animation-delay: -0.32s; }
.dot-anim:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Reaction Badges Container */
.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 0.78rem;
    margin-top: 6px;
    align-self: flex-start;
}

/* Chat Input Bar */
.chat-input-bar {
    padding: 16px 24px;
    background: #14151e;
    border-top: 1px solid var(--border-color);
}

.input-container-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 12px 8px 18px;
    transition: all 0.2s ease;
}

.input-container-pill:focus-within {
    border-color: var(--accent-violet);
    box-shadow: 0 0 16px var(--accent-violet-glow);
}

.input-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon-btn:hover {
    color: #ffffff;
}

.message-text-input {
    flex: 1;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 0.92rem;
    outline: none;
    font-family: inherit;
}

.message-text-input::placeholder {
    color: var(--text-muted);
}

.send-submit-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-violet-light), var(--accent-violet));
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--accent-violet-glow);
    transition: all 0.2s ease;
}

.send-submit-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px var(--accent-violet-glow);
}

.emoji-picker-popup {
    position: absolute;
    bottom: 75px;
    left: 24px;
    background: #181924;
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 280px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 50;
    animation: popupIn 0.2s ease-out;
}

.emoji-picker-popup span {
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.15s ease;
    user-select: none;
}

.emoji-picker-popup span:hover {
    transform: scale(1.35);
}

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

/* ════════════════════════════════════════════════════════════
   RIGHT SIDEBAR (DETAILS & PROFILE PANEL)
   ════════════════════════════════════════════════════════════ */
.chat-details-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #0d0e14;
    border-left: 1px solid var(--border-color);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

.profile-brand-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #050608;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 16px;
}

.profile-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.profile-display-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
    text-align: center;
}

.details-section-wrap {
    width: 100%;
}

.details-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.details-about-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

.details-avatar-card {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--border-highlight);
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
    position: relative;
    overflow: hidden;
}

.user-avatar-lg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.upload-avatar-trigger-btn {
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(139, 92, 246, 0.2));
    border: 1px solid var(--border-highlight);
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
    transition: all 0.2s ease;
}

.upload-avatar-trigger-btn:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(139, 92, 246, 0.4));
    box-shadow: 0 0 16px var(--accent-violet-glow);
}

.details-user-input {
    width: 100%;
    height: 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-highlight);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0 16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.edit-bio-btn {
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid var(--border-highlight);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--accent-violet-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.edit-bio-btn:hover {
    background: var(--accent-violet-light);
    color: #ffffff;
    transform: scale(1.1);
}

.details-bio-box {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-top: 8px;
    box-sizing: border-box;
    word-break: break-word;
}

.details-bio-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--accent-violet-light);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    padding: 10px 12px;
    box-sizing: border-box;
    resize: none;
    outline: none;
    margin-bottom: 8px;
}

.details-bio-textarea:focus {
    box-shadow: 0 0 10px var(--accent-violet-glow);
}

.save-bio-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--accent-violet-light), var(--accent-violet));
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.save-bio-btn:hover {
    box-shadow: 0 0 14px var(--accent-violet-glow);
    transform: translateY(-1px);
}

.global-chat-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(139, 92, 246, 0.1)) !important;
    border: 1px dashed var(--accent-violet-light) !important;
}

.global-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-violet-light), var(--accent-violet));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px var(--accent-violet-glow);
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN ADAPTATIONS
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .chat-details-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .figma-app-wrapper {
        padding: 0 10px;
        margin-top: 80px;
    }

    .chat-sidebar {
        width: 100%;
        display: none;
    }

    .chat-sidebar.mobile-open {
        display: flex;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
    }

    .msg-group {
        max-width: 88%;
    }
}

/* ════════════════════════════════════════════════════════════
   THEME SELECTOR DROPDOWN & LIGHT THEME STYLING
   ════════════════════════════════════════════════════════════ */

.sidebar-header {
    position: relative;
}

.theme-selector-dropdown {
    position: absolute;
    top: 60px;
    left: 16px;
    right: 16px;
    z-index: 1000;
    background: rgba(17, 18, 25, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(124, 58, 237, 0.2);
    animation: themeDropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes themeDropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.theme-dropdown-header {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-violet-light);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-opt-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
    user-select: none;
}

.theme-opt-btn:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.4);
}

.theme-opt-btn.active {
    background: rgba(124, 58, 237, 0.25);
    border-color: var(--accent-violet-light);
}

.theme-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.dark-preview {
    background: linear-gradient(135deg, #090a0f 50%, #7c3aed 50%);
}

.light-preview {
    background: linear-gradient(135deg, #ffffff 50%, #e2e8f0 50%);
    border-color: #cbd5e1;
}

.theme-opt-info {
    flex-grow: 1;
}

.theme-opt-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.theme-opt-sub {
    font-size: 0.72rem;
    color: #9ca3af;
}

.theme-opt-btn .check-icon {
    font-size: 0.85rem;
    color: var(--accent-violet-light);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.theme-opt-btn.active .check-icon {
    opacity: 1;
}

/* ════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES (White / Light Mode)
   ════════════════════════════════════════════════════════════ */

body.light-theme {
    color: #0f172a !important;
}

body.light-theme .figma-chat-frame {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(124, 58, 237, 0.15) !important;
}

body.light-theme .chat-sidebar {
    background: #f8fafc !important;
    border-right-color: #e2e8f0 !important;
}

body.light-theme .sidebar-app-title {
    color: #0f172a !important;
}

body.light-theme .sidebar-action-btn {
    background: #e2e8f0 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}
body.light-theme .sidebar-action-btn:hover {
    background: #7c3aed !important;
    color: #ffffff !important;
}

body.light-theme .sidebar-search-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
body.light-theme .sidebar-search-input::placeholder {
    color: #94a3b8 !important;
}
body.light-theme .sidebar-search-box i {
    color: #64748b !important;
}

body.light-theme .sidebar-section-label {
    color: #64748b !important;
}

body.light-theme .chat-item {
    background: transparent !important;
    border-color: transparent !important;
}
body.light-theme .chat-item:hover {
    background: #f1f5f9 !important;
}
body.light-theme .chat-item.active {
    background: #ede9fe !important;
    border-color: #c4b5fd !important;
}
body.light-theme .chat-item-name {
    color: #0f172a !important;
}
body.light-theme .chat-item-preview span {
    color: #64748b !important;
}
body.light-theme .chat-item-time {
    color: #64748b !important;
}

/* Chat Main Area */
body.light-theme .chat-main-area {
    background: #ffffff !important;
}
body.light-theme .main-chat-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
body.light-theme .header-user-name {
    color: #0f172a !important;
}
body.light-theme .header-user-status {
    color: #64748b !important;
}
body.light-theme .header-icon-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}
body.light-theme .header-icon-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Messages Viewport - Dark Grid background in all themes */
body.light-theme .messages-viewport {
    background-color: #0b0c12 !important;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.08) 0%, transparent 70%) !important;
    background-size: 36px 36px, 36px 36px, 100% 100% !important;
}

/* Chat Bubbles - Dark Cards and Glowing Violet Outgoing */
body.light-theme .chat-bubble.other,
body.light-theme .msg-group.incoming .msg-bubble {
    background: #1c1d26 !important;
    color: #f3f4f6 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}
body.light-theme .chat-bubble.other .msg-text,
body.light-theme .msg-group.incoming .msg-text {
    color: #f3f4f6 !important;
}
body.light-theme .chat-bubble.other .msg-sender-name,
body.light-theme .msg-group.incoming .msg-sender-name {
    color: #00f0ff !important;
}
body.light-theme .chat-bubble.mine,
body.light-theme .msg-group.outgoing .msg-bubble {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.35) !important;
}
body.light-theme .chat-bubble.mine .msg-text,
body.light-theme .msg-group.outgoing .msg-text {
    color: #ffffff !important;
}
body.light-theme .msg-timestamp {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Chat Input Footer */
body.light-theme .chat-input-bar {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
}
body.light-theme .input-container-pill {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
body.light-theme .message-text-input {
    color: #0f172a !important;
}
body.light-theme .message-text-input::placeholder {
    color: #94a3b8 !important;
}
body.light-theme .input-icon-btn {
    color: #64748b !important;
}

/* Right Profile Details Sidebar */
body.light-theme .chat-details-sidebar {
    background: #f8fafc !important;
    border-left: 1px solid #e2e8f0 !important;
}
body.light-theme .profile-display-name {
    color: #0f172a !important;
}
body.light-theme .details-label {
    color: #64748b !important;
}
body.light-theme .details-about-text {
    color: #475569 !important;
}
body.light-theme .details-user-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
body.light-theme .details-bio-box {
    background: #ffffff !important;
    color: #334155 !important;
    border-color: #e2e8f0 !important;
}
body.light-theme .details-bio-textarea {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
body.light-theme .upload-avatar-trigger-btn {
    background: rgba(124, 58, 237, 0.1) !important;
    color: #7c3aed !important;
    border-color: rgba(124, 58, 237, 0.3) !important;
}
body.light-theme .upload-avatar-trigger-btn:hover {
    background: #7c3aed !important;
    color: #ffffff !important;
}

/* Light Theme Dropdown Modal Styles */
body.light-theme .theme-selector-dropdown {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12) !important;
}
body.light-theme .theme-dropdown-header {
    color: #7c3aed !important;
    border-bottom-color: #e2e8f0 !important;
}
body.light-theme .theme-opt-btn {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}
body.light-theme .theme-opt-btn:hover {
    background: #ede9fe !important;
    border-color: #c4b5fd !important;
}

/* ════════════════════════════════════════════════════════════
   USER MINI PROFILE POPUP MODAL STYLES
   ════════════════════════════════════════════════════════════ */

.user-profile-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 30px 0 30px 45px !important;
    animation: userModalOverlayFade 0.25s ease !important;
}

@media (max-width: 640px) {
    .user-profile-modal-overlay {
        justify-content: center !important;
        padding: 16px !important;
    }
}

@keyframes userModalOverlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes userModalSlideLeft {
    from { opacity: 0; transform: translateX(-50px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.user-profile-modal-card {
    width: 100% !important;
    max-width: 440px !important;
    background: rgba(17, 18, 25, 0.98) !important;
    border: 1px solid rgba(124, 58, 237, 0.45) !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 45px rgba(124, 58, 237, 0.25) !important;
    position: relative !important;
    color: #f3f4f6 !important;
    animation: userModalSlideLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.user-card-banner {
    height: 115px !important;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(0, 240, 255, 0.6)) !important;
    position: relative !important;
}

.user-card-close-btn {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 0.95rem !important;
}

.user-card-close-btn:hover {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    transform: rotate(90deg) scale(1.1) !important;
}

.user-card-body {
    padding: 0 26px 26px 26px !important;
    margin-top: -46px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: right !important;
    box-sizing: border-box !important;
}

.user-card-avatar-wrap {
    position: relative !important;
    width: 92px !important;
    height: 92px !important;
    margin-bottom: 16px !important;
    align-self: flex-start !important;
}

.user-card-avatar {
    width: 92px !important;
    height: 92px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 4px solid #111219 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
    background: #171821 !important;
}

.user-card-status-dot {
    position: absolute !important;
    bottom: 4px !important;
    right: 4px !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    border: 3px solid #111219 !important;
    background: #64748b !important;
    transition: all 0.3s ease !important;
}

.user-card-status-dot.online {
    background: #22c55e !important;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.95) !important;
}

.user-card-names {
    margin-bottom: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
}

.user-card-title-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-bottom: 4px !important;
    width: 100% !important;
    justify-content: flex-start !important;
}

.user-card-display-name {
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    letter-spacing: -0.3px !important;
}

.user-card-badge {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    padding: 3px 10px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(236, 72, 153, 0.4)) !important;
    color: #00f0ff !important;
    border: 1px solid rgba(0, 240, 255, 0.4) !important;
    letter-spacing: 0.5px !important;
}

.user-card-badge.member {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--accent-violet-light) !important;
    border-color: rgba(124, 58, 237, 0.3) !important;
}

.user-card-handle {
    font-size: 0.9rem !important;
    color: #9ca3af !important;
    direction: ltr !important;
    text-align: right !important;
    width: 100% !important;
}

.user-card-section {
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 14px !important;
    padding: 14px 16px !important;
    margin-bottom: 18px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.user-card-section-label {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: var(--accent-violet-light) !important;
    margin-bottom: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.user-card-bio-text {
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
    color: #e2e8f0 !important;
    word-break: break-word !important;
    text-align: right !important;
}

.user-card-stats-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-bottom: 22px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.user-card-stat {
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    align-items: flex-start !important;
    text-align: right !important;
}

.user-card-stat .stat-label {
    font-size: 0.72rem !important;
    color: #9ca3af !important;
}

.user-card-stat .stat-value {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: #f3f4f6 !important;
}

.user-card-stat .stat-value.online {
    color: #22c55e !important;
}

.user-card-stat .stat-value.offline {
    color: #94a3b8 !important;
}

.user-card-actions {
    display: flex !important;
    gap: 12px !important;
    width: 100% !important;
}
    gap: 12px;
}

.user-action-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
}

.user-action-btn.primary {
    background: linear-gradient(135deg, var(--accent-violet), #6d28d9);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.user-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

.user-action-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #d1d5db;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Light Theme Styling for User Profile Modal */
body.light-theme .user-profile-modal-overlay {
    background: rgba(15, 23, 42, 0.45) !important;
}

body.light-theme .user-profile-modal-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

body.light-theme .user-card-avatar {
    border-color: #ffffff !important;
    background: #f1f5f9 !important;
}

body.light-theme .user-card-status-dot {
    border-color: #ffffff !important;
}

body.light-theme .user-card-display-name {
    color: #0f172a !important;
}

body.light-theme .user-card-handle {
    color: #64748b !important;
}

body.light-theme .user-card-section {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .user-card-bio-text {
    color: #334155 !important;
}

body.light-theme .user-card-stat {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .user-card-stat .stat-label {
    color: #64748b !important;
}

body.light-theme .user-card-stat .stat-value {
    color: #0f172a !important;
}

body.light-theme .user-action-btn.secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .user-action-btn.secondary:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
body.light-theme .theme-opt-btn.active {
    background: #ede9fe !important;
    border-color: #7c3aed !important;
}
body.light-theme .theme-opt-name {
    color: #0f172a !important;
}
body.light-theme .theme-opt-sub {
    color: #64748b !important;
}

/* ════════════════════════════════════════════════════════════
   COMPREHENSIVE MULTI-SCREEN & RESPONSIVE LAYOUT ENGINE
   ════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Large Screens (1440px - 1920px+) */
@media (min-width: 1440px) {
    .figma-app-wrapper {
        max-width: 1600px;
        margin: 95px auto 30px auto;
        padding: 0 32px;
    }
    .figma-chat-frame {
        height: calc(100dvh - 130px);
        min-height: 720px;
    }
}

/* Laptop & Medium Screens (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1024px) {
    .figma-app-wrapper {
        margin: 85px auto 20px auto;
        padding: 0 16px;
    }
    .figma-chat-frame {
        height: calc(100dvh - 110px);
        min-height: 650px;
    }
    .chat-sidebar {
        width: 290px;
    }
    .chat-details-sidebar {
        width: 280px;
    }
}

/* Tablets (768px - 1023px) */
@media (max-width: 1023px) {
    .chat-details-sidebar {
        position: fixed;
        right: 0;
        top: 80px;
        bottom: 0;
        width: 320px;
        z-index: 1050;
        box-shadow: -10px 0 30px rgba(0,0,0,0.8);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .chat-details-sidebar:not(.open) {
        transform: translateX(100%);
    }
    .figma-app-wrapper {
        margin: 80px auto 10px auto;
        padding: 0 12px;
    }
    .figma-chat-frame {
        height: calc(100dvh - 95px);
        border-radius: 14px;
        min-height: 580px;
    }
    .chat-sidebar {
        width: 270px;
    }
}

/* Mobile Phones (320px - 767px) */
@media (max-width: 767px) {
    .figma-app-wrapper {
        margin: 70px auto 0 auto;
        padding: 0 6px;
    }
    .figma-chat-frame {
        height: calc(100dvh - 78px);
        min-height: 500px;
        border-radius: 10px;
        border: none;
    }
    .chat-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 1100;
        box-shadow: 10px 0 30px rgba(0,0,0,0.9);
        transition: transform 0.28s ease;
    }
    .chat-sidebar:not(.mobile-open) {
        transform: translateX(-100%);
    }
    .chat-main-area {
        width: 100%;
        min-width: 0;
    }
    .main-chat-header {
        padding: 10px 12px;
        gap: 8px;
    }
    .header-user-name {
        font-size: 0.92rem;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .msg-group {
        max-width: 90%;
    }
    .msg-bubble {
        padding: 10px 14px;
        font-size: 0.88rem;
    }
    .chat-input-bar {
        padding: 10px 8px;
    }
    .input-container-pill {
        padding: 4px 8px;
    }
    .message-text-input {
        font-size: 0.88rem;
    }
    .user-profile-modal-card {
        width: 94vw !important;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Ultra Small Phones (< 380px) */
@media (max-width: 380px) {
    .header-user-name {
        max-width: 120px;
    }
    .header-avatar {
        width: 32px;
        height: 32px;
    }
    .send-submit-btn {
        width: 36px;
        height: 36px;
    }
}

/* ═══ VIP Remote Service Ticket Widget ═══ */
.msg-group.ticket-group {
    max-width: 520px !important;
    width: 100% !important;
}

.remote-ticket-card {
    background: linear-gradient(145deg, rgba(13, 20, 40, 0.98), rgba(7, 10, 22, 0.98));
    border: 1.5px solid #00f0ff !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 240, 255, 0.22), inset 0 0 15px rgba(0, 240, 255, 0.04) !important;
    padding: 18px 20px !important;
    max-width: 500px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    direction: rtl !important;
    text-align: right !important;
    font-family: 'Inter', 'Space Grotesk', 'Cairo', sans-serif !important;
    margin: 4px 0 !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease !important;
}

.remote-ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 240, 255, 0.35) !important;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.ticket-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: pulseDot 1.8s infinite;
}

/* ═════════════════════════════════════════════════════════════════════
   CHAT RULES & GUIDELINES SYSTEM
   ═════════════════════════════════════════════════════════════════════ */
/* Header Rules Icon Button */
.header-icon-btn.rules-icon-btn {
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #fbbf24 !important;
    transition: all 0.25s ease !important;
    position: relative;
}

.header-icon-btn.rules-icon-btn:hover {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
    transform: translateY(-1px) !important;
}

/* Sidebar Clean Rules Button */
.sidebar-rules-clean-wrap {
    margin: 12px 0 14px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.sidebar-rules-clean-btn {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 9px 14px !important;
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    border-radius: 10px !important;
    color: #fbbf24 !important;
    font-family: 'Cairo', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-sizing: border-box !important;
    direction: rtl !important;
}

.sidebar-rules-clean-btn:hover {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.35) !important;
    transform: translateY(-1px) !important;
}

.sidebar-rules-clean-btn .btn-content {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.sidebar-rules-clean-btn .arrow-icon {
    font-size: 0.75rem !important;
    color: rgba(251, 191, 36, 0.7) !important;
    transition: transform 0.2s ease !important;
}

.sidebar-rules-clean-btn:hover .arrow-icon {
    transform: translateX(-3px) !important;
    color: #ffffff !important;
}

/* Modal Popup Styles */
.chat-rules-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(3, 7, 18, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.25s ease;
    direction: rtl;
}

.chat-rules-modal-card {
    width: 100%;
    max-width: 630px;
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.98), rgba(9, 14, 26, 0.99));
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(245, 158, 11, 0.2);
    overflow: hidden;
    position: relative;
    color: #f1f5f9;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-rules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), transparent);
}

.chat-rules-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-rules-shield-glow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fbbf24;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    flex-shrink: 0;
}

.chat-rules-title {
    font-family: 'Cairo', 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 3px 0;
}

.chat-rules-subtitle {
    font-family: 'Cairo', 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

.chat-rules-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.chat-rules-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
    transform: rotate(90deg);
}

.chat-rules-body {
    padding: 14px 20px;
    max-height: 72vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.chat-rule-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 9px 12px;
    transition: all 0.2s ease;
}

.chat-rule-box:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(245, 158, 11, 0.35);
    transform: translateX(-3px);
}

.chat-rule-box.rule-box-highlight {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
}

.chat-rule-num-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.num-red { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.num-orange { background: rgba(249, 115, 22, 0.15); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); }
.num-yellow { background: rgba(234, 179, 8, 0.15); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.3); }
.num-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.num-alert { background: rgba(220, 38, 38, 0.2); color: #ef4444; border: 1px solid rgba(220, 38, 38, 0.5); box-shadow: 0 0 10px rgba(220, 38, 38, 0.3); }

.chat-rule-info h4 {
    font-family: 'Cairo', 'Space Grotesk', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 3px 0;
}

.chat-rule-info p {
    font-family: 'Cairo', 'Inter', sans-serif;
    font-size: 0.77rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

.chat-rules-warning-strip {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.warning-counter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.warning-txt {
    font-family: 'Cairo', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #fca5a5;
}

.chat-rules-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
}

.chat-rules-agree-btn {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000000;
    font-family: 'Cairo', 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
    transition: all 0.25s ease;
}

.chat-rules-agree-btn:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 6px 28px rgba(245, 158, 11, 0.55);
    transform: translateY(-2px);
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@media (max-width: 600px) {
    .rules-banner-text {
        font-size: 0.75rem;
    }
    .rules-banner-link-btn {
        font-size: 0.7rem;
        padding: 2px 7px;
    }
    .header-rules-badge-btn span {
        display: none;
    }
    .header-rules-badge-btn {
        padding: 5px 8px;
    }
    .chat-rules-modal-card {
        max-height: 90vh;
    }
}



