/*
 * Ngoc Lan Cable Knowledge Slider - Avatar + Text Box Layout
 * 
 * File CSS này đã được thiết kế hoàn toàn mới cho layout avatar + text box.
 * Layout: Avatar vuông bên trái + Text content box bên phải với 6 responsive breakpoints chi tiết.
 * 
 * Mobile-first approach với progressive enhancement.
 * 
 * @package NgocLanCable
 * @subpackage KnowledgeSlider
 * @since 3.0.0 - Avatar + Text Box Layout
 */

/* ==========================================================================
   MAIN BANNER STRUCTURE VÀ FULLWIDTH LAYOUT (Giữ nguyên cấu trúc cũ)
   ========================================================================== */

.kienthuc-banner-wrapper {
    position: relative;
    width: 100vw !important;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 100vw;
    overflow: hidden;
    margin-bottom: 30px;
}

.kienthuc-banner {
    position: relative;
    height: 180px; /* Base height cho mobile portrait */
    overflow: hidden;
    background-color: transparent;
}

/* ==========================================================================
   BACKGROUND IMAGE FOUNDATION (Giữ nguyên)
   ========================================================================== */

.banner-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* ==========================================================================
   SLIDER CONTAINER VÀ LAYOUT SYSTEM (Enhanced cho Avatar + Text Box)
   ========================================================================== */

.slider-container {
    position: absolute;
    top: 50%; /* CENTER VERTICALLY */
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    transform: translateY(-50%); /* Perfect center */
}

.kienthuc-slider {
    width: 95%;
    height: 85%;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
}

.swiper-slide {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    opacity: 1 !important; /* Force visibility */
    transform: translateX(0) !important; /* Reset transforms */
}

.swiper-slide-active .slide-content-box {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.swiper-slide:not(.swiper-slide-active) .slide-content-box {
    opacity: 0.7; /* Slightly fade non-active slides */
}

/* ==========================================================================
   ENHANCED CLICKABLE LINK FUNCTIONALITY
   ========================================================================== */

.slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    border: none;
    outline: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.slide-link:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.slide-link:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

.slide-link:active {
    transform: scale(0.98);
}

/* ==========================================================================
   SLIDE CONTENT CONTAINER - COMBINED AVATAR + TEXT BOX
   ========================================================================== */

.slide-content-box {
    width: 100%;
    max-width: 500px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 auto; /* CENTER THE BOX */
    
    /* Combined background đen cho avatar + text */
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    
    /* Layout: Avatar bên trái + text bên phải */
    flex-direction: row;
    gap: 15px;
    
    /* Smooth transitions */
    transition: all 0.3s ease;
}

/* ==========================================================================
   AVATAR CONTAINER - BÊN TRÁI
   ========================================================================== */

.slide-avatar-container {
    flex-shrink: 0; /* Không co lại */
    width: 60px;
    height: 60px;
    border-radius: 8px; /* Bo 4 góc  */
    overflow: hidden;
    
    /* Subtle border */
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    
    /* GPU acceleration */
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.3s ease;
}

.slide-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 4px; /* Slightly smaller radius cho inner image */
    transition: transform 0.3s ease;
}

/* ==========================================================================
   TEXT CONTENT - BÊN PHẢI, CANH TRÁI
   ========================================================================== */

.slide-text-content {
    flex: 1; /* Chiếm phần còn lại */
    color: #ffffff;
    text-align: left; /* CANH TRÁI */
}

/* ==========================================================================
   TYPOGRAPHY SYSTEM - CANH TRÁI VÀ RESPONSIVE
   ========================================================================== */

.slide-subtitle {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 8px 0;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.02em;
    text-align: left; /* CANH TRÁI */
}

.slide-description {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    color: #f0f0f0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    opacity: 0.95;
    text-align: left; /* CANH TRÁI */
}

/* ==========================================================================
   SWIPER PAGINATION STYLING
   ========================================================================== */

.swiper-pagination {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    z-index: 10;
}

.swiper-pagination-bullet {
    width: 12px !important;
    height: 12px !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    margin: 0 4px !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
}

.swiper-pagination-bullet-active {
    background: #ffffff !important;
    border-color: #ffffff !important;
    transform: scale(1.2) !important;
}

