.room-icon {
    width: 20px;
    height: 16px;
    margin-right: 5px;
}

body {
    font-family: 'Cairo', 'Roboto', sans-serif;
    background-color: #e0e0e0;
    margin: 0;
    padding: 0;
    color: #1a1d21; 
}
body *:not(footer):not(footer *) {
    direction: rtl;
}

.reply-button {
    background: none;
    border: none;
    color: #007bff;
    font-size: 14px;
    cursor: pointer;
    margin-left: 5px;
    vertical-align: middle;
    padding: 2px 4px;
    transition: color 0.2s ease-in-out;
}

.reply-button:hover {
    color: #0056b3;
}

.chat-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    min-height: 90vh;
    padding: 10px 20px;
    background-color: #e8e8e8;
}
.chat-room {
    width: calc(70% - 25px);
    max-width: 875px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-right: 50px;
}
.chat-header {
    background-color: #1a1d21;
    color: #ffffff;
    padding: 10px;
    text-align: center;
    position: relative;
}
.chat-header img {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 50px;
    height: 50px;
}
.chat-header .notification-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
}

.notification-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: red;
    color: white;
    font-size: 14px;
    border-radius: 50%;
    padding: 5px 10px;
    display: none;
}


.notification-list {
    position: absolute;
    top: 30px;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 250px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    background-color: #f0f0f0;
    padding: 10px;

}

.notification-list p {
    margin: 5px 0;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    color: black;
    background-color: green;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    font-weight: bold;
}

.notification-list p:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

.notification-list p:last-child {
    border-bottom: none;
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: red;
    color: white;
    padding: 5px;
    border-radius: 50%;
    font-size: 12px;
    display: inline-block;
}



.messages {
    height: 445px;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    overflow-y: auto;
    max-width: 100%; 
    overflow-x: hidden; 

}
.message {
    margin-bottom: 1.5px;
    background-color: #f8f8f8;
    padding: 5px 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    font-size: 24px;
}
.message .user {
    font-weight: bold;
    display: block;
    margin-bottom: 1px;
    font-size: 16px;
}
.message .text {
    margin-top: 0;
    margin-left: 10px;
    font-size: 18px;
    word-wrap: break-word; 
    word-break: normal;
    overflow-wrap: break-word; 
    white-space: pre-wrap; 
    overflow-wrap: break-word; 
    max-width: 100%; 
    display: inline-block;
    box-sizing: border-box; 

}

.message img.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
}
.chat-input {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #e9e9e9;
}
.chat-input input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.chat-input button {
    padding: 10px 20px;
    border: none;
    background-color: #0011ff;
    color: #ffffff;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
}
.enter-room:hover, .visit-button:hover {
    background-color: #739b7a;
}
.chat-input button:hover {
    background-color: #1a1d21; 
}
.emoji-picker-button {
    cursor: pointer;
    margin-left: 10px;
}
.emoji-picker {
    position: absolute;
    bottom: -730px;
    left: 10px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    max-height: 200px;
    max-width: 850px;
    overflow-y: auto;
}

.emoji-picker span {
    font-size: 25px;
    cursor: pointer;
    margin: 5px;
}
.sidebar {
    width: 30%;
    max-height: 445px;
    padding: 10px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    background-color: #1a1d21;
    padding: 5px;
    border-radius: 5px;
}
.sidebar-header button {
    background-color: #1a1d21;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 10px 15px;
    flex: 1;
    font-size: 18px;
}
.sidebar-header button.active {
    background-color: #0011ff;
}
.user-list, .room-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    max-height: 300px;
    display: none;
    font-size: 18px;
}
.user-list li, .room-list li {
    padding: 5px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}
.user-list li img.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-left: 10px;
}

.user-list li a, .room-list li a {
    text-decoration: none;
    flex: 1;
}
.user-list li a:hover, .room-list li a:hover {
    text-decoration: underline;
}
.user-list li .options, .room-list li .enter-room {
    margin-left: 10px;
    cursor: pointer;
}
.visit-button {
    padding: 5px 10px;
    background-color: #0011ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: auto;
}

.visit-button:hover {
background-color: #1a1d21;
}

