/**
 * OlyTV Posts Feed Styles
 *
 * Responsive styles for the OlyTV Posts Feed Elementor widget
 */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

/* Custom font for Bebas Neue Pro if available */
@font-face {
    font-family: 'Bebas Neue Pro';
    src: local('Bebas Neue Pro'), local('BebasNeuePro');
    /* Fallback to Bebas Neue regular if Pro version isn't available */
    font-family: 'Bebas Neue';
}

/* -----------------
  Global Styles
------------------ */
.olytv-posts-feed-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.olytv-posts-feed-wrapper *,
.olytv-posts-feed-wrapper *:before,
.olytv-posts-feed-wrapper *:after {
    box-sizing: border-box;
}

/* -----------------
  Category Filter
------------------ */
.olytv-category-filter {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.olytv-category-filter::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.olytv-category-filter a {
    padding: 10px 15px;
    margin-right: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.olytv-category-filter a.active {
    position: relative;
}

.olytv-category-filter a.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: currentColor;
}

/* -----------------
  Posts Container
------------------ */
.olytv-posts-container {
    position: relative;
    width: 100%;
}

.olytv-posts-inner-container {
    width: 100%;
}

/* -----------------
  Post Item - Desktop
------------------ */
/* -----------------
  Post Item - Desktop
------------------ */
.olytv-post-item {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.olytv-post-category {
    background: #fff;
    color: #292935;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    line-height: 140%;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .olytv-post-item {
        height: 324px;
        display: flex;
        background: linear-gradient(90deg, #19191C 0.06%, #292935 100.06%);
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
        padding: 0;
    }
    .olytv-category-filter {
        display: none;
    }

    .olytv-post-item:hover {
        transform: none;
        box-shadow: none;
    }

    .olytv-post-media {
        width: 240px;
        flex: 0 0 240px;
        height: 100%;
        padding: 0;
        margin: 0;
    }

    .olytv-post-thumbnail.desktop-media {
        height: 100%;
        overflow: hidden;
        padding: 0;
        margin: 0;
    }

    .olytv-post-thumbnail.desktop-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
    }

    .olytv-post-content {
        flex: 1;
        padding: 50px 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background: linear-gradient(90deg, #19191C 0.06%, #292935 100.06%) !important;
    }

    .olytv-post-meta {
        display: flex;
        align-items: center;
        margin-bottom: 12px;
    }

    .olytv-post-category {
        padding: 3px 6px;
        font-size: 14px;
    }

    .olytv-post-meta-divider {
        margin: 0 10px;
        width: 3px;
        height: 3px;
        background-color: #F73535;
        border-radius: 50%;
    }

    .olytv-post-author {
        color: #C9C9D7;
        font-family: 'Montserrat', sans-serif;
        font-size: 14px;
        font-weight: 600;
        line-height: 140%;
    }

    .olytv-post-title {
        margin: 0 0 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .olytv-post-title a {
        color: #FFF;
        font-family: 'Bebas Neue Pro', 'Bebas Neue', sans-serif;
        font-size: 36px;
        font-weight: 700;
        line-height: 100%;
        text-transform: uppercase;
        text-decoration: none;
    }

    .olytv-post-excerpt {
        margin-bottom: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #F9F9F9;
        font-family: 'Montserrat', sans-serif;
        font-size: 16px;
        font-weight: 500;
        line-height: 140%;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .olytv-read-more {
        color: #08F9AE;
        font-family: 'Montserrat', sans-serif;
        font-size: 16px;
        font-weight: 600;
        line-height: 100%;
        text-decoration: underline;
        text-transform: uppercase;
        margin-top: 12px;
    }
}

.olytv-post-media {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.olytv-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.olytv-post-item:hover .olytv-post-thumbnail img {
    transform: scale(1.05);
}

.olytv-post-video {
    width: 100%;
}

.olytv-post-video iframe,
.olytv-post-video video {
    width: 100%;
    display: block;
}

.olytv-post-content {
    padding: 15px;
}

.olytv-post-title {
    margin: 0 0 10px;
    font-size: 1.2rem;
    line-height: 1.4;
}

.olytv-post-title a {
    text-decoration: none;
}

.olytv-post-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #666;
}

.olytv-read-more {
    display: inline-block;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

/* -----------------
  Promotional Item
------------------ */
.olytv-promo-item {
    width: 100%;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.olytv-promo-content {
    text-align: center;
}

/* -----------------
  Loading Spinner
------------------ */
.olytv-loading-spinner {
    text-align: center;
    padding: 20px 0;
}

.olytv-loading-spinner .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #333;
    border-radius: 50%;
    animation: olytv-spin 1s linear infinite;
}

@keyframes olytv-spin {
    to {
        transform: rotate(360deg);
    }
}

/* -----------------
  Load More Button
------------------ */
.olytv-load-more {
    text-align: center;
    margin: 20px 0;
    display: none;
}

.olytv-load-more-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.olytv-load-more-button:hover {
    background-color: #e9ecef;
}

/* -------------------------
  Mobile-specific Elements
--------------------------- */
/* Hidden by default on desktop */
.mobile-only {
    display: none;
}

.olytv-post-thumbnail.mobile-media {
    display: none;
}

.olytv-post-content-overlay {
    display: none;
}

/* -----------------
  Video Play Button
------------------ */
.olytv-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.olytv-video-play-icon:before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent #fff;
    margin-left: 5px;
}

/* -----------------
  No Posts Message
------------------ */
.olytv-no-posts {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.1rem;
    color: #666;
}

/* -----------------------------
  Responsive Media Queries
------------------------------ */
/* Tablet adjustments */
@media screen and (max-width: 1024px) {
    .olytv-post-title {
        font-size: 1.1rem;
    }

    .olytv-post-excerpt {
        font-size: 0.85rem;
    }
}

/* Mobile transformation */
@media screen and (max-width: 767px) {
    /* Show mobile elements, hide desktop */
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .desktop-media {
        display: none;
    }

    .mobile-media {
        display: block !important;
    }

    /* Category filter adjustments */
    .olytv-category-filter {
        display: flex;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 10px;
        scrollbar-width: none; /* Firefox */
        -webkit-overflow-scrolling: touch;
        margin-top: 16px;
    }

    .olytv-category-filter::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }

    /* Posts container for swipe view */
    .olytv-posts-inner-container {
        height: 100vh;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
        -webkit-overflow-scrolling: touch;
    }

    /* Post items for swipe view */
    .olytv-post-item {
        height: 100vh;
        margin-bottom: 0;
        border-radius: 0;
        box-shadow: none;
        scroll-snap-align: start;
        position: relative;
    }

    .olytv-post-item:hover {
        transform: none;
        box-shadow: none;
    }

    /* Full-screen background image */
    .olytv-post-thumbnail.mobile-media {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center;
        z-index: 1;
        object-fit: cover;
        object-position: center;
    }

    /* Additional rule to ensure proper image display when there's an actual img element */
    .olytv-post-thumbnail.mobile-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
    }

    /* Content overlay */
    .olytv-post-content-overlay {
        display: block;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 24px 16px;
        background: linear-gradient(180deg, rgba(41, 41, 53, 0.00) 0%, rgba(41, 41, 53, 0.75) 49.98%, #292935 100%);
        z-index: 2;
    }

    .olytv-overlay-inner {
        color: #fff;
    }

    /* Adjust category styling for mobile */
    .olytv-post-content-overlay .olytv-post-category {
        padding: 6px 18px;
        height: 24px;
        font-size: 10px;
        line-height: 130%;
        margin-bottom: 8px;
        display: inline-block;
    }

    .olytv-post-content-overlay .olytv-post-title {
        margin-bottom: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #FFF;
        font-family: 'Bebas Neue Pro', 'Bebas Neue', sans-serif;
        font-size: 20px;
        font-weight: 700;
        line-height: 100%;
        text-transform: uppercase;
    }

    .olytv-post-content-overlay .olytv-post-title a {
        color: #fff;
        text-decoration: none;
    }

    .olytv-category-filter a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 24px;
        padding: 0 12px;
        background: #3B3B54;
        border-radius: 12px;
        margin-right: 8px;
        color: #FFF;
        text-align: center;
        font-family: 'Montserrat', sans-serif;
        font-size: 10px;
        font-weight: 600;
        line-height: 130%;
        text-transform: uppercase;
        white-space: nowrap;
        text-decoration: none;
    }

    .olytv-category-filter a.active {
        background: #F73535;
    }

    .olytv-category-filter a.active:after {
        display: none;
    }

    /* Promotional content adjustments */
    .olytv-promo-item {
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        scroll-snap-align: start;
        margin-bottom: 0;
        border-radius: 0;
    }

    .olytv-promo-content {
        max-width: 90%;
    }

    /* Load more button */
    .olytv-load-more {
        padding: 30px 0;
    }

    .olytv-load-more-button {
        width: 80%;
        padding: 15px 20px;
    }
}

/* Smaller phone adjustments */
/* Category filter fixed at bottom for mobile */
.olytv-category-filter-mobile-wrapper {
    display: none;
}

@media screen and (max-width: 767px) {
    .olytv-category-filter-mobile-wrapper {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(25, 25, 28, 0.85);
        backdrop-filter: blur(4px);
        z-index: 100;
        padding: 12px 0;
    }

    .olytv-category-filter {
        margin: 0;
        padding: 0 8px;
    }

    /* Adjust content overlay to not overlap with fixed filter */
    .olytv-post-content-overlay {
        padding-bottom: 90px; /* Leave space for fixed filter */
    }

    /* Post content fade animation */
    .olytv-post-content-overlay {
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

    .olytv-post-item.active .olytv-post-content-overlay {
        opacity: 1;
    }
}

/* -----------------
  Animation Effects
------------------ */
/* Fade-in animation for new loaded posts */
@keyframes olytv-fadein {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.olytv-post-item.new-loaded {
    animation: olytv-fadein 0.5s ease forwards;
}

/* Swipe hint animation */
@keyframes olytv-swipe-hint {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(10px); opacity: 0.7; }
    100% { transform: translateY(0); opacity: 1; }
}

.olytv-swipe-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    z-index: 10;
    opacity: 0.7;
    animation: olytv-swipe-hint 2s infinite;
    pointer-events: none;
}

.olytv-swipe-hint:before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 20px;
}

.olytv-swipe-hint:after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background-color: #fff;
    border-radius: 4px;
    opacity: 0.7;
}