/* Main Page Improvements CSS */

/* Mobile Sidebar Fix - Ensure sidebar stays solid white */
aside[x-data] {
    background-color: white !important;
    opacity: 1 !important;
}

/* Ensure sidebar content is not transparent */
aside[x-data] nav,
aside[x-data] nav *,
aside[x-data] button,
aside[x-data] button *,
aside[x-data] a,
aside[x-data] a *,
aside[x-data] div,
aside[x-data] span {
    background-color: transparent !important;
    color: inherit !important;
    opacity: 1 !important;
}

/* Ensure text colors remain visible */
aside[x-data] nav a {
    color: #374151 !important;
}

aside[x-data] nav button {
    color: #374151 !important;
}

aside[x-data] nav .text-gray-600 {
    color: #6b7280 !important;
}

/* Fix header overlap issue - only for pages without banners */
body:not(.homepage):not(.products-page):not(.articles-page):not(.tutorials-page):not(.quiz-page) {
    padding-top: 80px; /* Add padding to prevent header overlap */
}

/* Pages with banners - no padding for seamless banner */
body.homepage,
body.products-page,
body.articles-page,
body.tutorials-page {
    padding-top: 0;
}

/* Quiz page - solid header with padding */
body.quiz-page {
    padding-top: 80px; /* Add padding for solid header */
}

/* Article cards styling - modern clean design */
.article-card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    background: white !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 1.5rem !important;
}

.article-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-4px) !important;
}

.article-card img {
    height: 200px !important;
    width: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease !important;
}

.article-card:hover img {
    transform: scale(1.05) !important;
}

.article-card .p-4 {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 1.5rem !important;
    gap: 1rem !important;
}

.article-card h3 {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin-bottom: 0 !important;
    line-height: 1.4 !important;
    min-height: 2.8em !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.article-card p {
    font-size: 0.9rem !important;
    color: #6b7280 !important;
    line-height: 1.6 !important;
    height: auto !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    text-overflow: ellipsis !important;
    margin-bottom: 0 !important;
    flex: 1 !important;
}

.article-card .article-meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: auto !important;
    padding-top: 1rem !important;
    border-top: 1px solid #f3f4f6 !important;
}

.article-card .article-date {
    font-size: 0.8rem !important;
    color: #9ca3af !important;
    font-weight: 500 !important;
}

/* Article category removed as per user request */

/* Hide scrollbar for articles section */
#info .overflow-x-auto {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

#info .overflow-x-auto::-webkit-scrollbar {
    display: none; /* WebKit */
}

/* See All button styling for articles */
.see-all-articles {
    background: linear-gradient(135deg, #80bdb5, #417972) !important;
    color: white !important;
    padding: 0.75rem 2rem !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    box-shadow: 0 4px 15px rgba(128, 189, 181, 0.3) !important;
}

.see-all-articles:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(128, 189, 181, 0.4) !important;
    color: white !important;
}

/* Best Sellers Auto Slide and Scrollbar Hide */
.best-sellers-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
    /* Enhanced mobile touch support */
    touch-action: pan-x;
}

.best-sellers-container::-webkit-scrollbar {
    display: none; /* WebKit */
}

.best-sellers-slider {
    display: flex;
    will-change: transform;
    backface-visibility: hidden;
    /* Smooth animation properties */
    transition: none;
    animation: none;
    /* Manual drag support */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Enhanced mobile touch support */
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}

.best-sellers-slider:hover {
    /* Hover pause handled by JavaScript */
}

/* Hide scrollbar for best sellers */
#produk .overflow-x-auto {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

#produk .overflow-x-auto::-webkit-scrollbar {
    display: none; /* WebKit */
}

/* Banner positioning improvements */
.adaptive-banner {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white !important; /* Change green box to white */
}

.banner-video,
.banner-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
    max-width: 100%;
}

/* Hide video controls in all browsers including Safari */
.banner-video {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.banner-video::-webkit-media-controls {
    display: none !important;
}

.banner-video::-webkit-media-controls-panel {
    display: none !important;
}

.banner-video::-webkit-media-controls-play-button {
    display: none !important;
}

.banner-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

.banner-video::-webkit-media-controls-timeline {
    display: none !important;
}

.banner-video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.banner-video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.banner-video::-webkit-media-controls-mute-button {
    display: none !important;
}

.banner-video::-webkit-media-controls-volume-slider {
    display: none !important;
}

.banner-video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.banner-video::-webkit-media-controls-toggle-closed-captions-button {
    display: none !important;
}

/* Additional Safari-specific controls hiding */
.banner-video::-webkit-media-controls-overlay-play-button {
    display: none !important;
}

.banner-video::-webkit-media-controls-overlay-enclosure {
    display: none !important;
}

/* Ensure video remains interactive for autoplay and loop */
.banner-video {
    pointer-events: none;
    outline: none;
    border: none;
}

/* Video fallback image styling */
.video-fallback-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

/* Ensure banner video is above fallback when playing */
.banner-video:not([style*="display: none"]) {
    position: relative;
    z-index: 2;
}

/* Firefox controls hiding */
.banner-video::-moz-media-controls {
    display: none !important;
}

/* IE/Edge controls hiding */
.banner-video::-ms-media-controls {
    display: none !important;
}

/* Override for mobile center banners */
.adaptive-banner.mobile-center .banner-video,
.adaptive-banner.mobile-center .banner-image {
    height: 100% !important;
    object-fit: cover !important;
}

/* Ensure banner content stays centered */
.banner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    width: 90%;
    max-width: 800px;
}

/* Long banner slider improvements */
.long-banner-slider {
    position: relative;
    width: 100%;
    background-color: white !important;
}

