/* 
 * Gallery Items Module
 * Handles individual gallery item styling, images, and hover effects
 */

/* Gallery Item Styles */
.ppg-item {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.ppg-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #c0c0c0;
}

.ppg-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ppg-star-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ppg-item:hover::before {
    opacity: 1;
}

/* Image Styles */
.ppg-item img {
    width: 100%;
    display: block;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.ppg-wrapper[data-aspect="original"] .ppg-item img {
    height: auto;
    object-fit: cover;
    max-height: 400px;
}

.ppg-wrapper[data-aspect="square"] .ppg-item img {
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
    .ppg-wrapper[data-aspect="square"] .ppg-item img {
        height: 0;
        padding-bottom: 100%;
        background-size: cover;
        background-position: center;
    }
}

.ppg-item:hover img {
    transform: scale(1.02);
}

/* Video Deliverable Play Badge */
.ppg-video-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

.ppg-video-play-badge::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #ffffff;
}

/* Square Processing Indicator */
.ppg-square-processing {
    position: relative;
}

.ppg-square-processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #0073aa;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ppg-spin 1s linear infinite;
    z-index: 2;
}

.ppg-loading-square {
    opacity: 0.7;
}

/* Rating Info Box */
.ppg-rating-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px 18px;
    margin: 15px 0 0 0;
    font-size: 17px;
    text-align: left;
    line-height: 1.4;
}

.ppg-rating-info div {
    margin-bottom: 8px;
}

.ppg-rating-info div:last-child {
    margin-bottom: 0;
}

/* Hide rating info for non-logged users with disabled stars */
.ppg-item .ppg-rating-info {
    display: block;
}

.ppg-item:has(.ppg-stars-disabled) .ppg-rating-info {
    display: none !important;
}

/* Fallback for browsers that don't support :has() */
.ppg-stars-disabled + .ppg-rating-info {
    display: none !important;
}

/* Print Styles */
@media print {
    .ppg-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .ppg-rating-info {
        display: none;
    }
}