/**
 * Homepage Ratings — TOP 100 Carousel + Cards
 * Split from homepage.css for performance
 *
 * @package MyChooz_Aesthetic
 */

/* ═══════════════════════════════════════════════════════════════
   RATING CAROUSEL (ТОП 100) - Island
   ═══════════════════════════════════════════════════════════════ */

.hp-rating {
    background: var(--hp-island-bg);
    border-top: 1px solid var(--hp-island-border);
    border-bottom: 1px solid var(--hp-island-border);
    box-shadow: var(--hp-island-shadow);
    padding: 16px;
    margin: 0 0 var(--hp-section-gap);
}

.hp-rating .hp-container {
    padding: 0;
}

/* Carousel wrapper */
.hp-rating__wrapper {
    position: relative;
}

.hp-rating__carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    padding: 10px 0 24px;
    transition: scrollbar-color 0.3s ease;
}

.hp-rating__carousel:hover {
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}

.hp-rating__carousel::-webkit-scrollbar {
    height: 6px;
}

.hp-rating__carousel::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
    margin: 0 20px;
}

.hp-rating__carousel::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}

.hp-rating__carousel:hover::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
}

.hp-rating__carousel:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

/* Navigation buttons */
.hp-rating__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: rgba(0,0,0,0.5);
    transition: all var(--hp-transition-slow);
    z-index: 10;
}

.hp-rating__nav:hover {
    background: var(--hp-primary);
    color: white;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 16px rgba(231,29,29,0.3);
}

.hp-rating__nav--prev {
    left: -22px;
    opacity: 0;
    pointer-events: none;
}

.hp-rating__nav--prev.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.hp-rating__nav--next {
    right: -22px;
}

/* Rating Card */
.hp-rating-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: var(--hp-content);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all var(--hp-transition-slow);
    text-decoration: none;
    color: inherit;
}

.hp-rating-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.hp-rating-card__rank {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    background: var(--hp-text);
    color: white;
    font-size: 16px;
    font-weight: 800;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hp-rating-card__rank--1 {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.hp-rating-card__rank--2 {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.hp-rating-card__rank--3 {
    background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
    box-shadow: 0 4px 12px rgba(146, 64, 14, 0.4);
}

.hp-rating-card__poster {
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #f8f8f8 0%, #eee 100%);
    position: relative;
    overflow: hidden;
}

.hp-rating-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hp-rating-card__award {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 8px;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 9px;
    font-weight: 500;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.hp-rating-card__content {
    padding: 16px;
}

.hp-rating-card__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    text-align: center;
}

.hp-rating-card__rating-wrap {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.hp-rating-card__rating {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hp-rating-card__score {
    font-size: 32px;
    font-weight: 800;
    color: var(--mca-star);
    line-height: 1;
}

.hp-rating-card__stars {
    color: var(--mca-star);
    font-size: 12px;
    letter-spacing: 1px;
}

.hp-rating-card__stars .star-full {
    color: var(--mca-star);
}

.hp-rating-card__stars .star-half {
    background: linear-gradient(90deg, var(--mca-star) 50%, var(--mca-star-empty) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hp-rating-card__stars .star-empty {
    color: var(--mca-star-empty);
}

.hp-rating-card__sub-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 12px;
    border-left: 2px solid var(--hp-border);
    justify-content: center;
}

.hp-rating-card__sub-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
}

.hp-rating-card__sub-label {
    color: var(--hp-muted);
}

.hp-rating-card__sub-value {
    font-weight: 700;
}

.hp-rating-card__tech {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    justify-content: center;
}

.hp-rating-card__tech-pill {
    padding: 2px 6px;
    background: var(--mca-bg);
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
    color: var(--mca-muted);
}

.hp-rating-card__price {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hp-rating-card__price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--hp-primary);
}

.hp-rating-card__price-old {
    font-size: 13px;
    color: var(--hp-muted);
    text-decoration: line-through;
    margin-left: 6px;
}

.hp-rating-card__btn {
    padding: 8px 14px;
    background: var(--hp-primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--hp-transition-normal);
    text-decoration: none;
}

.hp-rating-card__btn:hover {
    transform: scale(1.05);
}

/* Focus-visible for keyboard navigation */
.hp-rating__nav:focus-visible,
.hp-rating-card__btn:focus-visible {
    outline: 2px solid var(--mca-primary);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 769px) {
    .hp-rating {
        border: 1px solid var(--hp-island-border);
        border-radius: var(--hp-island-radius);
        padding: var(--hp-island-padding);
        margin: 0 20px var(--hp-section-gap);
        max-width: calc(1200px - 40px);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {

    .hp-rating__nav {
        display: none;
    }

    .hp-rating-card {
        flex: 0 0 200px;
    }
}
