/**
 * File: assets/css/ejs-friends.css
 * Description: Styles for friends module in EmulatorJS.
 * @package EmulatorJS
 * @since 1.0.0
 */

.ejs-friends-widget {
    border-radius: 5px;
}

.ejs-friends-widget .no-found {
	background: #fff;
	padding: 10px;
}

.ejs-friends-widget .ejs-friend-item {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.ejs-friends-page .no-found {
    background: #fff;
}

.ejs-friends-search-form,
.ejs-friends-list,
.ejs-friends-search-results {
    margin-bottom: 10px;
}

.ejs-friends-search-form {
    display: flex;
    gap: 10px;
}

.ejs-friends-search-form input {
    flex: 1;
    padding: 8px;
    border: 1px solid #000 !important;
    border-radius: 5px !important;
    font-size: 14px;
    background: #fff !important;
}

.ejs-friends-search-form button {
    padding: 8px 16px;
    background: #dd2020;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.ejs-friends-search-form button:hover {
    background: #333;
}

.ejs-friends-list,
.ejs-notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ejs-notification-list {
    background: #f7f8f9;
    border-radius: 5px;
}

.ejs-friend-item,
.ejs-notification-item, .ejs-friend-search-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    animation: fadeIn 0.5s ease-in;
    background: #fff;
    border-radius: 5px;
    min-height: 46px;
    margin-bottom: 5px;
	flex-wrap: wrap;
}

.ejs-friend-item:last-child,
.ejs-notification-item:last-child {
    border-bottom: none;
}

.ejs-friend-avatar,
.ejs-notification-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
	vertical-align: top;
}

@media (max-width: 767px) {
    .ejs-friend-avatar,
    .ejs-notification-avatar {
        width: 24px;
        height: 24px;
    }
}

.ejs-friend-info,
.ejs-notification-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ejs-friend-name-status,
.ejs-notification-message {
    display: flex;
    align-items: center;
    gap: 8px;
	line-height: 1;
	font-size: 14px;
}

.ejs-friend-name {
    font-weight: 700;
	font-size: 14px;
}

