/* ====================================================================
   CAROUSEL & SWIPER STYLES
   File: css/carousel.css
   Description: Styles cho carousel/slider components
   ==================================================================== */

/* ===== Swiper Base ===== */
.swiper {
    overflow: hidden;
    position: relative;
}

.swiper-wrapper {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
}

.swiper-slide {
    flex-shrink: 0;
    position: relative;
}

/* ===== Swiper States ===== */
.swiper-slide-active {
    /* Active slide styles */
}

.swiper-slide-prev {
    /* Previous slide styles */
}

.swiper-slide-next {
    /* Next slide styles */
}

/* ===== Navigation Buttons ===== */
.main-button-prev,
.main-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: #C8102E;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.main-button-prev {
    left: 10px;
}

.main-button-next {
    right: 10px;
}

.main-button-prev:hover,
.main-button-next:hover {
    background: #C8102E;
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

.main-button-prev:active,
.main-button-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* ===== Carousel Indicators/Pagination ===== */
.swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet:hover {
    background: rgba(255, 255, 255, 0.8);
}

.swiper-pagination-bullet-active {
    background: white;
    width: 24px;
    border-radius: 5px;
}

/* ===== Featured News Carousel ===== */
.featured-news .swiper {
    border-radius: 8px;
}

.featured-news .swiper-slide {
    height: auto;
}

.featured-news .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Custom Scrollbar for Carousel ===== */
.custom-scrollbar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #C8102E #F5F5F5;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #F5F5F5;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #C8102E;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #A00B26;
}

/* ===== Carousel Types ===== */

/* Main News Carousel */
[data-carousel="main-news"] .swiper-slide {
    width: 100%;
}

/* Website Logos Carousel */
[data-carousel="website-logos"] .swiper-wrapper {
    gap: 16px;
}

@media (min-width: 1024px) {
    [data-carousel="website-logos"] .swiper-slide {
        flex: 0 0 calc((100% - 32px) / 3);
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    [data-carousel="website-logos"] .swiper-slide {
        flex: 0 0 calc((100% - 16px) / 2);
    }
}

@media (max-width: 639px) {
    [data-carousel="website-logos"] .swiper-slide {
        flex: 0 0 100%;
    }
}

/* Image Category Carousel */
[data-carousel="image-category"] .swiper-slide {
    width: 100%;
}

/* Link Banners Carousel */
[data-carousel="link-banners"] {
    position: relative;
}

[data-carousel="link-banners"] .swiper-wrapper {
    gap: 20px;
}

/* Original CSS from 2026.css - data-v-fd8271bf */
[data-v-fd8271bf] .swiper-wrapper,
[data-v-fd8271bf] .swiper {
    height: 80px !important;
}

/* Fix carousel buttons positioning - Let Tailwind handle position */
/* HTML structure: 
   <div class="grid"> ← Cần position: relative
       <h3>Liên kết</h3>
       <div data-v-fd8271bf> ← position: relative
           <div class="swiper">...</div>
           <div class="hidden lg:flex ... absolute top-[-94px] right-0"> ← Buttons
               <svg class="main-button-prev">...</svg>
               <svg class="main-button-next">...</svg>
           </div>
       </div>
   </div>
*/

/* Parent grid needs to be relative for absolute positioning */
.lg\:col-span-8 > .grid-cols-1 {
    position: relative;
}

/* Carousel container also needs relative */
[data-v-fd8271bf][data-carousel="link-banners"] {
    position: relative;
}

/* Navigation buttons - correct size and reset position */
[data-v-fd8271bf] .main-button-prev,
[data-v-fd8271bf] .main-button-next {
    position: static !important; /* Reset absolute positioning */
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    background-color: #C8102E !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    flex-shrink: 0 !important;
    transform: none !important; /* Reset any transform */
    left: auto !important; /* Reset left */
    right: auto !important; /* Reset right */
    top: auto !important; /* Reset top */
}

[data-v-fd8271bf] .main-button-prev:hover,
[data-v-fd8271bf] .main-button-next:hover {
    background-color: #9CA3AF !important;
}

[data-v-fd8271bf] .main-button-prev svg,
[data-v-fd8271bf] .main-button-next svg {
    width: 14px !important;
    height: 14px !important;
}

/* Link banners slider items - match original inline styles */
@media (min-width: 1024px) {
    [data-v-fd8271bf] .swiper-slide {
        flex: 0 0 calc(25% - 15px) !important;
        margin-right: 0px !important;
    }
    
    [data-v-fd8271bf] .swiper-slide:last-child {
        margin-right: 0 !important;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    [data-v-fd8271bf] .swiper-slide {
        flex: 0 0 calc(50% - 10px) !important;
        margin-right: 20px !important;
    }
    
    [data-v-fd8271bf] .swiper-slide:nth-child(2n) {
        margin-right: 0 !important;
    }
}

@media (max-width: 639px) {
    [data-v-fd8271bf] .swiper-slide {
        flex: 0 0 100% !important;
        margin-right: 0 !important;
    }
}

/* ===== Hover Effects ===== */
.swiper-slide:hover {
    z-index: 2;
}

.swiper-slide img {
    transition: transform 0.3s ease;
}

.swiper-slide:hover img {
    transform: scale(1.05);
}

/* ===== Loading State ===== */
.swiper.loading .swiper-wrapper {
    opacity: 0.5;
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
    .main-button-prev,
    .main-button-next {
        width: 32px;
        height: 32px;
    }
    
    .main-button-prev {
        left: 5px;
    }
    
    .main-button-next {
        right: 5px;
    }
}