/**
 * PPV Events Grid Styles
 *
 * Provides styling for all 6 PPV event display skins:
 * grid, list, carousel, overlay, overlay-carousel, minimal.
 *
 * Uses CSS custom properties for easy theming via shortcode
 * attributes, Elementor controls, and Gutenberg block settings.
 *
 * @package Tvstartup_OTT_Platform
 * @since   1.16.0
 */

/* ==========================================================================
   CSS Custom Properties (Defaults)
   ========================================================================== */

.ts-ott-ppv-events {
    --ts-ott-font-family: inherit;
    --ts-ott-title-color: #1a1a2e;
    --ts-ott-desc-color: #6b7280;
    --ts-ott-bg-color: #ffffff;
    --ts-ott-accent-color: #6366f1;
    --ts-ott-border-radius: 12px;
    --ts-ott-card-padding: 1rem;
    --ts-ott-card-spacing: 1.25rem;
    --ts-ott-columns: 3;
    --ts-ott-transition: 0.25s ease;

    font-family: var(--ts-ott-font-family);
    box-sizing: border-box;
    width: 100%;
}

.ts-ott-ppv-events *,
.ts-ott-ppv-events *::before,
.ts-ott-ppv-events *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.ts-ott-ppv-events--empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ts-ott-desc-color);
    font-size: 1rem;
}

/* ==========================================================================
   PPV Event Card (Base Styles)
   ========================================================================== */

.ts-ott-ppv-event-card {
    background-color: var(--ts-ott-bg-color);
    border-radius: var(--ts-ott-border-radius);
    overflow: hidden;
    transition: transform var(--ts-ott-transition),
                box-shadow var(--ts-ott-transition);
    position: relative;
}

.ts-ott-ppv-event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* --- Thumbnail --- */

.ts-ott-ppv-event-card__thumbnail {
    position: relative;
    overflow: hidden;
    background-color: #f3f4f6;
    aspect-ratio: 16 / 9;
}

.ts-ott-ppv-event-card__thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ts-ott-transition);
}

.ts-ott-ppv-event-card:hover .ts-ott-ppv-event-card__thumbnail img {
    transform: scale(1.05);
}

.ts-ott-ppv-event-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background-color: #f3f4f6;
    color: #d1d5db;
}

/* --- Content --- */

.ts-ott-ppv-event-card__content {
    padding: var(--ts-ott-card-padding);
}

.ts-ott-ppv-event-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ts-ott-title-color);
    margin: 0 0 0.375rem 0;
    line-height: 1.3;
    font-family: var(--ts-ott-font-family);
}

