/* ==========================================================================
   CTEG Premium Slider Frontend Stylesheet (Updated version 1.1.0)
   ========================================================================== */

:root {
    --cteg-primary: #00345f;
    --cteg-secondary: #c8332e;
    --cteg-accent-blue: #2194f3;
    --cteg-white: #ffffff;
    --cteg-text-light: #e5e7eb;
    --cteg-font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --cteg-transition-speed: 0.3s;
}

/* 1. Reset & Slider Layout Container */
.cteg-slider-parent {
    position: relative;
    width: 100%;
    overflow: hidden;
    font-family: var(--cteg-font);
    background-color: #000;
}

.cteg-slider-container {
    width: 100%;
    /* Chiều cao mặc định (sẽ bị ghi đè bởi style nội tuyến từ admin settings) */
    height: 75vh;
    min-height: 500px;
    max-height: 750px;
}

/* 2. Slide Inner Structure & Background */
.cteg-slide-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Lớp phủ tối chuyển sắc (Overlay Gradient) */
.cteg-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Có thể bị ghi đè hoàn toàn bởi CSS nội tuyến từ admin settings */
    background-image: linear-gradient(
        135deg, 
        rgba(0, 52, 95, 0.85) 0%, 
        rgba(0, 0, 0, 0.5) 45%, 
        rgba(0, 0, 0, 0.85) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* Vùng chứa nội dung chữ */
.cteg-slide-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding-left: 10%;
    padding-right: 5%;
    color: var(--cteg-white);
    text-align: left;
    box-sizing: border-box;
}

/* 3. Typography & Elements Styling */
.cteg-subtitle {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cteg-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 900;
    line-height: 1.15;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    /* Chống tràn chữ ngang trên mọi màn hình */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.cteg-title span {
    display: block;
}

.cteg-title-2 {
    display: inline-block;
}

.cteg-desc {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 0 35px 0;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    /* Chống tràn chữ ngang */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Hệ thống nút hành động */
.cteg-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cteg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--cteg-transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
    border: 2px solid transparent;
}

/* 3.1 Kích thước nút bấm (Button Sizes) */
.cteg-btn-sm {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
}

.cteg-btn-md {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
}

.cteg-btn-lg {
    padding: 16px 36px;
    font-size: 18px;
    font-weight: 700;
}

/* Nút chính (Primary) */
.cteg-btn-primary {
    background-color: var(--cteg-secondary);
    color: var(--cteg-white);
    box-shadow: 0 4px 15px rgba(200, 51, 46, 0.3);
}

.cteg-btn-primary:hover {
    background-color: transparent;
    border-color: var(--cteg-secondary);
    color: var(--cteg-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(200, 51, 46, 0.5);
}

/* Nút phụ (Secondary) */
.cteg-btn-secondary {
    background-color: transparent;
    border-color: var(--cteg-white);
    color: var(--cteg-white);
}

.cteg-btn-secondary:hover {
    background-color: var(--cteg-white);
    color: var(--cteg-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.25);
}

/* 4. Swiper Controls Custom Styling */
.cteg-slider-container .swiper-pagination-bullets {
    bottom: 25px !important;
}

.cteg-slider-container .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all var(--cteg-transition-speed) ease;
    border-radius: 5px;
    margin: 0 6px !important;
}

.cteg-slider-container .swiper-pagination-bullet-active {
    width: 30px;
    background-color: var(--cteg-secondary) !important;
    box-shadow: 0 0 10px rgba(200, 51, 46, 0.8);
}

.cteg-slider-container .swiper-button-prev,
.cteg-slider-container .swiper-button-next {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--cteg-white);
    transition: all var(--cteg-transition-speed) ease;
    backdrop-filter: blur(5px);
}

.cteg-slider-container .swiper-button-prev::after,
.cteg-slider-container .swiper-button-next::after {
    font-size: 16px;
    font-weight: bold;
}

.cteg-slider-container .swiper-button-prev:hover,
.cteg-slider-container .swiper-button-next:hover {
    background-color: var(--cteg-secondary);
    border-color: var(--cteg-secondary);
    box-shadow: 0 0 15px rgba(200, 51, 46, 0.5);
}

/* 5. Tablet & Mobile Responsive Layout */
@media (max-width: 1024px) {
    .cteg-buttons {
        gap: 12px;
        flex-direction: column;
        width: 100%;
        max-width: 280px;
        margin: 0; /* Căn trái cùng với chữ */
    }
    .cteg-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .cteg-slider-container {
        /* Chiều cao tối thiểu bảo vệ nội dung không tràn khối */
        min-height: 450px;
    }

    .cteg-slide-content {
        padding-left: 20px;
        padding-right: 20px;
        text-align: left;
        margin: 0;
        width: 100%;
        max-height: 98%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    .cteg-subtitle {
        font-size: 11px;
        padding: 4px 10px;
        margin-bottom: 12px;
    }

    .cteg-title {
        /* Hạ cỡ chữ tiêu đề trên mobile */
        font-size: clamp(1.4rem, 6.5vw, 1.8rem) !important;
        margin-bottom: 12px;
        line-height: 1.2;
    }

    .cteg-desc {
        /* Hạ cỡ chữ mô tả trên mobile */
        font-size: 13px !important;
        line-height: 1.5;
        margin-bottom: 22px;
        max-width: 100%;
    }

    .cteg-buttons {
        gap: 10px;
        flex-direction: column;
        width: 100%;
        max-width: 250px;
        margin: 0; /* Căn trái */
    }

    /* Thu nhỏ nút và tối ưu khoảng cách trên mobile */
    .cteg-btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
        width: 100%;
    }

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

@media (max-width: 480px) {
    .cteg-slider-container {
        min-height: 420px;
    }
    
    .cteg-slide-content {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .cteg-title {
        font-size: 1.35rem !important;
    }
    
    .cteg-desc {
        font-size: 12px !important;
        margin-bottom: 18px;
    }
}

/* ==========================================================================
   6. Entrance Animation System (Hoạt họa chuyển động)
   ========================================================================== */
.cteg-slider-container .swiper-slide .cteg-subtitle,
.cteg-slider-container .swiper-slide .cteg-title-1,
.cteg-slider-container .swiper-slide .cteg-title-2,
.cteg-slider-container .swiper-slide .cteg-desc,
.cteg-slider-container .swiper-slide .cteg-buttons {
    opacity: 0;
    animation-fill-mode: forwards;
}

.cteg-slider-container .swiper-slide-active .cteg-subtitle {
    animation-name: ctegFadeDown;
    animation-duration: 0.8s;
    animation-delay: 0.3s;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cteg-slider-container .swiper-slide-active .cteg-title-1 {
    animation-name: ctegSlideRight;
    animation-duration: 0.8s;
    animation-delay: 0.5s;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cteg-slider-container .swiper-slide-active .cteg-title-2 {
    animation-name: ctegSlideRight;
    animation-duration: 0.8s;
    animation-delay: 0.7s;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cteg-slider-container .swiper-slide-active .cteg-desc {
    animation-name: ctegFadeUp;
    animation-duration: 0.8s;
    animation-delay: 0.9s;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cteg-slider-container .swiper-slide-active .cteg-buttons {
    animation-name: ctegZoomIn;
    animation-duration: 0.8s;
    animation-delay: 1.1s;
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes ctegFadeDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ctegSlideRight {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ctegFadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ctegZoomIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}