/* YouTube Cards Styles - Integrated with existing UI */
.youtube-main-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem;
}

/* YouTube Card Base */
.youtube-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    max-width: 100%;
    box-sizing: border-box;
}

.youtube-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.youtube-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* YouTube Thumbnail Container */
.youtube-thumbnail-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

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

.youtube-card:hover .youtube-thumbnail-container img {
    transform: scale(1.05);
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.youtube-card:hover .play-overlay {
    background: rgba(255, 0, 0, 0.9);
}

.play-icon {
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 5px;
}

/* YouTube Embed Container (for iframe embeds) */
.youtube-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

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

/* YouTube Info Section */
.youtube-info {
    padding: 1.25rem;
}

.youtube-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.youtube-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.youtube-title a:hover {
    color: #667eea;
}

.youtube-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #8e8e93;
}

.youtube-date::before {
    content: '📅 ';
}

.youtube-views::before {
    content: '👁 ';
}

.youtube-description {
    color: #636366;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* YouTube Actions */
.youtube-actions {
    margin-top: 1rem;
}

.youtube-watch-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: #FF0000;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.youtube-watch-btn:hover {
    background: #CC0000;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

/* Channel Link */
.youtube-channel-link {
    margin-top: 1.5rem;
    text-align: center;
}

.channel-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.channel-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

/* Loading State */
.youtube-card.loading {
    animation: none;
    opacity: 1;
    transform: none;
}

.youtube-card.loading .youtube-embed-container {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Error State */
.youtube-error-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.youtube-error-message {
    color: #636366;
}

.youtube-error-message p {
    margin-bottom: 1rem;
}

/* Placeholder */
.youtube-placeholder {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.youtube-placeholder p {
    color: #8e8e93;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .youtube-info {
        padding: 1rem;
    }
    
    .youtube-title {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .youtube-main-container {
        gap: 1rem;
        padding: 0.25rem;
    }
    
    .youtube-info {
        padding: 0.875rem;
    }
    
    .youtube-title {
        font-size: 0.95rem;
    }
    
    .youtube-description {
        font-size: 0.85rem;
    }
    
    .youtube-meta {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .youtube-watch-btn {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }
    
    .channel-button {
        font-size: 0.9rem;
        padding: 0.6rem 1.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .youtube-card {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .youtube-title a {
        color: #f0f0f0;
    }
    
    .youtube-title a:hover {
        color: #ff4444;
    }
    
    .youtube-description {
        color: #b0b0b0;
    }
    
    .youtube-meta {
        color: #909090;
    }
    
    .youtube-error-container,
    .youtube-placeholder {
        background: rgba(30, 30, 30, 0.95);
        color: #f0f0f0;
    }
}

/* Animation keyframes */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}