.youtube-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background: rgba(0, 0, 0, 0);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: backdrop-filter 0.4s ease, background-color 0.4s ease;
}

.youtube-container {
    transform-origin: var(--start-x) var(--start-y);
    transform: scale(0.1);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    position: relative;
    width: 90%;
    max-width: 900px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.youtube-overlay-open {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(0, 0, 0, 0.4);
}

.youtube-overlay-open .youtube-container {
    transform: scale(1);
    opacity: 1;
}

.youtube-overlay-close {
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background: rgba(0, 0, 0, 0);
}

.youtube-overlay-close .youtube-container {
    transform: scale(0.1);
    opacity: 0;
}

.youtube-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.youtube-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.close-youtube {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, background-color 0.2s;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.close-youtube:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.9);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .youtube-container {
        width: 95%;
        margin: 10px;
    }
    
    .close-youtube {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .youtube-container {
        width: 98%;
        margin: 5px;
    }
    
    .close-youtube {
        top: 8px;
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .youtube-container {
        width: 80%;
        max-height: 90vh;
    }
    
    .youtube-wrapper {
        padding-bottom: 45%; /* Adjust aspect ratio for landscape */
    }
}
