/* Messaging Page Styles */

.nav-item-active {
    color: #000 !important;
    position: relative;
}

.nav-item-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 2px;
    background-color: #000;
}

.messaging-container {
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    height: calc(100vh - 52px);
    margin-top: 52px;
    background-color: #ffffff;
}

/* Conversations Sidebar */
.conversations-sidebar {
    border-right: 1px solid #0000001f;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.conversations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #0000001f;
}

.conversations-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.conversations-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #00000099;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #f3f2ef;
}

.icon-btn i {
    font-size: 16px;
}

.conversations-search {
    position: relative;
    padding: 8px 16px;
    border-bottom: 1px solid #0000001f;
}

.conversations-search i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #00000099;
    font-size: 14px;
}

.conversations-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background-color: #eef3f8;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

.conversations-search input:focus {
    outline: none;
    background-color: #fff;
    box-shadow: inset 0 0 0 1px #0a66c2;
}

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

.conversation-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #0000000d;
    transition: background-color 0.2s;
}

.conversation-item:hover {
    background-color: #f3f2ef;
}

.conversation-item.active {
    background-color: #e8f3ff;
    border-left: 2px solid #0a66c2;
}

.conversation-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.conversation-header h4 {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    font-size: 12px;
    color: #00000099;
}

.conversation-preview {
    font-size: 13px;
    color: #00000099;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-other-conversations {
    padding: 16px;
    text-align: center;
    color: #00000099;
    font-size: 13px;
    font-style: italic;
}

/* Message Thread */
.message-thread {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.message-thread-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid #0000001f;
    background-color: #ffffff;
}

.thread-header-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.thread-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.thread-header-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.thread-status {
    font-size: 12px;
    color: #057642;
    font-weight: 500;
}

.thread-header-actions {
    display: flex;
    gap: 8px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: #f9fafb;
}

.message-date {
    text-align: center;
    color: #00000099;
    font-size: 12px;
    font-weight: 600;
    margin: 24px 0 16px;
}

.message {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    max-width: 70%;
}

.message.sent {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message.received {
    margin-right: auto;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message.sent .message-avatar {
    display: none;
}

.message-bubble {
    background-color: #ffffff;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.sent .message-bubble {
    background-color: #0a66c2;
    color: white;
}

.message-bubble p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.message-input-container {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #0000001f;
    background-color: #ffffff;
    align-items: flex-end;
}

.message-input-wrapper {
    flex: 1;
    background-color: #ffffff;
    border: 1px solid #00000026;
    border-radius: 24px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: border-color 0.2s;
}

.message-input-wrapper:focus-within {
    border-color: #0a66c2;
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 4px 0;
    font-family: inherit;
}

.message-input-actions {
    display: flex;
    gap: 4px;
}

.send-btn {
    background-color: #0a66c2;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: #004182;
}

.send-btn:disabled {
    background-color: #00000026;
    cursor: not-allowed;
}

.send-btn i {
    font-size: 16px;
}

/* Right Sidebar Info */
.message-info-sidebar {
    border-left: 1px solid #0000001f;
    padding: 24px;
    overflow-y: auto;
    background-color: #ffffff;
}

.info-profile {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #0000001f;
}

.info-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
}

.info-profile h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-profile p {
    font-size: 14px;
    color: #00000099;
    margin-bottom: 16px;
}

.view-profile-btn {
    display: inline-block;
    padding: 8px 24px;
    background-color: transparent;
    border: 1px solid #0a66c2;
    color: #0a66c2;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.view-profile-btn:hover {
    background-color: #e8f3ff;
    border-width: 2px;
}

.info-section {
    padding: 24px 0;
    border-bottom: 1px solid #0000001f;
}

.info-section:last-child {
    border-bottom: none;
}

.info-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.info-item {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item i {
    color: #00000099;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.info-text {
    font-size: 14px;
    color: #00000099;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .message-info-sidebar {
        display: none;
    }

    .messaging-container {
        grid-template-columns: 320px 1fr;
    }
}

@media (max-width: 768px) {
    .messaging-container {
        grid-template-columns: 1fr;
    }

    .conversations-sidebar {
        display: none;
    }

    .message {
        max-width: 85%;
    }
}
