/* Enhanced Banner Styles for Dynamic Banner Management */

/* Times New Roman MT Bold Font Face */
@font-face {
    font-family: 'Times New Roman MT Extra Bold';
    src: local('Times New Roman MT Extra Bold'), 
         local('Times New Roman MT Bold'), 
         local('Times New Roman Bold'), 
         local('Times New Roman'), 
         local('Times'), 
         serif;
    font-weight: bold;
    font-style: normal;
}

/* Banner Video Container Styles */
.video-file-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.banner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* YouTube Container Styles */
.youtube-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.youtube-player {
    width: 100%;
    height: 100%;
}

.youtube-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Full-size Video Styles for Banners */
.video-fullsize {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    z-index: 1;
    border: none;
}

.youtube-fullsize {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    z-index: 1 !important;
    pointer-events: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
}

/* Banner containers - consistent sizing for images and videos - HOMEPAGE ONLY */
#heroCarousel .video-banner,
#heroCarousel .youtube-banner {
    position: relative;
    width: 100%;
    height: 700px; /* Increased banner height for homepage */
    overflow: hidden;
    background: #000;
}

/* Carousel items maintain consistent height - HOMEPAGE ONLY */
#heroCarousel .carousel-item {
    height: 700px; /* Increased banner height for homepage */
    overflow: hidden;
}

/* Default banner containers for admin/preview - normal height */
.video-banner,
.youtube-banner {
    position: relative;
    width: 100%;
    height: 400px; /* Normal height for admin/preview */
    overflow: hidden;
    background: #000;
}

/* Default carousel items for admin/preview */
.carousel-item {
    height: 400px; /* Normal height for admin/preview */
    overflow: hidden;
}

/* Ensure all banner content fits within carousel item - HOMEPAGE ONLY */
#heroCarousel .carousel-item .video-banner,
#heroCarousel .carousel-item .youtube-banner {
    width: 100%;
    height: 100%; /* Fill carousel item */
    position: relative;
}

/* Hero Section Video Styles - consistent banner sizing - HOMEPAGE ONLY */
#heroCarousel .hero-section.video-banner {
    display: block;
    height: 700px; /* Increased banner height for homepage */
    position: relative;
    background: #000;
    overflow: hidden;
}

#heroCarousel .hero-section.youtube-banner {
    display: block;
    height: 700px; /* Increased banner height for homepage */
    position: relative;
    background: #000;
    overflow: hidden;
}

/* Video Controls */
.video-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mute-toggle {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.mute-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    color: white;
}

.video-progress {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
}

/* Hero Content for Videos */
.video-content {
    position: relative;
    z-index: 5;
    background: rgba(0, 0, 0, 0.4);
    padding: 40px;
    border-radius: 10px;
    backdrop-filter: blur(2px);
}

/* Enhanced Typography for H1 with Times New Roman MT Bold */
.hero-content h1.govind-ayurveda-brand,
.h1-preview {
    font-family: 'Times New Roman MT Extra Bold', 'Times New Roman MT Bold', 'Times New Roman', Times, serif !important;
    font-weight: bold !important;
    font-style: normal !important;
    letter-spacing: 1px;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #ffffff !important; /* Pure white */
}

/* Banner headings pure white */
.hero-content h1,
.hero-content h2,
.hero-content h3 {
    color: #ffffff !important; /* Pure white */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important; /* Better readability */
}

/* Responsive Typography */
@media (max-width: 768px) {
    .hero-content h1.govind-ayurveda-brand {
        font-size: 2.2rem !important;
    }
    
    .hero-content h2 {
        font-size: 1.8rem !important;
    }
    
    .hero-content h3 {
        font-size: 1.4rem !important;
    }
    
    .video-content {
        padding: 20px;
    }
    
    .video-banner, .youtube-banner {
        height: 400px; /* Match the responsive height */
    }
    
    .hero-section.video-banner,
    .hero-section.youtube-banner {
        height: 400px; /* Match the responsive height */
    }
    
    .video-fullsize,
    .youtube-fullsize {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover;
    }
}

@media (max-width: 576px) {
    .hero-content h1.govind-ayurveda-brand {
        font-size: 1.8rem !important;
    }
    
    .hero-content h2 {
        font-size: 1.5rem !important;
    }
    
    .hero-content h3 {
        font-size: 1.2rem !important;
    }
    
    .video-content {
        padding: 15px;
    }
    
    .video-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .video-banner, .youtube-banner {
        height: 300px; /* Match the responsive height */
    }
    
    .hero-section.video-banner,
    .hero-section.youtube-banner {
        height: 300px; /* Match the responsive height */
    }
}

/* Ensure videos maintain aspect ratio and fill container properly - HOMEPAGE ONLY */
#heroCarousel .carousel-item .video-banner,
#heroCarousel .carousel-item .youtube-banner {
    width: 100%;
    height: 100%; /* Fill carousel item only */
    position: relative;
    overflow: hidden; /* Ensure content stays within container */
}

#heroCarousel .carousel-item .video-fullsize,
#heroCarousel .carousel-item .youtube-fullsize {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    z-index: 1;
}

/* Remove problematic YouTube iframe sizing that causes overflow - HOMEPAGE ONLY */
#heroCarousel .carousel-item .youtube-fullsize {
    /* Removed viewport-based sizing to keep videos within container */
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Banner Overlay Enhancement */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
}

/* Smooth Transitions */
.carousel-item {
    transition: transform 0.8s ease-in-out;
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
    display: block;
}

/* Loading State for Videos */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
}

