/**
 * File: assets/css/ejs-latest-comments-widget.css
 * Description: Styles for EJS Latest Comments Widget - New Classes Version
 * @package EmulatorJS
 * @since 1.0.0
 */

.ejs-latest-comments-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Comment Item - New Layout */
.ejs-widget-comment-item {
    padding: 10px;
    transition: all 0.3s ease;
    position: relative;
    background: #f7f8f9;
    border-radius: 10px;
}

/* Comment Header - Avatar next to username */
.ejs-widget-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ejs-widget-commenter-name {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ejs-widget-commenter-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ejs-widget-commenter-name a:hover {
    color: #007cba;
}

/* Small Avatar - 20x20 */
.ejs-widget-comment-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
}

.ejs-widget-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ejs-widget-comment-avatar:hover img {
    transform: scale(1.1);
}

/* Comment Context */
.ejs-widget-comment-context {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 12px;
}

.ejs-widget-comment-context i {
    font-size: 10px;
}

.ejs-widget-comment-context a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ejs-widget-comment-context a:hover {
    color: #007cba;
}

/* Context-specific styling */
.ejs-widget-comment-item[data-context="media"] .ejs-widget-comment-context {
    background: #e3f2fd;
    color: #1976d2;
}

.ejs-widget-comment-item[data-context="wall"] .ejs-widget-comment-context {
    background: #f3e5f5;
    color: #7b1fa2;
}

.ejs-widget-comment-item[data-context="game"] .ejs-widget-comment-context {
    background: #e8f5e8;
    color: #388e3c;
}

.ejs-widget-comment-item[data-context="post"] .ejs-widget-comment-context {
    background: #fff3e0;
    color: #f57c00;
}

/* Comment Content */
.ejs-widget-comment-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ejs-widget-comment-excerpt {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ejs-widget-comment-excerpt a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ejs-widget-comment-excerpt a:hover {
    color: #333;
}

/* Comment Meta */
.ejs-widget-comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 11px;
    color: #999;
    margin-top: auto;
}

.ejs-widget-comment-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.ejs-widget-comment-meta i {
    width: 10px;
    height: 10px;
    font-size: 10px;
    flex-shrink: 0;
}

.ejs-widget-comment-date i {
    color: #28a745;
}

.ejs-widget-comment-on i {
    color: #6c757d;
}

.ejs-widget-comment-on a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ejs-widget-comment-on a:hover {
    color: #007cba;
}

/* Loading Animation */
.ejs-latest-comments-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ejs-latest-comments-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Widget in sidebar */
.widget-area .ejs-latest-comments-widget,
.sidebar .ejs-latest-comments-widget {
    margin-bottom: 30px;
}

/* Admin widget form styling */
.widget-content .ejs-latest-comments-widget select[multiple] {
    height: 80px;
}

.widget-content .ejs-latest-comments-widget small {
    font-style: italic;
    color: #666;
    display: block;
    margin-top: 5px;
}

/* Special styling for no comments state */
.ejs-latest-comments-container:empty::after {
    content: 'No recent comments found.';
    display: block;
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

/* Accessibility improvements */
.ejs-widget-commenter-name a:focus,
.ejs-widget-comment-context a:focus,
.ejs-widget-comment-excerpt a:focus,
.ejs-widget-comment-on a:focus {
    outline-offset: 2px;
    border-radius: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .ejs-latest-comments-widget {
        border: 2px solid #000;
    }
    
    .ejs-widget-comment-item {
        border-bottom-color: #000;
    }
    
    .ejs-widget-commenter-name a,
    .ejs-widget-comment-context a,
    .ejs-widget-comment-excerpt a,
    .ejs-widget-comment-on a {
        text-decoration: underline;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .ejs-widget-comment-item {
        transition: none;
    }
    
    .ejs-widget-comment-avatar img {
        transition: none;
    }
    
    .ejs-widget-commenter-name a,
    .ejs-widget-comment-context a,
    .ejs-widget-comment-excerpt a,
    .ejs-widget-comment-on a {
        transition: none;
    }
    
    .ejs-latest-comments-container.loading::after {
        animation: none;
    }
}