/* Container */
.adesaplus-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Video Player Overlay */
#adesaplus-video-player {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 40px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.adesaplus-player-wrapper {
    position: relative;
    width: 100%;
}

.adesaplus-close-player {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.adesaplus-close-player:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

.adesaplus-video-info {
    padding: 20px;
    background: #1a1a1a;
    color: white;
}

.adesaplus-video-info h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #fff;
}

.adesaplus-video-info p {
    margin: 0;
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
}

/* Video Grid */
.adesaplus-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .adesaplus-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .adesaplus-video-grid {
        grid-template-columns: 1fr;
    }
}

/* Video Item */
.adesaplus-video-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.adesaplus-video-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Thumbnail */
.adesaplus-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #000;
}

.adesaplus-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.adesaplus-video-item:hover .adesaplus-thumbnail img {
    transform: scale(1.05);
}

/* Play Overlay */
.adesaplus-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.adesaplus-video-item:hover .adesaplus-play-overlay {
    opacity: 1;
}

/* Duration Badge */
.adesaplus-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Video Details */
.adesaplus-video-details {
    padding: 16px;
}

.adesaplus-video-details h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.adesaplus-episode-number {
    margin: 0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Error and No Videos Messages */
.adesaplus-error,
.adesaplus-no-videos {
    padding: 20px;
    text-align: center;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.adesaplus-no-videos {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Loading State */
.adesaplus-loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

/* Single Video Player */
.adesaplus-single-video-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    clear: both;
}

.adesaplus-single-video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    line-height: 0;
}

/* Prevent MediaElement.js from initializing on our videos */
.adesaplus-fluidplayer-video {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    background: #000;
}

/* Hide MediaElement.js wrapper if it somehow gets created */
.adesaplus-single-video-player .mejs-container,
.adesaplus-single-video-player .mejs-mediaelement {
    display: none !important;
}

/* Ensure our FluidPlayer video shows */
.adesaplus-single-video-player video.adesaplus-fluidplayer-video {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    background: #000;
}

/* FluidPlayer specific overrides */
.adesaplus-single-video-player .fluid_video_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

.adesaplus-single-video-player .fluid_video_wrapper video {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* FluidPlayer logo size control */
.adesaplus-single-video-player .fluid_logo,
.adesaplus-single-video-player .fluid_logo img,
.fluid_video_wrapper .fluid_logo,
.fluid_video_wrapper .fluid_logo img {
    max-width: 80px !important;
    max-height: 60px !important;
    width: auto !important;
    height: auto !important;
}

/* Ensure logo doesn't block controls */
.fluid_logo {
    pointer-events: auto !important;
    z-index: 10 !important;
}

.adesaplus-single-video-info {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

.adesaplus-single-video-info h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #333;
    line-height: 1.4;
}

.adesaplus-single-video-info p {
    margin: 0;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* Single video in post format */
.format-video .adesaplus-single-video-wrapper {
    margin-bottom: 30px;
}

/* Pagination */
.adesaplus-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.adesaplus-page-btn,
.adesaplus-page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.adesaplus-page-btn:hover,
.adesaplus-page-number:hover {
    background: #f5f5f5;
    border-color: #bbb;
    color: #000;
}

.adesaplus-page-number.active {
    background: #FF0000;
    border-color: #FF0000;
    color: white;
    pointer-events: none;
}

.adesaplus-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #999;
    font-size: 14px;
}

.adesaplus-page-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Responsive Video Player */
@media (max-width: 768px) {
    #adesaplus-video-player {
        margin: 0 0 20px;
        border-radius: 0;
    }

    .adesaplus-video-info {
        padding: 15px;
    }

    .adesaplus-video-info h3 {
        font-size: 18px;
    }

    .adesaplus-pagination {
        margin-top: 30px;
        padding: 15px 0;
    }

    .adesaplus-page-btn,
    .adesaplus-page-number {
        min-width: 36px;
        height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }
}