/* ==========================================================================
   SWIPER NAVIGATION HIDING (Updated)
   ========================================================================== */

.kienthuc-slider .swiper-button-next,
.kienthuc-slider .swiper-button-prev {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS - MOBILE-FIRST APPROACH
   ========================================================================== */

/* ==========================================================================
   ENHANCED HOVER EFFECTS
   ========================================================================== */

.slide-link:hover .slide-content-box {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/*.slide-link:hover .slide-avatar-container {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slide-link:hover .slide-avatar {
    transform: scale(1.1);
}*/

/* ==========================================================================
   RESPONSIVE BREAKPOINTS - AVATAR + TEXT BOX LAYOUT
   ========================================================================== */

/* ==========================================================================
   BREAKPOINT 2: Mobile Landscape / Small Tablet (550px - 767px)
   ========================================================================== */

@media screen and (min-width: 550px) and (max-width: 767px) {
    .kienthuc-banner {
        height: 200px;
    }
    
    .slide-content-box {
        max-width: 600px;
        padding: 18px;
        gap: 18px;
		margin-top: 15px;
    }
    
    .slide-avatar-container {
        width: 70px;
        height: 70px;
        border-radius: 10px; /* Slightly larger radius cho mobile landscape */
    }
    
    .slide-avatar {
        border-radius: 6px;
    }
    
    .slide-subtitle {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .slide-description {
        font-size: 13px;
        line-height: 1.4;
    }
}

/* ==========================================================================
   BREAKPOINT 3: Tablet Portrait (768px - 1023px)
   ========================================================================== */

@media screen and (min-width: 768px) and (max-width: 1023px) {
    .kienthuc-banner {
        height: 220px;
    }
    
    .slide-content-box {
        max-width: 700px;
        padding: 20px;
        gap: 20px;
        border-radius: 12px;
		margin-top: 25px;
    }
    
    .slide-avatar-container {
        width: 80px;
        height: 80px;
        border-width: 4px;
        border-radius: 12px; /* Larger radius cho tablet */
    }
    
    .slide-avatar {
        border-radius: 8px;
    }
    
    .slide-subtitle {
        font-size: 16px;
        margin-bottom: 12px;
        font-weight: 700;
    }
    
    .slide-description {
        font-size: 14px;
        line-height: 1.5;
    }
}

/* ==========================================================================
   BREAKPOINT 4: Tablet Landscape / Small Desktop (1024px - 1199px)
   ========================================================================== */

@media screen and (min-width: 1024px) and (max-width: 1199px) {
    .kienthuc-banner {
        height: 250px;
    }
    
    .slide-content-box {
        max-width: 800px;
        padding: 25px;
        gap: 25px;
        border-radius: 14px;
		margin-top: 30px;
    }
    
    .slide-avatar-container {
        width: 90px;
        height: 90px;
        border-width: 4px;
        border-radius: 14px; /* Larger radius cho tablet landscape */
    }
    
    .slide-avatar {
        border-radius: 10px;
    }
    
    .slide-subtitle {
        font-size: 18px;
        margin-bottom: 14px;
        font-weight: 700;
    }
    
    .slide-description {
        font-size: 15px;
        line-height: 1.5;
    }
}

/* ==========================================================================
   BREAKPOINT 5: Desktop (1200px - 1439px)
   ========================================================================== */

@media screen and (min-width: 1200px) and (max-width: 1439px) {
    .kienthuc-banner {
        height: 280px;
    }
    
    .slide-content-box {
        max-width: 900px;
        padding: 30px;
        gap: 30px;
        border-radius: 16px;
		margin-top: 35px;
    }
    
    .slide-avatar-container {
        width: 100px;
        height: 100px;
        border-width: 5px;
        border-radius: 16px; /* Desktop radius */
    }
    
    .slide-avatar {
        border-radius: 12px;
    }
    
    .slide-subtitle {
        font-size: 20px;
        margin-bottom: 16px;
        font-weight: 700;
    }
    
    .slide-description {
        font-size: 16px;
        line-height: 1.6;
        font-weight: 300;
    }
    
    /* Enhanced hover effects cho desktop */
    .slide-link:hover .slide-content-box {
        transform: translateY(-4px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    }
}

/* ==========================================================================
   BREAKPOINT 6: Large Desktop (1440px+)
   ========================================================================== */

@media screen and (min-width: 1440px) {
    .kienthuc-banner {
        height: 300px;
    }
    
    .slide-content-box {
        max-width: 1000px;
        padding: 35px;
        gap: 35px;
        border-radius: 18px;
		margin-top: 35px;
    }
    
    .slide-avatar-container {
        width: 110px;
        height: 110px;
        border-width: 5px;
        border-radius: 18px; /* Large desktop radius */
    }
    
    .slide-avatar {
        border-radius: 14px;
    }
    
    .slide-subtitle {
        font-size: 22px;
        margin-bottom: 18px;
        font-weight: 700;
    }
    
    .slide-description {
        font-size: 18px;
        line-height: 1.6;
        font-weight: 300;
    }
    
    /* Premium effects cho large desktop */
    .slide-link:hover .slide-content-box {
        transform: translateY(-6px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
        background: rgba(0, 0, 0, 0.85);
    }
    
 /*   .slide-link:hover .slide-avatar-container {
        transform: scale(1.08);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    }*/
}

/* ==========================================================================
   ANIMATION SYSTEM VÀ TRANSITIONS
   ========================================================================== */

/* Fade in animation cho slide content */
@keyframes slideContentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation cho các elements */
.slide-avatar-container {
    animation: slideContentFadeIn 0.8s ease-out 0.1s both;
}

.slide-subtitle {
    animation: slideContentFadeIn 0.8s ease-out 0.2s both;
}

.slide-description {
    animation: slideContentFadeIn 0.8s ease-out 0.3s both;
}

/* ==========================================================================
   ACCESSIBILITY VÀ INTERACTION ENHANCEMENTS
   ========================================================================== */

/* Reduced motion preferences compliance */
@media (prefers-reduced-motion: reduce) {
    .slide-avatar-container,
    .slide-subtitle,
    .slide-description {
        animation: none;
    }
    
    .slide-link,
    .slide-text-box,
    .slide-avatar {
        transition: none;
    }
    
    .slide-link:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .slide-link:hover .slide-text-box,
    .slide-link:hover .slide-avatar-container {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .slide-text-box {
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #ffffff;
    }
    
    .slide-subtitle,
    .slide-description {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
        color: #ffffff;
    }
    
    .slide-avatar-container {
        border-color: #ffffff;
        border-width: 4px;
    }
    
    .slide-link:focus {
        outline: 4px solid #ffffff;
        outline-offset: 3px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .slide-link:hover {
        transform: none;
        box-shadow: none;
    }
    
    .slide-link:hover .slide-text-box {
        background: rgba(0, 0, 0, 0.7);
        transform: none;
    }
    
    .slide-link:hover .slide-avatar-container {
        transform: none;
    }
    
    .slide-link:active {
        transform: scale(0.95);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    
    .slide-link:active .slide-text-box {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS VÀ GPU ACCELERATION
   ========================================================================== */

.slide-link {
    will-change: transform;
    backface-visibility: hidden;
}

.slide-text-box {
    will-change: background, transform;
    contain: layout style paint;
}

.slide-avatar-container {
    will-change: transform;
    contain: layout style;
}

.slide-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

/* ==========================================================================
   BROWSER-SPECIFIC COMPATIBILITY FIXES
   ========================================================================== */

/* Safari-specific optimizations */
@supports (-webkit-appearance: none) {
    .kienthuc-banner {
        transform: translateZ(0);
    }
    
    .slide-text-box {
        -webkit-backdrop-filter: blur(10px);
        -webkit-backface-visibility: hidden;
    }
}

/* Firefox-specific optimizations */
@-moz-document url-prefix() {
    .slide-avatar {
        image-rendering: -moz-crisp-edges;
    }
    
    .slide-text-box {
        background-attachment: scroll;
    }
}

/* Edge-specific fixes */
@supports (-ms-ime-align: auto) {
    .slide-content {
        display: -ms-flexbox;
        -ms-flex-direction: column;
        -ms-flex-align: center;
        -ms-flex-pack: center;
    }
}