/* Video Gallery Container */
.video-gallery-container {
    display: flex;
    gap: 20px;
    margin: 0 auto;
    padding: 3rem;
    width: 100%;
    height: 100%;
}

/* Main Video Section (Left Side - Large) */
.main-video-section {
    flex: 1;
    min-width: 0;
}

.main-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.main-video-info {
    margin-top: 15px;
    padding: 0 5px;
}

.main-video-info .video-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #447996;
    margin-bottom: 8px;
}

.main-video-info .video-date {
    font-size: 0.9rem;
    color: #666;
    margin: 10px 0;
}

.main-video-info .video-date i {
    margin-right: 5px;
    color: #447996;
}

/* Bootstrap Accordion Styling */
#videoDetailsAccordion {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#videoDetailsAccordion .accordion-item {
    border: 1px solid #e0e0e0;
    border-bottom: none;
}

#videoDetailsAccordion .accordion-item:last-child {
    border-bottom: 1px solid #e0e0e0;
}

#videoDetailsAccordion .accordion-button {
    background-color: #f5f5f5;
    color: #447996;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

#videoDetailsAccordion .accordion-button:not(.collapsed) {
    background-color: #e8f4f8;
    color: #447996;
    box-shadow: none;
}

#videoDetailsAccordion .accordion-button:focus {
    box-shadow: none;
    border-color: #447996;
}

#videoDetailsAccordion .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23447996'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

#videoDetailsAccordion .accordion-body {
    padding: 15px;
    background-color: #fafafa;
}

#videoDetailsAccordion .accordion-body p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-article-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.related-article-item:hover {
    background: #e8f4f8;
    border-color: #447996;
    transform: translateX(5px);
}

.related-article-item i {
    color: #447996;
    font-size: 0.7rem;
}

.related-article-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* YouTube Channel Card - Inline Below Title */
.youtube-channel-card-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 15px 0;
    width: fit-content;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.youtube-channel-logo-inline {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 2px solid #447996;
    flex-shrink: 0;
    border-radius: 8px;
    padding: 5px;
}

.youtube-channel-details-inline {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.youtube-channel-name-inline {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.youtube-channel-link-inline {
    font-size: 0.75rem;
    color: #447996;
    margin: 0;
    text-decoration: underline;
}

/* Past Videos Section (Right Side - Sidebar) */
.past-videos-section {
    width: 400px;
    flex-shrink: 0;
}

.past-videos-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #447996;
}

/* YouTube Channel Link */
.youtube-channel-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

.youtube-channel-link:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.5);
    color: white;
}

.youtube-channel-link i {
    margin: 0;
}

.past-videos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 700px; /* Fixed height to match main video */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

/* Scrollbar Styling - Hidden by default, shows on hover/scroll */
.past-videos-list {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: transparent transparent; /* Firefox - hidden by default */
}

.past-videos-list:hover {
    scrollbar-color: #447996 #f1f1f1; /* Firefox - show on hover */
}

.past-videos-list::-webkit-scrollbar {
    width: 8px;
}

.past-videos-list::-webkit-scrollbar-track {
    background: transparent; /* Hidden by default */
    border-radius: 10px;
}

.past-videos-list::-webkit-scrollbar-thumb {
    background: transparent; /* Hidden by default */
    border-radius: 10px;
    transition: background 0.3s ease;
}

.past-videos-list:hover::-webkit-scrollbar-track {
    background: #f1f1f1; /* Show on hover */
}

.past-videos-list:hover::-webkit-scrollbar-thumb {
    background: #447996; /* Show on hover */
}

.past-videos-list::-webkit-scrollbar-thumb:hover {
    background: #356178; /* Darker on direct hover */
}

/* Past Video Item */
.past-video-item {
    display: flex;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fff;
}

.past-video-item:hover {
    background: #f5f5f5;
    transform: translateX(5px);
}

.past-video-item.active {
    background: #e8f4f8;
    border-left: 3px solid #447996;
}

