/**
 * GNR Ranking Widget - Frontend Styles
 */

/* Reset list styles */
.gnr-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: ranking;
}

.gnr-ranking-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eee;
}

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

/* Link styling */
.gnr-ranking-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 5px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.gnr-ranking-link:hover {
    background-color: #f5f5f5;
}

/* Rank number */
.gnr-ranking-rank {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    background-color: #f0f0f0;
    border-radius: 4px;
}

/* Top 3 special styling */
.gnr-ranking-item--rank-1 .gnr-ranking-rank {
    background-color: #ffd700;
    color: #333;
}

.gnr-ranking-item--rank-2 .gnr-ranking-rank {
    background-color: #c0c0c0;
    color: #333;
}

.gnr-ranking-item--rank-3 .gnr-ranking-rank {
    background-color: #cd7f32;
    color: #fff;
}

/* Thumbnail */
.gnr-ranking-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 40px;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f0f0f0;
}

.gnr-ranking-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content area */
.gnr-ranking-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Title */
.gnr-ranking-title {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gnr-ranking-link:hover .gnr-ranking-title {
    color: #0066cc;
}

/* Views count */
.gnr-ranking-views {
    font-size: 11px;
    color: #999;
}

/* Error and empty states */
.gnr-ranking-error,
.gnr-ranking-empty {
    padding: 10px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.gnr-ranking-error {
    color: #c00;
    background-color: #fff0f0;
    border-radius: 4px;
}

/* Shortcode wrapper */
.gnr-ranking-shortcode {
    margin: 20px 0;
}

.gnr-ranking-shortcode-title {
    margin: 0 0 15px;
    padding: 0;
    font-size: 18px;
    font-weight: bold;
}

/* Widget specific adjustments */
.widget .gnr-ranking-list {
    font-size: 13px;
}

.widget .gnr-ranking-thumbnail {
    width: 50px;
    height: 35px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .gnr-ranking-link {
        padding: 8px 3px;
        gap: 8px;
    }
    
    .gnr-ranking-rank {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .gnr-ranking-thumbnail {
        width: 50px;
        height: 35px;
    }
    
    .gnr-ranking-title {
        font-size: 12px;
    }
}
