:root {
    --primary: #3b82f6;
    --primary-light: #1a2552;
    --primary-dark: #060c24;
    --secondary: #e6e9f2;
    --text-light: #f8f9fa;
    --text-dark: #343a40;
    --status-sent: #a9a9a9;
    --status-delivered: #1a2552;
    --status-read: #f8f9fa;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}



/* Main Chat Area */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--border-color);
    position: relative;
}

.chat-header {
    background-color: var(--primary);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
}

.chat-header .contact-avatar {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.chat-header .contact-name {
    font-weight: 500;
}

.messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%230b1437' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.message {
    max-width: 70%;
    margin-bottom: 15px;
    position: relative;
    clear: both;
}

.message-content {
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
}

.message-text {
    margin-bottom: 5px;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.7rem;
    color: #777;
    text-align: right;
    margin-top: 2px;
}

.message-status {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.7rem;
}

.status-sent {
    color: var(--status-sent);
}

.status-delivered {
    color: var(--status-delivered);
}

.status-read {
    color: var(--status-read);
}

.message-incoming {
    float: left;
}

.message-incoming .message-content {
    background-color: white;
    color: var(--text-dark);
}

.message-outgoing {
    float: right;
}

.message-outgoing .message-content {
    background-color: var(--primary-light);
    color: white;
}

.message-file {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.message-file-icon {
    margin-right: 10px;
    font-size: 1.5rem;
}

.message-file-info {
    flex: 1;
}

.message-file-name {
    font-weight: 500;
    margin-bottom: 2px;
    word-break: break-all;
}

.message-file-size {
    font-size: 0.7rem;
    opacity: 0.7;
}

.message-actions {
    position: absolute;
    right: 0;
    top: -20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: var(--shadow);
    display: none;
}

.message:hover .message-actions {
    display: block;
}

.message-action-btn {
    border: none;
    background: none;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-dark);
}

.message-action-btn:hover {
    color: var(--primary);
}

/* Input Area */
.input-container {
    padding: 15px;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    border-top: 1px solid #ddd;
}

.file-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 15px;
}

.message-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
}

.send-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: var(--primary-dark);
}

.file-input {
    display: none;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    background-color: var(--secondary);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.file-preview-info {
    flex: 1;
    margin-left: 10px;
}

.file-preview-name {
    font-weight: 500;
    margin-bottom: 2px;
    word-break: break-all;
}

.file-preview-size {
    font-size: 0.8rem;
    color: #777;
}

.file-preview-remove {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    padding: 5px;
}

.file-preview-remove:hover {
    color: #dc3545;
}



.search-container {
    padding: 10px;
    background-color: #f5f5f5;
}

.search-container input {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    background-color: white;
    outline: none;
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
}

.contact {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contact:hover {
    background-color: #f5f5f5;
}

.contact.active {
    background-color: var(--secondary);
}

.contact-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.contact-last-message {
    font-size: 0.8rem;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.sidebar-contacts {
    width: 300px;
    background-color: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-contacts {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-contacts .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.contact-admin {
    color: red;
}


.sidebar-contact {
    display: flex;
    justify-content: flex-end;
    width: 300px;
    background-color: white;
    border-right: 1px solid #ddd;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-contact .sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}   

.sidebar-contact .sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}   

.sidebar-contact .contacts-list {
    flex: 1;
    overflow-y: auto;
}   

.sidebar-contact .contact {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    transition: background-color 0.2s;
}      

.sidebar-contact .contact:hover {
    background-color: #f5f5f5;
}

.sidebar-contact .contact.active {
    background-color: var(--secondary);
}