.video-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Enhanced Button Styles */
.hero-content .btn {
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-content .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Hide buttons when not provided or empty */
.hero-content .btn:empty,
.hero-content .btn[href=""],
.hero-content .btn[href="#"],
.hero-content a:empty,
.hero-content a[href=""],
.hero-content a[href="#"]:not(.btn-warning) {
    display: none !important;
}

/* Hide button containers when buttons are empty */
.hero-content .btn-container:empty,
.hero-content .button-group:empty {
    display: none !important;
}

/* NABH Badge Enhancement */
.btn-warning {
    background: linear-gradient(45deg, #ffc107, #e0a800);
    border: none;
    color: #000;
    font-weight: bold;
}

.nabh-btn-logo {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* Accessibility Improvements */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    background: transparent;
    border-radius: 0;
    margin: 20px;
    height: calc(100% - 40px);
    top: 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: transparent;
}

/* Print Styles */
@media print {
    .video-file-container,
    .youtube-container,
    .video-controls,
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    .hero-content {
        background: white !important;
        color: black !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .hero-content h1.govind-ayurveda-brand,
    .hero-content h2,
    .hero-content h3 {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 1) !important;
    }
    
    .video-content {
        background: rgba(0, 0, 0, 0.8) !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .carousel-item {
        transition: none;
    }
    
    .hero-content .btn {
        transition: none;
    }
    
    .hero-content .btn:hover {
        transform: none;
    }
}

/* Banner Admin Table Thumbnail Styles */
.banner-thumbnail {
    width: 120px !important;
    height: 80px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
    display: block !important;
}

.banner-thumbnail-video {
    width: 120px !important;
    height: 80px !important;
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
    background: #000;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.banner-thumbnail-placeholder {
    width: 120px !important;
    height: 80px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #6c757d !important;
}

/* Banner Preview Modal Styles */
.banner-preview-modal .modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

.banner-preview-container {
    max-width: 400px;
    max-height: 300px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-preview-container img,
.banner-preview-container iframe,
.banner-preview-container video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border: none !important;
    border-radius: 4px !important;
}

/* YouTube wrapper sizing - match standard banners */
.youtube-banner-wrapper {
    position: relative;
    width: 100%;
    height: 700px; /* Increased banner height */
    overflow: hidden;
    background: #000;
}

.youtube-fullsize-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* YouTube iframe standard banner sizing */
.youtube-fullsize-embed {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    z-index: 1 !important;
    pointer-events: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
}

/* Alternative responsive wrapper - standard banner height */
.youtube-responsive-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Fill parent container */
    background: #000;
    overflow: hidden;
}

.youtube-responsive-wrapper iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    object-fit: cover !important;
}

/* YouTube Banner Sizing - Match Image Banner Dimensions */
.carousel-item iframe[src*="youtube.com"],
.carousel-item iframe[src*="youtu.be"],
iframe[src*="youtube.com"],
iframe[src*="youtu.be"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    background: #000;
}

/* YouTube container to match carousel item sizing */
.youtube-fullsize {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    z-index: 1 !important;
    pointer-events: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
}

/* Ensure YouTube videos fill carousel item like images - HOMEPAGE ONLY */
#heroCarousel .carousel-item.active iframe[src*="youtube"],
#heroCarousel .carousel-item iframe[src*="youtube"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    outline: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    z-index: 1 !important;
}

/* Override any inherited styles - HOMEPAGE ONLY */
#heroCarousel .hero-section iframe {
    max-width: none !important;
    max-height: none !important;
}

/* Responsive adjustments - maintain banner proportions - HOMEPAGE ONLY */
@media (max-width: 768px) {
    #heroCarousel .video-banner, 
    #heroCarousel .youtube-banner {
        height: 400px; /* Proportionally smaller on tablet */
    }
    
    #heroCarousel .carousel-item {
        height: 400px;
    }
    
    #heroCarousel .hero-section.video-banner,
    #heroCarousel .hero-section.youtube-banner {
        height: 400px;
    }
    
    .video-fullsize,
    .youtube-fullsize {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover;
    }
}

@media (max-width: 576px) {
    #heroCarousel .video-banner, 
    #heroCarousel .youtube-banner {
        height: 300px; /* Smaller on mobile */
    }
    
    #heroCarousel .carousel-item {
        height: 300px;
    }
    
    #heroCarousel .hero-section.video-banner,
    #heroCarousel .hero-section.youtube-banner {
        height: 300px;
    }
}

/* Ensure video containers don't interfere */
.video-banner .container,
.youtube-banner .container {
    position: relative;
    z-index: 10;
    pointer-events: none;
}

.video-banner .container *,
.youtube-banner .container * {
    pointer-events: auto;
}

/* Admin and Preview Modal YouTube iframe normal sizing */
#bannerModal iframe[src*="youtube"],
#previewModal iframe[src*="youtube"],
.modal iframe[src*="youtube"] {
    position: relative !important;
    width: 100% !important;
    height: 315px !important; /* Standard YouTube height */
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    border: none;
    margin: 0;
    padding: 0;
}

/* Admin preview containers maintain normal size */
#bannerModal .video-banner,
#bannerModal .youtube-banner,
#previewModal .video-banner,
#previewModal .youtube-banner,
.modal .video-banner,
.modal .youtube-banner {
    height: 315px !important; /* Standard height for admin */
    position: relative;
    overflow: hidden;
}

/* Admin table thumbnails for video banners */
.admin-video-thumbnail {
    width: 120px !important;
    height: 80px !important;
    object-fit: cover !important;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    border-radius: 4px;
}