.ts-ott-ppv-event-card__desc {
    font-size: 0.875rem;
    color: var(--ts-ott-desc-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

/* --- Price Badge --- */

.ts-ott-ppv-event-card__price-badge {
    display: inline-block;
    background-color: var(--ts-ott-accent-color);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    line-height: 1.4;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

/* --- Event Dates --- */

.ts-ott-ppv-event-card__dates {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--ts-ott-desc-color);
    margin-bottom: 0.625rem;
    line-height: 1.4;
}

.ts-ott-ppv-event-card__dates svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* --- Buy Now Button --- */

.ts-ott-ppv-event-card__btn {
    display: inline-block;
    background-color: var(--ts-ott-accent-color);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: background-color var(--ts-ott-transition),
                transform var(--ts-ott-transition),
                box-shadow var(--ts-ott-transition);
    cursor: pointer;
    border: none;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.ts-ott-ppv-event-card__btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    color: #ffffff;
}

.ts-ott-ppv-event-card__btn:focus,
.ts-ott-ppv-event-card__btn:active {
    text-decoration: none;
    color: #ffffff;
}

/* ==========================================================================
   Skin: Grid
   ========================================================================== */

.ts-ott-ppv-events--grid {
    display: grid;
    grid-template-columns: repeat(var(--ts-ott-columns), 1fr);
    gap: var(--ts-ott-card-spacing);
}

.ts-ott-ppv-events--grid .ts-ott-ppv-event-card__thumbnail {
    aspect-ratio: 16 / 9;
}

.ts-ott-ppv-events--grid .ts-ott-ppv-event-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   Skin: List
   ========================================================================== */

.ts-ott-ppv-events--list {
    display: flex;
    flex-direction: column;
    gap: var(--ts-ott-card-spacing);
}

.ts-ott-ppv-events--list .ts-ott-ppv-event-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.ts-ott-ppv-events--list .ts-ott-ppv-event-card__thumbnail {
    width: 240px;
    min-width: 240px;
    flex-shrink: 0;
}

.ts-ott-ppv-events--list .ts-ott-ppv-event-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ts-ott-ppv-events--list .ts-ott-ppv-event-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   Skin: Carousel
   ========================================================================== */

.ts-ott-ppv-events--carousel {
    position: relative;
    overflow: hidden;
}

.ts-ott-ppv-events__track {
    display: flex;
    gap: var(--ts-ott-card-spacing);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 0.5rem;
}

.ts-ott-ppv-events__track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.ts-ott-ppv-events--carousel .ts-ott-ppv-event-card {
    flex: 0 0 calc(33.333% - var(--ts-ott-card-spacing) * 2 / 3);
    scroll-snap-align: start;
    min-width: 280px;
}

.ts-ott-ppv-events--carousel .ts-ott-ppv-event-card__thumbnail {
    aspect-ratio: 16 / 9;
}

.ts-ott-ppv-events--carousel .ts-ott-ppv-event-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Carousel Buttons */

.ts-ott-ppv-events--carousel .ts-ott-carousel-btn,
.ts-ott-ppv-events--overlay-carousel .ts-ott-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background-color: var(--ts-ott-bg-color);
    color: var(--ts-ott-title-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--ts-ott-transition),
                box-shadow var(--ts-ott-transition),
                opacity var(--ts-ott-transition);
    opacity: 0;
    padding: 0;
}

.ts-ott-ppv-events--carousel:hover .ts-ott-carousel-btn,
.ts-ott-ppv-events--overlay-carousel:hover .ts-ott-carousel-btn {
    opacity: 1;
}

.ts-ott-ppv-events--carousel .ts-ott-carousel-btn:hover,
.ts-ott-ppv-events--overlay-carousel .ts-ott-carousel-btn:hover {
    background-color: var(--ts-ott-accent-color);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ts-ott-ppv-events--carousel .ts-ott-carousel-btn--prev,
.ts-ott-ppv-events--overlay-carousel .ts-ott-carousel-btn--prev {
    left: 12px;
}

.ts-ott-ppv-events--carousel .ts-ott-carousel-btn--next,
.ts-ott-ppv-events--overlay-carousel .ts-ott-carousel-btn--next {
    right: 12px;
}

.ts-ott-ppv-events--carousel .ts-ott-carousel-btn svg,
.ts-ott-ppv-events--overlay-carousel .ts-ott-carousel-btn svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Skin: Overlay
   ========================================================================== */

.ts-ott-ppv-events--overlay {
    display: grid;
    grid-template-columns: repeat(var(--ts-ott-columns), 1fr);
    gap: var(--ts-ott-card-spacing);
}

.ts-ott-ppv-events--overlay .ts-ott-ppv-event-card {
    cursor: pointer;
}

.ts-ott-ppv-events--overlay .ts-ott-ppv-event-card__thumbnail {
    aspect-ratio: 16 / 9;
}

.ts-ott-ppv-events--overlay .ts-ott-ppv-event-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ts-ott-ppv-event-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--ts-ott-card-padding);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    color: #ffffff;
    transform: translateY(100%);
    transition: transform var(--ts-ott-transition);
}

.ts-ott-ppv-events--overlay .ts-ott-ppv-event-card:hover .ts-ott-ppv-event-card__overlay {
    transform: translateY(0);
}

.ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__title {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__dates {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__dates svg {
    stroke: rgba(255, 255, 255, 0.7);
}

.ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__btn {
    font-size: 0.75rem;
    padding: 0.375rem 1rem;
}

/* Price badge on overlay thumbnail */
.ts-ott-ppv-events--overlay .ts-ott-ppv-event-card__price-badge,
.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__price-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    margin-bottom: 0;
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   Skin: Overlay Carousel
   ========================================================================== */

.ts-ott-ppv-events--overlay-carousel {
    position: relative;
    overflow: hidden;
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-events__track {
    display: flex;
    gap: var(--ts-ott-card-spacing);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-events__track::-webkit-scrollbar {
    display: none;
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card {
    flex: 0 0 calc(33.333% - var(--ts-ott-card-spacing) * 2 / 3);
    scroll-snap-align: start;
    min-width: 280px;
    cursor: pointer;
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__thumbnail {
    aspect-ratio: 16 / 9;
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay text on hover */
.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--ts-ott-card-padding);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    color: #ffffff;
    transform: translateY(100%);
    transition: transform var(--ts-ott-transition);
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card:hover .ts-ott-ppv-event-card__overlay {
    transform: translateY(0);
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__title {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__dates {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__dates svg {
    stroke: rgba(255, 255, 255, 0.7);
}

.ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card__overlay .ts-ott-ppv-event-card__btn {
    font-size: 0.75rem;
    padding: 0.375rem 1rem;
}

/* ==========================================================================
   Skin: Minimal
   ========================================================================== */

.ts-ott-ppv-events--minimal {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 0;
    border-radius: 0;
    border-bottom: 1px solid #f3f4f6;
    background: transparent;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card:last-child {
    border-bottom: none;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card:hover {
    transform: none;
    box-shadow: none;
    background-color: #fafafa;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__thumbnail {
    width: 64px;
    min-width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 1rem;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__placeholder {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__placeholder svg {
    width: 24px;
    height: 24px;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    flex: 1;
    min-width: 0;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__title {
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__desc {
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__price-badge {
    font-size: 0.6875rem;
    padding: 0.1875rem 0.5rem;
    margin-bottom: 0.25rem;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__dates {
    font-size: 0.6875rem;
    margin-bottom: 0.25rem;
}

.ts-ott-ppv-events--minimal .ts-ott-ppv-event-card__btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.875rem;
}

/* ==========================================================================
   Responsive: Tablet (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    /* Grid: reduce to 2 columns */
    .ts-ott-ppv-events--grid {
        --ts-ott-columns: 2;
    }

    /* Overlay: reduce to 2 columns */
    .ts-ott-ppv-events--overlay {
        --ts-ott-columns: 2;
    }

    /* List: reduce thumbnail width */
    .ts-ott-ppv-events--list .ts-ott-ppv-event-card__thumbnail {
        width: 180px;
        min-width: 180px;
    }

    /* Carousel: show fewer items */
    .ts-ott-ppv-events--carousel .ts-ott-ppv-event-card {
        flex: 0 0 calc(50% - var(--ts-ott-card-spacing) / 2);
        min-width: 240px;
    }

    /* Overlay Carousel: show fewer items */
    .ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card {
        flex: 0 0 calc(50% - var(--ts-ott-card-spacing) / 2);
        min-width: 240px;
    }

    /* Show carousel buttons on touch devices */
    .ts-ott-ppv-events--carousel .ts-ott-carousel-btn,
    .ts-ott-ppv-events--overlay-carousel .ts-ott-carousel-btn {
        opacity: 1;
    }
}

/* ==========================================================================
   Responsive: Mobile (max-width: 480px)
   ========================================================================== */

@media (max-width: 480px) {
    /* Grid: single column */
    .ts-ott-ppv-events--grid {
        --ts-ott-columns: 1;
    }

    /* Overlay: single column */
    .ts-ott-ppv-events--overlay {
        --ts-ott-columns: 1;
    }

    /* List: full-width stack */
    .ts-ott-ppv-events--list .ts-ott-ppv-event-card {
        flex-direction: column;
    }

    .ts-ott-ppv-events--list .ts-ott-ppv-event-card__thumbnail {
        width: 100%;
        min-width: 100%;
        aspect-ratio: 16 / 9;
    }

    /* Carousel: single item */
    .ts-ott-ppv-events--carousel .ts-ott-ppv-event-card {
        flex: 0 0 100%;
        min-width: 100%;
    }

    /* Overlay Carousel: single item */
    .ts-ott-ppv-events--overlay-carousel .ts-ott-ppv-event-card {
        flex: 0 0 100%;
        min-width: 100%;
    }

    /* Card spacing reduction */
    .ts-ott-ppv-events {
        --ts-ott-card-spacing: 0.75rem;
    }

    .ts-ott-ppv-event-card__title {
        font-size: 1rem;
    }

    .ts-ott-ppv-event-card__desc {
        font-size: 0.8125rem;
    }
}

/* ==========================================================================
   Gutenberg Editor Preview Wrapper
   ========================================================================== */

.ts-ott-block-preview {
    padding: 0;
}
