/* Carousel Styles */
.ytc-carousel {
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.ytc-carousel-container {
    display: flex;
    flex-wrap: wrap;
}

.ytc-video-item {
    padding: 10px;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.3s;
}

.ytc-video-item:hover {
    transform: scale(1.03);
}

.ytc-video-thumbnail {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.ytc-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ytc-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 0, 0, 0.8);
    border-radius: 50%;
    cursor: pointer;
}

.ytc-play-button:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent white;
}

.ytc-video-title {
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
}

/* Carousel Navigation */
.ytc-carousel-nav {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.ytc-carousel-nav button {
    background: #4285f4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.ytc-carousel-nav button:hover {
    background: #3367d6;
}

.ytc-carousel-nav button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Popup Styles */
.ytc-popup-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.ytc-popup-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ytc-popup-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    background-color: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.15s ease;
}

.ytc-popup-overlay.active .ytc-popup-container {
    transform: scale(1);
}

.ytc-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.ytc-popup-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.ytc-popup-content {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
}

.ytc-popup-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Theme Styles */
.ytc-carousel[data-theme="dark"] {
    color: #fff;
}

.ytc-carousel[data-theme="dark"] .ytc-video-title {
    color: #fff;
}

.ytc-carousel[data-theme="dark"] .ytc-popup-container {
    background-color: #333;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ytc-popup-container {
        width: 95%;
    }

    .ytc-popup-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .ytc-popup-container {
        width: 100%;
        border-radius: 0;
    }

    .ytc-popup-content {
        padding-bottom: 75%; /* Adjust for mobile aspect ratio */
    }

    .ytc-carousel-nav button {
        padding: 8px 15px;
        font-size: 14px;
    }
}