/* YouTube Feed Widget Styles */

.ig-youtube-feed {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.ig-yt-grid {
    display: grid;
    gap: 20px;
    padding: 20px 0;
}

@media (max-width: 768px) {
    .ig-yt-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 15px;
    }
}

.ig-yt-follow-button-wrapper {
    margin-top: 20px;
    text-align: center;
}

.ig-yt-follow-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: #ff0000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.ig-yt-follow-button:hover {
    background: #cc0000;
    color: #fff;
}

.ig-yt-follow-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ig-yt-modal-follow-button {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8eaed;
}

.ig-yt-follow-button-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #ff0000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s ease;
}

.ig-yt-follow-button-modal:hover {
    background: #cc0000;
    color: #fff;
}

.ig-yt-follow-button-modal svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ig-yt-description-text {
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: var(--max-lines, 3);
    -webkit-box-orient: vertical;
    transition: all 0.3s ease;
}

.ig-yt-description-text.expanded {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

.ig-yt-read-more-btn {
    background: transparent;
    border: none;
    color: #1a73e8;
    cursor: pointer;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-top: 8px;
    transition: color 0.3s ease;
}

.ig-yt-read-more-btn:hover {
    color: #1557b0;
    text-decoration: underline;
}

.ig-yt-read-more-btn:focus {
    outline: none;
    text-decoration: underline;
}

.ig-yt-video-item {
    position: relative;
    cursor: pointer;
    background: #fff;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 50px;
    z-index: 1;
}

.ig-yt-video-item,
.ig-yt-video-thumbnail,
.ig-yt-video-thumbnail img {
    cursor: pointer;
}

.ig-yt-video-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ig-yt-video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #000;
    border-radius: 0;
}

.ig-yt-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
    pointer-events: none; /* Allow clicks to pass through */
}

.ig-yt-video-item:hover .ig-yt-hover-overlay {
    opacity: 1;
}

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

.ig-yt-video-item:hover .ig-yt-video-thumbnail img {
    transform: scale(1.12);
}

.ig-yt-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.8);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 4; /* Above hover overlay */
    pointer-events: none !important; /* Allow clicks to pass through to video item */
}

.ig-yt-video-item:hover .ig-yt-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.ig-yt-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

.ig-yt-video-views {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10;
    width: 100%;
    transition: all 0.3s ease;
}

.ig-yt-video-item:hover .ig-yt-video-views {
    opacity: 0;
}

/* Modal Popup */
.ig-yt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.ig-yt-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ig-yt-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.ig-yt-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    z-index: 10001;
    display: flex;
    flex-direction: column;
}

.ig-yt-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.ig-yt-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.ig-yt-modal-body {
    display: flex;
    flex-direction: row;
    max-height: 90vh;
    overflow: hidden;
}

.ig-yt-modal-video {
    flex: 1;
    min-width: 0;
    background: #000;
}

.ig-yt-video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.ig-yt-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.ig-yt-modal-info {
    width: 400px;
    padding: 30px;
    overflow-y: auto;
    background: #fff;
}

.ig-yt-modal-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8eaed;
}

.ig-yt-channel-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ig-yt-channel-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.ig-yt-channel-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.ig-yt-channel-subs {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.ig-yt-modal-video-info {
    margin-bottom: 20px;
}

.ig-yt-modal-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.ig-yt-modal-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.ig-yt-channel-description {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.ig-yt-channel-description p {
    margin: 0;
}

@media (max-width: 968px) {
    .ig-yt-modal-body {
        flex-direction: column;
    }
    
    .ig-yt-modal-info {
        width: 100%;
        max-height: 40vh;
    }
    
    .ig-yt-video-wrapper {
        padding-top: 56.25%;
    }
}