.past-video-thumbnail {
    position: relative;
    width: 168px;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

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

.past-video-item:hover .past-video-thumbnail img {
    transform: scale(1.05);
}

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

.play-overlay i {
    color: white;
    font-size: 16px;
    margin-left: 3px;
}

.past-video-item:hover .play-overlay {
    background: rgba(68, 121, 150, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.past-video-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.past-video-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.past-video-date {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.past-videos-section {
    width: 350px;
}

.past-video-thumbnail {
    width: 140px;
}

@media (max-width: 1200px) {
    .video-gallery-container {
        flex-direction: column;
        padding: 2rem;
    }

    .past-videos-section {
        width: 100%;
    }

    .past-videos-list {
        max-height: 400px;
    }

    .past-video-thumbnail {
        width: 168px;
    }

    .youtube-channel-card-inline {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 500px) {
    .video-gallery-container {
        padding: 1rem;
    }

    .main-video-info .video-title {
        font-size: 1.2rem;
    }

    .main-video-info .video-date {
        font-size: 0.85rem;
    }

    .youtube-channel-card-inline {
        width: 100%;
        padding: 10px 12px;
    }

    .youtube-channel-logo-inline {
        width: 50px;
        height: 50px;
    }

    .youtube-channel-name-inline {
        font-size: 0.85rem;
    }

    .youtube-channel-link-inline {
        font-size: 0.7rem;
    }

    .past-videos-title {
        font-size: 1.1rem;
    }

    .past-videos-list {
        max-height: 350px;
        gap: 10px;
    }

    .past-video-thumbnail {
        width: 120px;
    }

    .past-video-title {
        font-size: 0.85rem;
    }

    .past-video-date {
        font-size: 0.75rem;
    }

    #videoDetailsAccordion .accordion-button {
        font-size: 0.85rem;
        padding: 10px;
    }

    #videoDetailsAccordion .accordion-body {
        padding: 10px;
        font-size: 0.85rem;
    }

    .related-article-item {
        padding: 8px;
    }

    .related-article-item span {
        font-size: 0.85rem;
    }
}

@media (max-width: 375px) {
    .video-gallery-container {
        padding: 0.75rem;
    }

    .main-video-info .video-title {
        font-size: 1rem;
    }

    .main-video-info .video-date {
        font-size: 0.8rem;
    }

    .youtube-channel-card-inline {
        padding: 8px 10px;
        gap: 10px;
    }

    .youtube-channel-logo-inline {
        width: 45px;
        height: 45px;
    }

    .youtube-channel-name-inline {
        font-size: 0.8rem;
    }

    .youtube-channel-link-inline {
        font-size: 0.65rem;
    }

    .past-videos-list {
        max-height: 300px;
    }

    .past-video-thumbnail {
        width: 100px;
    }

    .past-video-title {
        font-size: 0.8rem;
    }

    .past-video-date {
        font-size: 0.7rem;
    }

    .play-overlay {
        width: 30px;
        height: 30px;
    }

    .play-overlay i {
        font-size: 12px;
    }

    #videoDetailsAccordion .accordion-button {
        font-size: 0.8rem;
        padding: 8px;
    }

    #videoDetailsAccordion .accordion-body {
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* Load More Button Container */
.load-more-container {
    padding: 15px 10px 10px;
}

.load-more-btn {
    background: linear-gradient(135deg, #447996 0%, #356178 100%);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(68, 121, 150, 0.3);
}

.load-more-btn:hover {
    background: linear-gradient(135deg, #356178 0%, #447996 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 121, 150, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn i {
    transition: transform 0.3s ease;
}

.load-more-btn:hover i {
    transform: rotate(90deg);
}

#loadingSpinner {
    width: 2rem;
    height: 2rem;
}

/* Responsive adjustments for Load More button */
@media (max-width: 500px) {
    .load-more-btn {
        font-size: 0.85rem;
        padding: 8px 20px;
    }
}

@media (max-width: 375px) {
    .load-more-btn {
        font-size: 0.8rem;
        padding: 7px 18px;
    }
}