/* Custom styles for video cards */
.elementor-post__title,
.elementor-post__title a,
.elementor-post__text {
    text-align: left !important;
    display: block !important;
}

.elementor-post__title a {
    width: 100% !important;
    text-align: left !important;
}

.elementor-post__card .elementor-post__text {
    padding: 0 !important;
}

.elementor-post__card-link {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    width: 100% !important;
    height: 100% !important;
}

.elementor-post__card-link:hover {
    text-decoration: none !important;
    color: inherit !important;
}

.elementor-post__thumbnail {
    position: relative;
    overflow: hidden;
}

.elementor-post__thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.elementor-post__thumbnail::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
}

.elementor-post__card:hover .elementor-post__thumbnail::after {
    opacity: 1;
}

.elementor-post__card:hover .elementor-post__thumbnail::before {
    opacity: 1;
}

.elementor-post__card:hover .elementor-post__title {
    color: #007cba !important;
    transition: color 0.3s ease;
}

.elementor-post__thumbnail img {
    transition: transform 0.3s ease;
}

.elementor-post__card:hover .elementor-post__thumbnail img {
    transform: scale(1.05);
}

/* Duration overlay - always visible */
.elementor-post__thumbnail .duration-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
}

/* Hover effects for dynamic video cards */
.video-card:hover .video-thumbnail img {
    transform: scale(1.05) !important;
    filter: brightness(0.7) !important;
}

/* Default state for play overlay */
.play-overlay {
    opacity: 0 !important;
}

/* Hover effects for dynamic video cards */
.video-card:hover .video-thumbnail img {
    transform: scale(1.05) !important;
    filter: brightness(0.7) !important;
}

.video-card:hover .play-overlay {
    opacity: 1 !important;
}

/* More aggressive targeting for the dynamically created cards */
div[onclick*="video/"]:hover .play-overlay {
    opacity: 1 !important;
}

/* Even more specific targeting */
div[style*="cursor: pointer"]:hover div[style*="opacity: 0"] {
    opacity: 1 !important;
}

/* Enhanced play overlay styling */
.play-overlay {
    border: 3px solid white !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.5) !important;
}

.play-overlay span {
    font-size: 24px !important;
}

/* Default color for video titles */
.video-title {
    color: #333 !important;
}

.video-card:hover .video-title,
.video-card:hover h3,
.video-card:hover .video-info h3 {
    color: #007cba !important;
}

/* More aggressive targeting */
div[onclick*="video/"]:hover h3 {
    color: #007cba !important;
}

/* Carousel loading and transition styles */
.elementor-loop-carousel {
    transition: opacity 0.3s ease-in-out !important;
}