.search-container {
    margin: 10px 0;
}
.search-container input[type="text"] {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.room-status {
    display: flex;
    align-items: center;
    font-size: 14px;
}
.room-status .dot {
    height: 10px;
    width: 10px;
    background-color: green;
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
}
.room-name {
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.room-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.room-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.enter-room {
    padding: 5px 10px;
    background-color: #0011ff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 80px;
    white-space: nowrap; 

}
.enter-room:hover {
    background-color: #1a1d21;
}
.message-button {
    padding: 5px 10px;
    background-color: #ffc107; 
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.message-button i {
    font-size: 18px;
}

.message-button:hover {
    background-color: #e0a800;
}

.private-chat-window {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 300px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.private-chat-window .chat-header {
    background-color: #0011ff;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.private-chat-window .chat-messages {
    height: 200px;
    overflow-y: auto;
    padding: 10px;
}

.private-chat-window .chat-input {
display: flex;
align-items: center; 
justify-content: space-between; 
padding: 5px;
background-color: #e9e9e9;
}

.private-chat-window .chat-input input[type="text"] {
flex: 1; 
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
}

.private-chat-window .emoji-button-private, 
.private-chat-window .send-button-private {
background-color: transparent; 
border: none;
cursor: pointer;
font-size: 16px;
padding: 5px;
margin: 0;
outline: none;
}

.private-chat-window .send-button-private i {
font-size: 20px;
}

.private-chat-window .emoji-button-private {
font-size: 18px; 
}

.emoji-button-private {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px; 
    padding: 1px;
    margin: 0 5px;
    outline: none;
}

.send-button-private {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #0011ff; 
    padding: 5px;
    margin: 0 5px;
    outline: none;
}

.send-button-private i {
    color: #0011ff;
    pointer-events: none;
}

.send-button-private:hover {
    color: blue;
}
.private-chat-window .send-button-private:hover {
    background-color: #739b7a; 
}

.emoji-picker-private {
    position: absolute;
    bottom: 50px;
    left: 0;
    background-color: #ffffff;
    border: 1px solid #ddd;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    width: 200px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.emoji-picker-private span {
    cursor: pointer; 
    font-size: 18px;
    margin: 5px;
}

#private-message-input {
    resize: none; 
    overflow: hidden; 
    width: 100%; 
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 16px;
}


#message-input {
    resize: none; 
    overflow: hidden;
    width: 100%; 
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 16px;
}

 /*   .mobile-only-ad {
        display: none;
    }
        */

    /* ديزاين الهواتف */
@media (min-width: 320px) and (max-width: 850px) {
    .mobile-only-ad {
        display: block;
    }
    .chat-container {
        flex-direction: column-reverse; 
        align-items: center;
        justify-content: center; 
    }

    .chat-room {
        width: 98%; 
        max-width: 100%; 
        margin: 10px auto; 
    }

    .sidebar {
        width: 90%; 
        margin: 20px auto; 
        max-width: 100%; 
    }

    .user-list, .room-list {
        width: 100%; 
    }

    .user-list li, .room-list li {
        text-align: center; 
        justify-content: center; 
    }
}

@media (min-width: 320px) and (max-width: 850px) {
    .private-chat-window {
        width: 75%;
        height: 75vh; 
        right: 2.5%;
        border-radius: 12px;
        max-height: 80vh; 
        bottom: auto; 
        top: 10vh; 
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
                
    .private-chat-window .chat-header {
        font-size: 16px;
    }

    .private-chat-window .chat-messages {
        height: calc(80vh - 180px); 
        padding: 10px; 
        overflow-y: auto; 
    }

    .private-chat-window .chat-input {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
        width: 92%; 
        margin: auto; 
        background: #f9f9f9; 
        border-radius: 12px; 
        border: 1px solid #ddd; 
        box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1); 
        margin-bottom: 10px;
        padding-bottom: 10px;
        height: auto;
    }
        
    .private-chat-window .chat-input input[type="text"] {
        width: 65%; 
        margin-right: 5px;
        font-size: 14px;
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background: white; 
        display: inline-block; 
    }
    
    .private-chat-window .send-button-private {
        width: 25%; 
        margin-left: 5px; 
        padding: 8px;
        color: blue;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
    }

    .private-chat-window .emoji-button-private {
        font-size: 18px;
        margin-right: 5px; 
        cursor: pointer;
        background: none;
        border: none;
        color: #555;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .emoji-picker-private {
        transform: translateY(-150px); 
    }
    
    .private-chat-window .send-button-private:hover {
        background-color: transparent; 
    }
    
}

@media (min-width: 320px) and (max-width: 850px) {
    .chat-header {
        text-align: center; 
    }
    .chat-header .logo {
        width: 11%;  
        height: auto; 
        border-radius: 50%; 
    }
}

@media (min-width: 320px) and (max-width: 850px) {
    .chat-header {
        text-align: center; 
    }
    .chat-header .logo {
        width: 9%;  
        height: auto; 
        border-radius: 50%; 
    }
}

@media (min-width: 320px) and (max-width: 850px) {
    .message .text {
        font-size: 14px;
    }
}

@media (min-width: 320px) and (max-width: 850px) {
    .emoji-picker {
        position: static;
        margin-top: 10px;
        margin-left: 0;
        margin-right: 0;
    }

    .chat-input {
        flex-direction: column;
        align-items: stretch;
    }

    .emoji-picker-button {
        align-self: flex-end;
    }
}