/* United We Rise - Messaging System Styles */

/* ========================================
   MESSAGE ALIGNMENT SYSTEM
======================================== */

/* Admin Dashboard Messages */
.message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    clear: both;
}

.message.from-admin {
    background: #4b5c09;
    color: white;
    margin-left: auto;
    margin-right: 0;
    text-align: right;
    border-bottom-right-radius: 5px;
}

.message.from-candidate {
    background: #f1f1f1;
    color: #333;
    margin-left: 0;
    margin-right: auto;
    text-align: left;
    border-bottom-left-radius: 5px;
}

/* Candidate Profile Messages */
.candidate-message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    clear: both;
}

.candidate-message.from-admin {
    background: #f1f1f1;
    color: #333;
    margin-left: 0;
    margin-right: auto;
    text-align: left;
    border-bottom-left-radius: 5px;
}

.candidate-message.from-candidate {
    background: #4b5c09;
    color: white;
    margin-left: auto;
    margin-right: 0;
    text-align: right;
    border-bottom-right-radius: 5px;
}

.message-header {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 10px;
}

.message-content {
    font-size: 14px;
    line-height: 1.4;
}

/* ========================================
   MESSAGES CONTAINER
======================================== */

.messages-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    max-height: 400px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
}

.messages-header {
    background: #4b5c09;
    color: white;
    padding: 0.75rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messages-body {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.conversation-item {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.conversation-item:hover {
    background: #f5f5f5;
}

.conversation-item:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4b5c09;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.conversation-info {
    flex: 1;
}

.conversation-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.conversation-preview {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   USER PROFILE PANEL
======================================== */

.profile-panel {
    position: fixed;
    top: 65px;
    right: 20px;
    width: 350px;
    max-height: 80vh;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 998;
    display: none;
    overflow-y: auto;
}

.profile-header {
    background: #4b5c09;
    color: white;
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-body {
    padding: 1rem;
}

.profile-section {
    margin-bottom: 1.5rem;
}

.profile-section h3 {
    margin: 0 0 0.5rem 0;
    color: #4b5c09;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
}

/* ========================================
   NOTIFICATION BADGE
======================================== */

.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d32f2f;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}