.ejs-friend-status,
.ejs-notification-timestamp,
.ejs-current-activity {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.ejs-friend-actions,
.ejs-notification-actions {
    display: flex;
    gap: 5px;
}

.ejs-profile-avatar-actions .ejs-friend-actions {
    margin-left: 0;
}

.ejs-friend-actions button,
.ejs-notification-actions button:not(.ejs-mark-all-read-btn),
.ejs-message-actions button:not(.ejs-send-message-btn) {
    padding: 5px;
    border: none;
	width: 31px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.ejs-mark-all-read-btn {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    background: var(--wp--preset--color--base);
    color: #333;
    border-bottom: 1px solid var(--wc-content-bg) !important;	
    margin-left: 20px;
	font-size: 12px;
	border-radius: 5px;
	padding: 5px 10px;
}

.ejs-mark-all-read-btn:hover {
	background: #333;
}

.ejs-add-friend-btn,
.ejs-accept-btn {
    background: #007bff;
    color: #fff;
}

.ejs-add-friend-btn:hover,
.ejs-accept-btn:hover {
    background: #0056b3;
}

.ejs-unfriend-btn,
.ejs-reject-btn {
    background: #dc3545;
    color: #fff;
}

.ejs-unfriend-btn:hover,
.ejs-reject-btn:hover {
    background: #c82333;
}

.ejs-block-btn {
    background: #6c757d;
    color: #fff;
}

.ejs-block-btn:hover {
    background: #5a6268;
}

.ejs-unblock-btn,
.ejs-mark-read-btn {
    background: #28a745;
    color: #fff;
}

.ejs-unblock-btn:hover,
.ejs-mark-read-btn:hover {
    background: #218838;
}

.ejs-message-btn {
    background: #6c757d;
    color: #fff;
}

.ejs-friends-wait-list {
    border: 2px dashed #6c757d;
}

.ejs-friends-wait-list,
.ejs-friends-list-section,
.ejs-blocked-users,
.ejs-friends-search,
.ejs-friend-suggestions {
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 20px;
    padding: 20px;
}

.ejs-friends-wait-list,
.ejs-friends-list-section,
.ejs-blocked-users {
    min-height: 135px;
}

.ejs-notification-center {
    margin-bottom: 20px;
}

.ejs-profile-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.ejs-profile-actions button {
    padding: 3px 5px;
    border: none;
	width: 24px;
	height: 24px;
    border-radius: 5px;
    cursor: pointer;
    background: #f8f9fa;
    color: #6c757d;
	font-size: 12px;
}

.ejs-profile-actions .ejs-unfriend-btn {
    color: #fff;
	background: #dc3545;
}

.ejs-profile-actions .ejs-unfriend-btn:hover {
    background: #dc3545;
    color: #fff;
}

.ejs-profile-actions .ejs-add-friend-btn,
.ejs-profile-actions .ejs-unblock-btn {
    background: #007bff;
    color: #fff;
}

.ejs-profile-actions .ejs-add-friend-btn:hover,
.ejs-profile-actions .ejs-unblock-btn:hover {
    background: #0056b3;
}

.ejs-profile-actions .ejs-cancel-request-btn {
    background: #6c757d;
    color: #fff;
}

.ejs-profile-actions .ejs-cancel-request-btn:hover {
    background: #5a6268;
}

.ejs-profile-actions .ejs-block-btn {
    background: #6c757d;
    color: #fff;
}

.ejs-profile-actions .ejs-block-btn:hover {
    background: #5a6268;
}

.ejs-profile-actions .ejs-message-btn {
    background: #6c757d;
    color: #fff;
}

.ejs-notification-anchor {
    position: relative;
}

.ejs-profile-header-meta {
    display: flex;
    flex-direction: column;
}

/* Đảm bảo username không có margin */
.ejs-profile-username {
    margin: 0;
    flex: 1;
}

/* Profile actions nằm bên phải */
.ejs-profile-actions {
    margin-bottom: 0;
    flex-shrink: 0;
}

.ejs-profile-username-actions {
    display: flex;
    margin-bottom: 10px;
    flex-direction: column-reverse;
    gap: 7px;
}

.ejs-notification-anchor {
	color: #333;
}

.ejs-notification-anchor .ejs-notification-count {
    min-width: 18px;
    height: 18px;
    background: #ff4444;
    color: #fff;
    border-radius: 9px;
    font-size: 10px;
    position: absolute;
    top: -9px;
    left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-align: center;
    border: 2px solid #fff;
    padding: 0px 3px 0 3px;
    white-space: nowrap;
    box-sizing: border-box;
}

.ejs-notification-item.read {
    opacity: 0.7;
}

.ejs-friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ejs-friends-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
}

.ejs-profile-header {
    position: relative;
    display: flex;
    gap: 20px;
}

/* Container cho avatar */
.ejs-profile-avatar-container {
    position: relative;
    display: inline-block;
}

/* Đặt buttons ở bottom center của avatar */
.ejs-profile-avatar-actions {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Giữ nguyên tất cả style buttons hiện tại của bạn */
.ejs-profile-avatar-actions .ejs-profile-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 0;
    background: #f7f8f9;
    justify-content: center;
    padding: 5px;
    border-radius: 5px;
}

.ejs-friends-show-all {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px !important;
    font-size: 14px;
	height: 28px;
    text-decoration: none;
    border-radius: 5px;
	line-height: 1;
    background: #f0f0f0;
    color: #666;
    transition: all 0.3s ease;
}

.ejs-friends-show-all:hover {
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
}

.ejs-friends-show-all i {
    font-size: 10px;
}

/* Animation cho highlighted comment content */
.ejs-comment-content.highlighted {
    border: 2px dashed #333 !important;
    border-radius: 1rem !important;
    padding: 10px !important;
    background-color: #fff3cd !important;
    position: relative !important;
    animation: pulseHighlight 2s ease-in-out !important;
}

@keyframes pulseHighlight {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Smooth transition */
.ejs-comment-content {
    transition: all 0.3s ease;
}

.ejs-notification-message {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Main notification text */
.ejs-notification-text {
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 6px;
    line-height: 1.4;
    display: block; /* Force block layout */
}

.ejs-notification-info a .ejs-notification-text {
	text-decoration: underline;
}

/* Comment preview - positioned below main text */
.ejs-notification-preview {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin-top: 6px;
    margin-bottom: 4px;
    padding: 6px 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    line-height: 1.4;
    display: block; /* Ensure it's below, not beside */
    width: 100%;
    box-sizing: border-box;
}

/* Animation for new notifications */
.ejs-notification-item.unread .ejs-notification-preview {
    animation: fadeInPreview 0.3s ease-in-out;
}

@keyframes fadeInPreview {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects */
.ejs-notification-link:hover {
    text-decoration: none;
}

.ejs-notification-link:hover .ejs-notification-text {
    color: #0073aa;
}

.ejs-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.ejs-status-dot.online { background-color: #28a745; }
.ejs-status-dot.idle { background-color: #ffc107; }
.ejs-status-dot.offline { background-color: #dc3545; }

.ejs-notification-count.ejs-notification-pulse {
    animation: notification-pulse 0.5s ease-in-out;
}

@keyframes notification-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@media (max-width: 425px) {
    .ejs-friend-item {
        display: flex;
        gap: 10px;
        padding: 10px;
        flex-wrap: nowrap;
    }

    .ejs-friend-avatar {
        flex-shrink: 0;
    }

    .ejs-friend-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 5px;
        min-width: 0;
    }

    .ejs-friend-name-status {
        order: 1;
        line-height: 1.2;
        margin: 0;
    }

    .ejs-friend-name {
        font-weight: 700;
        font-size: 14px;
        max-width: 150px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .ejs-friend-status {
        order: 2;
        font-size: 12px;
        color: #666;
        font-style: italic;
        line-height: 1.2;
        margin: 0;
    }
}