.aniview-carousel-loading {
    background: #f8f9fa !important;
    border-radius: 8px !important;
    margin: 20px 0 !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Elementor Loop Carousel Styles - Matching Static Version */
.elementor-377 .elementor-element.elementor-element-e3fd593 {
    --display: flex;
    --flex-direction: column;
    --container-widget-width: 100%;
    --container-widget-height: initial;
    --container-widget-flex-grow: 0;
    --container-widget-align-self: initial;
    --flex-wrap-mobile: wrap;
    --justify-content: flex-end;
    --overlay-opacity: 0.5;
    --padding-top: 0px;
    --padding-bottom: 0px;
    --padding-left: 0px;
    --padding-right: 0px;
}

.elementor-377 .elementor-element.elementor-element-2cd6848 img {
    height: 400px !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: 0px 0px 10px 10px !important;
}

.elementor-377 .elementor-element.elementor-element-47dacf3 {
    --display: flex;
    --position: absolute;
    --gap: 5px 5px;
    --row-gap: 5px;
    --column-gap: 5px;
    --border-radius: 0px 0px 10px 10px;
    --padding-top: 80px;
    --padding-bottom: 30px;
    --padding-left: 30px;
    --padding-right: 30px;
    bottom: 0px;
    --z-index: 1;
}

.elementor-377 .elementor-element.elementor-element-47dacf3:not(.elementor-motion-effects-element-type-background),
.elementor-377 .elementor-element.elementor-element-47dacf3 > .elementor-motion-effects-container > .elementor-motion-effects-layer {
    background-color: transparent !important;
    background-image: linear-gradient(180deg, #00000000 0%, #0000007A 100%) !important;
}

.elementor-377 .elementor-element.elementor-element-dbe6615 {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
}

.elementor-377 .elementor-element.elementor-element-dbe6615 > .elementor-widget-container {
    margin: 0px 0px 0px 0px !important;
    padding: 0px 0px 0px 0px !important;
}

.elementor-377 .elementor-element.elementor-element-dbe6615 .elementor-heading-title {
    font-family: "Saira", Sans-serif !important;
    font-size: 1.2em !important;
    font-weight: 500 !important;
    text-transform: capitalize !important;
    color: #FFFFFF !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.3 !important;
}

.elementor-377 .elementor-element.elementor-element-dbe6615 .elementor-heading-title a:hover,
.elementor-377 .elementor-element.elementor-element-dbe6615 .elementor-heading-title a:focus {
    color: var(--e-global-color-ddab2b5) !important;
}

.elementor-377 .elementor-element.elementor-element-dbe6615 .elementor-heading-title a {
    transition-duration: 0s !important;
}

/* Custom CSS for theme-post-title */
.elementor-377 .elementor-element.elementor-element-dbe6615 * {
    color: white !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
    line-height: 1.4em !important;
}

@media(max-width:1024px) {
    .elementor-377 .elementor-element.elementor-element-2cd6848 img {
        height: 370px !important;
    }
    .elementor-377 .elementor-element.elementor-element-47dacf3 {
        --padding-top: 80px;
        --padding-bottom: 20px;
        --padding-left: 20px;
        --padding-right: 20px;
    }
}

/* Hide ellipsis in carousel titles */
.aniview-simple-carousel h3::after,
.elementor-heading-title::after {
    display: none !important;
}

/* Ensure carousel has no focus outline */
.aniview-simple-carousel:focus {
    outline: none !important;
}

/* Mobile Responsiveness Fixes */
@media (max-width: 767px) {
    /* Force single column layout on mobile for all dynamic content */
    .aniview-simple-grid {
        grid-template-columns: 1fr !important;
    }

    .aniview-videos-block {
        grid-template-columns: 1fr !important;
    }

    .aniview-bottom-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .aniview-screens-block {
        grid-template-columns: 1fr !important;
    }

    /* Force mobile layout for screens section */
    .screens-mobile-stack {
        display: block !important;
    }

    .screens-desktop-layout,
    .screens-desktop-grid {
        display: none !important;
    }

    /* Ensure thumbnails maintain aspect ratio on mobile */
    .aniview-simple-grid img,
    .video-card .video-thumbnail img {
        aspect-ratio: 16/9 !important;
        height: auto !important;
    }

    /* Prevent horizontal overflow */
    .aniview-simple-grid,
    .aniview-videos-block,
    .aniview-bottom-grid,
    .aniview-screens-block {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Mobile-specific adjustments for video cards */
    .video-card {
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    /* Ensure text doesn't overflow */
    .video-title,
    .elementor-heading-title {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
}

/* Additional mobile fixes for smaller screens */
@media (max-width: 480px) {
    .aniview-bottom-grid {
        grid-template-columns: 1fr !important;
    }

    .video-card .video-thumbnail {
        aspect-ratio: 16/9 !important;
    }
}

/* Desktop compatibility - ensure desktop layouts are preserved */
@media (min-width: 768px) {
    /* Restore original desktop layouts */
    .aniview-simple-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .aniview-videos-block {
        grid-template-columns: 1fr 360px !important;
    }

    .aniview-bottom-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .aniview-screens-block {
        grid-template-columns: 1.25fr 1fr 1fr 1fr !important;
    }

    /* Show desktop layouts, hide mobile layouts */
    .screens-desktop-layout {
        display: grid !important;
        grid-template-columns: 1.25fr 1fr 1fr 1fr !important;
        gap: 24px !important;
    }
    .screens-desktop-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 24px !important;
    }

    .screens-mobile-stack {
        display: none !important;
    }
}