/* System Messages Styling */
.system-messages-section {
    margin-top: 25px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    border: 1px solid #f5f5f5;
    transition: transform 0.3s ease;
}

.system-messages-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.system-messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background-color: white;
    border-bottom: 1px solid #f0f0f0;
}

.system-messages-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    letter-spacing: 0.3px;
}

.system-messages-header h3 i {
    margin-right: 10px;
    color: #00CED1;
}

.system-messages-content {
    padding: 0;
}

.system-messages-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.message-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.message-item:last-child {
    border-bottom: none;
}

.message-item:hover {
    background-color: #fafafa;
}

.message-info {
    flex: 1;
}

.message-title {
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.message-preview {
    color: #777;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.message-time {
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
}

.message-actions {
    margin-left: 15px;
}

.view-message-btn {
    background-color: #00CED1;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-message-btn:hover {
    background-color: #00BCD4;
    transform: translateY(-2px);
}

.view-message-btn i {
    margin-right: 5px;
}

.no-messages {
    padding: 35px;
    text-align: center;
    color: #999;
    font-size: 0.95rem;
}

/* Message Popup Styling */
.message-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.message-popup-content {
    background-color: white;
    width: 90%;
    max-width: 600px;
    min-width: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    animation: popupFadeIn 0.3s ease;
    /* Prevent horizontal scroll, allow vertical expansion */
    word-break: break-word;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-popup-header {
    padding: 18px 20px;
    background-color: white;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.close-message-popup {
    font-size: 24px;
    cursor: pointer;
    color: #777;
    transition: color 0.2s;
}

.close-message-popup:hover {
    color: #333;
}

.message-popup-body {
    padding: 25px 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.message-title-full {
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    position: relative;
    padding-left: 18px;
}

.message-title-full::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    height: calc(100% - 10px);
    width: 4px;
    background-color: #00CED1;
    border-radius: 2px;
}

.message-content {
    color: #555;
    line-height: 1.7;
    white-space: pre-wrap;
    font-size: 0.95rem;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.message-timestamp {
    margin-top: 25px;
    color: #999;
    font-size: 0.85rem;
    text-align: right;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

@media (max-width: 600px) {
    .message-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 10px;
    }
    .message-info {
        width: 100%;
        min-width: 0;
    }
    .message-preview {
        max-width: 100%;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
        display: block;
    }
    .message-actions {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
    .view-message-btn {
        width: auto;
        min-width: 90px;
        font-size: 1rem;
        padding: 8px 10px;
    }
}