.long-banner-slider .slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white !important;
}

.long-banner-slider .slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Custom layout full width improvements */
.custom-section.single-image-full img,
.custom-section.double-image-full img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
}

/* Mobile center banner functionality - Fixed height with adaptive cropping (Skintific style) */
@media (max-width: 768px) {
    .adaptive-banner.mobile-center {
        position: relative;
        overflow: hidden;
        height: 500px; /* Increased height for better mobile display */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .adaptive-banner.mobile-center .banner-video,
    .adaptive-banner.mobile-center .banner-image {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: auto !important; /* Maintain original aspect ratio */
        object-fit: cover !important; /* Cover the container with cropping */
        object-position: center !important;
        display: block !important;
    }
    
    .adaptive-banner.mobile-center .banner-content {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Tablet breakpoint - fixed height with cover */
@media (max-width: 992px) and (min-width: 769px) {
    .adaptive-banner.mobile-center {
        height: 650px; /* Further reduced tablet height to prevent cropping */
    }
    .adaptive-banner.mobile-center .banner-video,
    .adaptive-banner.mobile-center .banner-image {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: auto !important;
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* Small mobile devices - smaller fixed height */
@media (max-width: 480px) {
    .adaptive-banner.mobile-center {
        height: 400px; /* Increased small mobile height */
    }
    .adaptive-banner.mobile-center .banner-video,
    .adaptive-banner.mobile-center .banner-image {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: auto !important;
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* Extra small devices - compact fixed height */
@media (max-width: 320px) {
    .adaptive-banner.mobile-center {
        height: 350px; /* Increased extra small mobile height */
    }
    .adaptive-banner.mobile-center .banner-video,
    .adaptive-banner.mobile-center .banner-image {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: auto !important;
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* Responsive adjustments for zoom out */
@media (max-width: 1200px) {
    .banner-video,
    .banner-image {
        object-fit: contain;
    }
    
    /* Override for mobile center banners */
    .adaptive-banner.mobile-center .banner-video,
    .adaptive-banner.mobile-center .banner-image {
        object-fit: cover !important;
    }
    
    .long-banner-slider .slide img {
        object-fit: contain;
    }
}

@media (max-width: 768px) {
    .banner-content {
        width: 95%;
        padding: 1rem;
    }
    
    .banner-content h1 {
        font-size: 1.5rem !important;
    }
    
    .banner-content p {
        font-size: 1rem !important;
    }
}

/* Remove green background from sections - but keep for buttons */
.adaptive-banner.bg-claresta,
section.bg-claresta {
    background-color: white !important;
}

/* Ensure proper centering on zoom out */
.adaptive-banner,
.long-banner-slider {
    margin: 0 auto;
    max-width: 100vw;
    overflow: hidden;
}

/* Best sellers product cards styling */
.best-seller-card {
    min-width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    margin-right: 1.5rem;
    /* Remove conflicting transforms */
    backface-visibility: hidden;
}

.product-duplicate {
    min-width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    margin-right: 1.5rem;
    /* Remove conflicting transforms */
    backface-visibility: hidden;
}

/* Product card styling improvements */
.best-seller-card > div,
.product-duplicate > div {
    border: none !important;
    height: 400px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.best-seller-card img,
.product-duplicate img {
    height: 250px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.best-seller-card .product-image-container,
.product-duplicate .product-image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.best-seller-card .product-image-hover,
.product-duplicate .product-image-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.best-seller-card:hover .product-image-hover,
.product-duplicate:hover .product-image-hover {
    opacity: 1;
}

.best-seller-card .p-4,
.product-duplicate .p-4 {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
}

.best-seller-card h3,
.product-duplicate h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.best-seller-card p,
.product-duplicate p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
    height: 4.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

/* New products styling - same as best sellers */
.new-product-card {
    min-width: 250px;
    max-width: 250px;
    flex-shrink: 0;
    margin-right: 1.5rem;
    backface-visibility: hidden;
}

.new-product-card > div {
    border: none !important;
    height: 400px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.new-product-card img {
    height: 250px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.new-product-card .product-image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.new-product-card .product-image-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.new-product-card:hover .product-image-hover {
    opacity: 1;
}

.new-product-card .p-4 {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
}

.new-product-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.new-product-card p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
    height: 4.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

/* New products container styling - same as best sellers */
.new-products-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
    /* Enhanced mobile touch support */
    touch-action: pan-x;
}

.new-products-container::-webkit-scrollbar {
    display: none; /* WebKit */
}

.new-products-slider {
    display: flex;
    will-change: transform;
    backface-visibility: hidden;
    /* Smooth animation properties */
    transition: none;
    animation: none;
    /* Manual drag support */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Enhanced mobile touch support */
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}

/* Safari-specific video fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    .banner-video {
        -webkit-playsinline: true;
        -webkit-media-controls-start-playback-button: none !important;
    }
}

/* Ensure videos work on all Apple devices */
@supports (-webkit-appearance: none) and (stroke-color: transparent) {
    /* Safari 15+ */
    .banner-video {
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Fallback image transitions */
.video-fallback-image {
    transition: opacity 0.3s ease;
}

.video-fallback-image.active {
    opacity: 1;
}

/* Ensure proper video container sizing */
.adaptive-banner {
    min-height: 200px; /* Minimum height to prevent layout shift */
}

/* Loading state for videos */
.banner-video[poster] {
    background-color: #f3f4f6;
}

/* Hide video controls on all devices */
video::-webkit-media-controls-enclosure {
    display: none !important;
}

video::-webkit-media-controls {
    display: none !important;
}

/* Ensure smooth playback on mobile */
@media (max-width: 768px) {
    .banner-video {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}