/**
 * File: assets/css/ejs-latest-posts-widget.css
 * Description: Styles for EJS Latest Posts Widget
 * @package EmulatorJS
 * @since 1.0.0
 */

/* Widget Container */
.ejs-latest-posts-widget,
.ejs-latest-comments-widget {
    background: #fff;
    padding: 0;
    overflow: hidden;
}

.ejs-latest-posts-widget .widget-title,
.ejs-latest-comments-widget .widget-title {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 15px;
    color: #333;
    padding-bottom: 8px;
}

.ejs-latest-posts-widget .widget-title {
	margin-bottom: 5px;
}

.ejs-latest-comments-container {
    padding-bottom: 10px;
}

/* Post Item */
.ejs-latest-post-item {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
    align-items: center;
}

/* Post Thumbnail */
.ejs-post-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

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

.ejs-post-thumbnail:hover img {
    transform: scale(1.05);
}

.ejs-no-thumbnail {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.ejs-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: background 0.3s ease;
}

.ejs-no-thumbnail:hover .ejs-thumbnail-placeholder {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Post Content */
.ejs-post-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ejs-post-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.ejs-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ejs-post-title a:hover {
    color: #007cba;
}

.ejs-post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Post Meta */
.ejs-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px;
    color: #999;
    margin-top: auto;
}

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

.ejs-post-meta i {
    width: 12px;
    height: 12px;
    font-size: 12px;
    flex-shrink: 0;
}

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

.ejs-post-author i {
    color: #6c757d;
}

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

.ejs-latest-posts-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-posts-widget,
.sidebar .ejs-latest-posts-widget {
    margin-bottom: 30px;
}

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

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