/* YouTube Video Widget Styles */
.youtube-video-widget-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: none;
    padding: 10px 24px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none; /* Removed border as requested */
}

.youtube-video-widget-container:hover {
    transform: none; /* Removed hover effect */
    box-shadow: none; /* Removed hover shadow */
}

.youtube-video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 0; /* Removed border-radius as requested */
    margin-bottom: 15px;
    background: #000;
    box-shadow: none; /* Ensure no shadow on wrapper */
}

.youtube-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none; /* Ensure no border on iframe */
    border-radius: 0; /* Ensure no border-radius on iframe */
    box-shadow: none; /* Ensure no shadow on iframe */
}

.youtube-video-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.youtube-subscribe-button {
    display: block; /* Changed to block to allow centering */
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 24px; /* Increased padding as requested */
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.youtube-subscribe-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.youtube-subscribe-button:hover::before {
    left: 100%;
}

.youtube-subscribe-button:hover {
    background: linear-gradient(135deg, #e60000, #b30000);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.youtube-subscribe-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .youtube-video-widget-container {
        background: #1a1a1a;
        border-color: #333;
        color: #ffffff;
    }
    
    .youtube-video-title {
        color: #ffffff;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .youtube-video-widget-container {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .youtube-video-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .youtube-subscribe-button {
        padding: 10px 20px;
        font-size: 13px;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .youtube-video-widget-container {
        padding: 12px;
    }
    
    .youtube-video-title {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
    
    .youtube-subscribe-button {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Loading state */
.youtube-video-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
}

.youtube-video-widget-loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Error state */
.youtube-video-widget-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    font-size: 14px;
    text-align: center;
}

/* Accessibility improvements */
.youtube-subscribe-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .youtube-video-widget-container,
    .youtube-subscribe-button,
    .youtube-subscribe-button::before {
        transition: none;
    }
    
    .youtube-video-widget-container:hover {
        transform: none;
    }
    
    .youtube-subscribe-button:hover {
        transform: none;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

.youtube-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.youtube-thumbnail-overlay:hover {
    background-color: rgba(0, 0, 0, 0.5); /* Darker overlay on hover */
}

.youtube-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.youtube-play-button {
    width: 60px;
    height: 60px;
    background-color: #ff0000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.youtube-play-button::before {
    content: "";
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 5px;
}

.youtube-play-button:hover {
    transform: scale(1.1);
}

.youtube-video-wrapper.playing .youtube-thumbnail-overlay {
    display: none;
}

/* Hide iframe initially */
.youtube-video-wrapper iframe {
    display: none;
}

/* Show iframe when playing */
.youtube-video-wrapper.playing iframe,
.youtube-video-widget-container.playing iframe {
    display: block !important;
}

/* Ensure overlay is hidden when playing */
.youtube-video-wrapper.playing .youtube-thumbnail-overlay,
.youtube-video-widget-container.playing .youtube-thumbnail-overlay {
    display: none !important;
}

