body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #0a3e97 !important;
    margin: 0;
    padding: 0;
    color: #333;
}
.container {
    max-width: 1400px;
    padding: 0 20px;
    max-height: 800px;
}
.chat-wrapper {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 700px;
}
.card {
    border: none;
    border-radius: 20px;
    height: 100%;
}
.chat-aside {
    background: #f9fafb;
    padding: 25px;
    height: 650px;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
}
.chat-content {
    padding: 25px;
    height: 650px;
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}
.chat-header p {
    margin: 0;
}
.chat-header #chatUserName {
    font-size: 20px;
    font-weight: 600;
    color: #1e3a8a;
}
.chat-header #chatUserRole {
    font-size: 14px;
    color: #6b7280;
}
.chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 0;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.chat-footer {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
}
.messages {
    list-style: none;
    padding: 0;
    margin: 0;
}
.message-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    position: relative;
}
.message-item.friend {
    justify-content: flex-start;
}
.message-item.me {
    justify-content: flex-end;
}
.message-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}
.message-item.me .avatar {
    margin-left: 10px;
    order: 2;
}
.message-item.friend .bubble {
    order: 2;
}
.message-item .bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    background: #e5e7eb;
    color: #1f2937;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    order: 1;
}
.message-item.me .bubble {
    background: rgb(158, 177, 241);
    color: white;
    order: 1;
}
.message-item .bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: inherit;
}
.message-item .bubble img,
.message-item .bubble video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 5px;
    border: 1px solid #d1d5db;
    object-fit: contain;
    cursor: pointer;
}
.message-item.pinned {
    background-color: #fef9c3;
    border-left: 4px solid #f59e0b;
    padding-left: 10px;
}
.message-item span {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
    display: block;
    text-align: right;
}
.message-item.me span {
    text-align: left;
}
.chat-list li {
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s ease;
}
.chat-list li:hover {
    background: #e0f2fe;
}
.form-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}
.form-section h2 {
    color: #1e3a8a;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 600;
}
.form-section label {
    font-weight: 600;
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}
.form-section input,
.form-section textarea,
.form-section select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    margin-bottom: 15px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    height: 45px;
}
.form-section textarea {
    height: auto;
    min-height: 100px;
}
.form-section input:focus,
.form-section textarea:focus,
.form-section select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.2);
}
.form-section button {
    background: #3b82f6;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}
.form-section button:hover {
    background: #2563eb;
}
.chat-footer .input-group {
    width: 100%;
}
.chat-footer .form-control {
    border-radius: 50px;
    border: 1px solid #d1d5db;
    padding: 12px 20px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.chat-footer .form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.2);
}
.chat-footer .btn-send {
    background-color: #3b82f6;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.chat-footer .btn-attach {
    background-color: rgb(177, 183, 192);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    margin-right: 10px;
}
.chat-footer .btn-send:hover,
.chat-footer .btn-attach:hover {
    background-color: #2563eb;
}
.chat-body::-webkit-scrollbar,
.chat-aside::-webkit-scrollbar {
    width: 8px;
}
.chat-body::-webkit-scrollbar-thumb,
.chat-aside::-webkit-scrollbar-thumb {
    background-color: #3b82f6;
    border-radius: 10px;
}
.delete-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -25px;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}
.message-item.me .delete-icon {
    left: -25px;
    right: auto;
}
.message-item:hover .delete-icon {
    opacity: 1;
}
.delete-icon:hover {
    color: #dc2626;
}
.unread-badge {
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}
.preview-message {
    font-style: italic;
    opacity: 0.7;
}
.preview-message img,
.preview-message video {
    opacity: 1;
}
.aside-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}
.status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #fff;
}
.status.online {
    background-color: #28a745;
}
.status.offline {
    background-color: #6c757d;
}
.img-sm {
    width: 43px;
    height: 43px;
    border-radius: 50%;
    object-fit: cover;
}
.img-xs {
    width: 37px;
    height: 37px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-tabs .nav-link {
    border: none;
    color: #6b7280;
}
.nav-tabs .nav-link.active {
    color: #1e3a8a;
    background: none;
    border-bottom: 2px solid #3b82f6;
}
.tab-content {
    margin-top: 15px;
}
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}
.dropdown-item {
    font-size: 14px;
    padding: 10px 15px;
}
.dropdown-item:hover {
    background-color: #e0f2fe;
}
#emojiPicker {
    position: absolute;
    bottom: 60px;
    left: 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    z-index: 1000;
    display: none;
    max-width: 600px;
}
.emoji-picker {
    position: absolute;
    bottom: 70px;
    left: 10px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    z-index: 1000;
    display: none;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
}
#emojiPicker span {
    font-size: 24px;
    margin: 5px;
    cursor: pointer;
    display: inline-block;
}
#emojiPicker span:hover {
    background: #e0f2fe;
    border-radius: 4px;
}
.message-options {
    position: absolute;
    top: 5px;
    right: 5px;
}
.message-item.me .message-options {
    left: 5px;
    right: auto;
}
.message-options-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    pointer-events: auto;
}
.message-options-btn:hover {
    color: #1e3a8a;
}
.dropdown-menu-right {
    right: 0;
    left: auto;
}
.message-item.me .dropdown-menu {
    left: 0;
    right: auto;
}
@media (max-width: 768px) {
    .chat-aside {
        height: 400px;
    }
    .chat-content {
        height: 450px;
    }
    .chat-header {
        text-align: left;
    }
    .delete-icon {
        opacity: 0.9;
        right: -15px;
    }
    .message-item.me .delete-icon {
        left: -15px;
    }
    .form-section {
        max-width: 100%;
    }
    .page-title {
        font-size: 2rem;
        text-align: center;
    }
    .container {
        margin-left: auto;
        margin-right: auto;
    }
    .chat-wrapper {
        height: 600px;
    }
    .message-options {
        top: 5px;
        right: 5px;
    }
    .message-item.me .message-options {
        left: 5px;
    }
}

#mediaModal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}
#mediaModal .close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}
#mediaModal .close:hover,
#mediaModal .close:focus {
    color: #bbb;
    text-decoration: none;
}
#mediaModal .modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    max-height: 80vh;
    object-fit: contain;
}
#vid01 {
    display: none;
}

#downloadBtn {
    position: absolute;
    top: 15px;
    left: 35px;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    z-index: 10001;
    transition: background 0.3s;
}
#downloadBtn:hover {
    background: #2563eb;
}
