        /* Profile Image */
.profile-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.profile-img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.3);
    transition: all 0.4s ease;
}

.profile-container:hover .profile-img {
    border-color: #ff006e;
    box-shadow: 0 0 20px rgba(255,0,110,0.5);
    transform: scale(1.1);
}

/* Dark Mode Base */
.dark .bg-info{
        background-color: rgb(153 35 185 / 66%) !important;
}
/* Dark Mode */
html.dark body,
.dark body {
    background: linear-gradient(135deg, #2a24e6 0%, #8d20d7 50%, #090575 100%);
    color: #252424ff !important;
    transition: all 0.4s ease !important;
}
.dropdown-item{
    color:white!important;
}
.dark .dropdown-item{
    color:white!important;
}
.dark .hero-banner
{
    position: relative;
    background: linear-gradient(135deg, 
        rgba(116, 128, 127, 0.53), 
        rgba(231, 188, 188, 0.85)5)!important;
    backdrop-filter: blur(1px);
}
.snow-toggle {
    border: none !important;
    background: rgba(255,193,7,0.2) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.fa-blink {
    animation: blink 1s infinite;
}

.btn.active {
    background: rgba(255,193,7,0.6) !important;
    box-shadow: 0 0 15px rgba(255,193,7,0.5);
}

.snow-toggle:hover {
    background: rgba(255,193,7,0.4) !important;
    transform: scale(1.1);
}

.dark .navbar {
    background: rgb(201 68 196 / 98%) !important;
    backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(170, 151, 151, 0.1);
}

.dark .card,
.dark .glass-card {
    background: rgba(30, 30, 50, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e0e0e0 !important;
    backdrop-filter: blur(20px);
}
.dark .search-dropdown{
    width : fit-content !important;
    color: #000000ff !important;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    background: #6c0036;
}
.dark .nav-link {

    color: #000000ff !important;
}

.dark .nav-link:hover {
    color: #ffd700 !important;
}
.dark .text-white{
        --bs-text-opacity: 1;
    color: #000000ff !important;
}
.dark .text-muted {
    color: #a0a0a0 !important;
}

.dark .btn-outline-primary {
    color: #4dabf7 !important;
    border-color: #4dabf7 !important;
}

.dark .btn-outline-primary:hover {
    background: #4dabf7 !important;
    color: #000 !important;
}

.dark .date-display {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffd700 !important;
}

/* وضعیت badges */
.status-ongoing { background: #ffc107; color: #000; }
.status-completed { background: #4caf50; }
.status-chinese { background: #ff5722; }
.status-upcoming { background: #2196f3; }
.status-cancelled { background: #f44336; }
.status-hiatus { background: #9e9e9e; }

/* ترند + ویژه */
.trending-badge, .featured-badge {
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
}

.dark .profile-img {
    border-color: rgba(255, 215, 0, 0.4) !important;
}
.glass-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.shadow-2xl {
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.text-white-75 { color: rgba(255,255,255,0.75) !important; }
.text-white-50 { color: rgba(255,255,255,0.5) !important; }
.info-card {
    backdrop-filter: blur(20px); background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2); border-radius: 20px;
}
.info-item { margin-bottom: 1rem; color: rgba(255,255,255,0.9); }
.info-item strong { color: white; }
.device-item { padding: 0.75rem; margin-bottom: 0.5rem; background: rgba(255,255,255,0.05); border-radius: 10px; }
/* Force footer زیر دکمه */
footer, 
.footer, 
.footer-container,
[class*="footer"],
.bottom-fixed {
    z-index: 1 !important;
    position: relative !important;
}

/* Navbar هم */
.navbar {
    z-index: 1000 !important;
}

/* Chat همیشه بالا */
#chat-toggle-btn,
#chat-sidebar {
    z-index: 2147483647 !important;
    position: fixed !important;
    background:black;
}

/* Chat Button */
#chat-toggle-btn {
    bottom: 30px;
    left: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
     border-radius: 50%;
}

#chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.7);
}

#chat-toggle-btn:active {
    transform: scale(0.95);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 8px 50px rgba(102, 126, 234, 0.8);
    }
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 3px solid #000;
}

/* Chat Sidebar */
#chat-sidebar {
    top: 0;
    left: -450px;
    width: 450px;
    height: 100vh;
    background: rgba(20, 20, 35, 0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
}

#chat-sidebar.open {
    left: 0;
}

.chat-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.chat-sidebar-header h4 {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff4757;
}

/* Chat Search */
.chat-search {
    position: relative;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-search input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.chat-search input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.chat-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-search i {
    position: absolute;
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

/* Chat Users List */
.chat-users-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.chat-users-list::-webkit-scrollbar {
    width: 6px;
}

.chat-users-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-users-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-user-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-user-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.chat-user-item.active {
    background: rgba(102, 126, 234, 0.3);
    border-right: 3px solid #667eea;
}

.chat-user-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    margin-left: 15px;
    flex-shrink: 0;
}

.chat-user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.chat-user-unread {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid rgba(20, 20, 35, 1);
}

.chat-user-info {
    flex: 1;
    min-width: 0;
}

.chat-user-name {
    color: white;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-user-name .staff-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.chat-user-last-message {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-user-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    margin-right: 10px;
}

.chat-loading {
    text-align: center;
    padding: 50px;
    color: rgba(255, 255, 255, 0.5);
}

/* Chat Overlay */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2147483646;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chat-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Chat Room Container */
.chat-room-container {
    position: fixed;
    top: 0;
    left: 450px;
    width: calc(100vw - 450px);
    height: 100vh;
    background: url('/static/img/bg-chat.jpg') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    z-index: 2147483647 !important;
}

.chat-room-header {
    padding: 20px;
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-message-avatar img{
    height: 70px;
    width: 70px;
    border-radius: 45px;
}
.chat-room-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.chat-room-user-info img{
    height: 150px;
    width: 200px;
    border-radius: 45px;
}

@media (max-width: 640px) {
    .chat-message-content {
        max-width: 85%;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.sent {
    /*  flex-direction: row-reverse;  ✅ sender راست */
    justify-content: flex-end;
}

.chat-message.received {
   /*  flex-direction: row;          ✅ receiver چپ */
    justify-content: flex-start;
}

.chat-room-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.chat-room-user-details h5 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.status-online {
    display: inline-block;
    font-size: 12px;
    color: #4cd137;
    margin-top: 3px;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(20, 20, 35, 0.95);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-end;
}



.chat-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-message.sent .chat-message-avatar {
    margin-left: 10px;
}

.chat-message.received .chat-message-avatar {
    margin-right: 10px;
}

.chat-message-content {
    max-width: 60%;
    padding: 12px 16px;
    border-radius: 20px;
}

.chat-message.sent .chat-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    direction: rtl;
    border-radius: 20px 20px 5px 20px;
}

.chat-message.received .chat-message-content {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 20px 20px 20px 5px;
}

.chat-message-text {
    word-wrap: break-word;
    line-height: 1.5;
}

.chat-message-time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
}

/* Chat Input Area */
.chat-input-area {
    padding: 20px;
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#chat-form {
    display: flex;
    gap: 10px;
}

#chat-message-input {
    flex: 1;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

#chat-message-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

#chat-message-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-send-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    #chat-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .chat-room-container {
        left: 0;
        width: 100vw;
    }
    
    #chat-toggle-btn {
        bottom: 20px;
        left: 20px;
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}
/* ✅ دکمه حذف - درست شده */
.message-delete-btn {
    opacity: 0;
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc2626 !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    color: white !important;
    font-size: 11px !important;
    z-index: 20 !important;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1) !important;
    box-shadow: 0 2px 10px rgba(220,38,38,0.4) !important;
}

.message-deletable:hover .message-delete-btn {
    opacity: 1 !important;
    transform: scale(1) !important;
}

.message-delete-btn:hover {
    background: #b91c1c !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 15px rgba(220,38,38,0.6) !important;
}

/* message-content relative */
.chat-message-content,
.message-content {
    position: relative !important;
}
.chat-message-content {
    position: relative !important;
}

.delete-btn-chat {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3) !important;
}

.delete-btn-chat:hover {
    background: #b91c1c !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(220,38,38,0.5) !important;
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.fa-blink {
    animation: blink 1s infinite;
}



/* ترند + ویژه */
.trending-badge, .featured-badge {
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
}

/* ✅ موبایل responsive */
@media (max-width: 768px) {
    .chat-message-content {
        min-height: 50px;
        cursor: pointer !important;
    }
    
    .delete-btn-chat {
        display: none !important;  /* پیش‌فرض مخفی */
        width: 28px !important;
        height: 28px !important;
        top: 2px !important;
        right: 2px !important;
        font-size: 12px !important;
    }
    
    /* long press بعد ظاهر */
    .chat-message-content:active .delete-btn-chat,
    .chat-message-content[pressed] .delete-btn-chat {
        display: flex !important;
        opacity: 1 !important;
    }
}

/* ✅ دکمه بزرگ‌تر موبایل */
@media (hover: none) and (pointer: coarse) {
    .delete-btn-chat {
        min-width: 32px !important;
        min-height: 32px !important;
    }
}