/* FullPage.js Custom Styles */

/* Hide default scrollbar - only for fullpage pages */
body.fullpage-active {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Ensure other pages can scroll normally */
body:not(.fullpage-active) {
    overflow: auto;
    height: auto;
}

/* FullPage sections */
body.fp-auto-scrolling .section,
body.fp-scroll-mac .section {
    height: 100vh;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

body.fp-auto-scrolling .section .fp-overflow,
body.fp-scroll-mac .section .fp-overflow {
    height: 100%;
    width: 100%;
}

body:not(.fp-auto-scrolling) .section {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

/* Ẩn hero section trên mobile */
@media (max-width: 768px) {
    .hero-section {
        display: none !important;
    }
}

.section .fp-overflow {
    width: 100%;
}

.section {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fix transform translateY cho hero section và about section */
.hero-section,
.about-section {
    transform: translateY(0) !important; /* Bỏ transform translateY */
}

.hero-section {
    opacity: 1 !important;
}

/* Container và content vẫn hiển thị bình thường */
.hero-section .container,
.hero-section .hero-content,
.hero-section .hero-bg {
    opacity: 1 !important;
}

/* Image LUÔN hiển thị - rule riêng với specificity cao */
.hero-section .hero-bg-image,
.hero-section .slide .hero-bg-image,
.hero-section .slide.active .hero-bg-image,
.hero-section .slide.fp-active .hero-bg-image,
.hero-section .slide:first-child .hero-bg-image,
.hero-section .slide[style*="opacity"] .hero-bg-image {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Image LUÔN hiển thị - rule riêng với specificity cao */
.hero-section .hero-bg-image,
.hero-section .slide .hero-bg-image,
.hero-section .slide.active .hero-bg-image,
.hero-section .slide.fp-active .hero-bg-image,
.hero-section .slide:first-child .hero-bg-image {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ẩn FullPage.js slides */
.hero-section .hero-fp-slides {
    display: none !important;
}

/* Slide mới với fade animation */
.hero-section {
    position: relative !important;
}

.hero-fade-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-fade-slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Tăng thời gian transition lên 1s */
    z-index: 0;
}

.hero-fade-slide-item.active {
    opacity: 1 !important;
    z-index: 1 !important;
}

.hero-fade-slide-bg {
    width: 100%;
    height: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-fade-slide-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.hero-fade-slide-image::before {
    display: none !important; /* Ẩn mask mờ */
}

/* Giữ nguyên FullPage.js slide structure để không ảnh hưởng */
.hero-section .slide {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: stretch;
}

.hero-section .hero-bg {
    flex: 1 1 auto;
    display: flex;
    position: relative !important; /* Cần cho hero-bg-image absolute */
    width: 100%;
    height: 100%;
}

.hero-section .hero-bg > .container,
.hero-section .hero-bg > .container .row,
.hero-section .hero-bg > .container .row > [class*="col-"] {
    height: 100%;
}

.hero-section .hero-bg > .container .row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section .hero-bg > .container .row > [class*="col-"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-section .hero-content {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    display: none !important; /* Ẩn hero-content trong hero section */
}

.hero-section .hero-content .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* About section - CSS cũ đã bị xóa, chỉ giữ transform fix ở trên */

/* Horizontal slides within sections - CHỈ áp dụng cho slides KHÔNG phải hero-section */
.section:not(.hero-section) .slide {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important; /* Animation mượt hơn */
}

/* Windows-style scroll reveal for fullPage */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.section.revealed::before {
    transform: translateY(0);
}

/* CHỈ áp dụng cho sections KHÔNG phải hero-section */
.section:not(.hero-section) .container,
.section:not(.hero-section) .hero-content,
.section:not(.hero-section) .about-content,
.section:not(.hero-section) .about-content-full,
.section:not(.hero-section) .service-card,
.section:not(.hero-section) .news-card,
.section:not(.hero-section) .contact-form-card {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Đảm bảo hero-section slides và image KHÔNG bị ảnh hưởng bởi scroll animation */
.hero-section .slide .hero-bg,
.hero-section .slide .container {
    opacity: 1 !important; /* Luôn hiển thị, không kế thừa opacity từ slide parent */
    transform: none !important;
}

/* Image LUÔN hiển thị bất kể slide parent opacity */
.hero-section .slide .hero-bg-image {
    opacity: 1 !important; /* LUÔN hiển thị, không kế thừa opacity từ parent */
    transform: none !important;
    visibility: visible !important;
    display: block !important;
}

/* Statistics cards - exclude from scroll animation */
.statistics-section .stat-card {
    position: relative;
    z-index: 2;
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
}

.news-section .text-center {
    margin-top: 80px;
}

.contact-section .text-center {
    margin-top: 40px;
}

/* About section - exclude from scroll animation */
.about-section .container,
.about-section .row,
.about-section .col-12,
.about-section .col-lg-6,
.about-section .about-badge,
.about-section .about-title,
.about-section .about-description,
.about-section .about-button,
.about-section .about-image-container {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
}

.section.revealed .container,
.section.revealed .hero-content,
.section.revealed .about-content,
.section.revealed .about-content-full,
.section.revealed .service-card,
.section.revealed .news-card,
.section.revealed .contact-form-card {
    opacity: 1;
    transform: translateY(0);
}

/* Statistics section - always visible */
.statistics-section.revealed .stat-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* CSS cũ cho about-image-full đã bị xóa */



/* Staggered animation for cards */
.section.revealed .service-card:nth-child(1) { transition-delay: 0.1s; }
.section.revealed .service-card:nth-child(2) { transition-delay: 0.2s; }
.section.revealed .service-card:nth-child(3) { transition-delay: 0.3s; }
.section.revealed .news-card:nth-child(1) { transition-delay: 0.1s; }
.section.revealed .news-card:nth-child(2) { transition-delay: 0.2s; }
.section.revealed .news-card:nth-child(3) { transition-delay: 0.3s; }

/* Statistics section animation - Disabled to prevent scroll issues */
.statistics-section .stat-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
}

.statistics-section.revealed .stat-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Hero Section */
.hero-section {
    background: transparent;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    z-index: 1;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.hero-buttons .btn {
    border-radius: 50px;
    padding: 15px 35px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin: 0.5rem;
}

.hero-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* About Section - không cần override background nữa */

.about-image-placeholder {
    height: 500px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 2rem;
    position: relative;
    overflow: hidden;
    border: 2px dashed #dee2e6;
}

.about-image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    z-index: 1;
}

.about-image-placeholder > div {
    position: relative;
    z-index: 2;
}

.about-content .feature-item {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
}

.about-content .feature-item i {
    color: #2c5aa0;
    margin-right: 0.75rem;
}

/* Services Section */
.services-section {
    background-color: #fff;
}

.service-card, .news-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover, .news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.service-image, .news-image {
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
}

.service-card .card-body, .news-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
}

.service-card .card-text, .news-card .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.service-card .d-flex.justify-content-between, .news-card .d-flex.justify-content-between {
    margin-top: auto;
    flex-shrink: 0;
}

/* Button spacing in cards */
.service-card .btn i, .news-card .btn i {
    margin-right: 0.5rem;
}

.service-card .btn, .news-card .btn {
    font-weight: 500;
    transition: all 0.3s ease;
}

.service-card .btn:hover, .news-card .btn:hover {
    transform: translateY(-1px);
}

.service-image img, .news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card:hover .service-image img,
.news-card:hover .news-image img {
    transform: scale(1.1);
}

.service-image-placeholder, .news-image-placeholder {
    height: 220px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.5rem;
    position: relative;
    overflow: hidden;
    border: 2px dashed #dee2e6;
}

.service-image-placeholder::before, .news-image-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    z-index: 1;
}

.service-image-placeholder > div, .news-image-placeholder > div {
    position: relative;
    z-index: 2;
}

/* News Section */
.news-section {
    background-color: #f8f9fa;
}

/* Contact Section */
.contact-section {
    background-color: #fff;
}

.contact-form {
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.map-container {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* FullPage Navigation Dots */
#fp-nav {
    position: fixed;
    z-index: 1000;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#fp-nav ul li {
    margin: 10px 0;
}

#fp-nav ul li a span {
    background: #2c5aa0;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    transition: all 0.3s ease;
}

#fp-nav ul li a.active span,
#fp-nav ul li:hover a span {
    background: #1e3a8a;
    transform: scale(1.2);
}

#fp-nav ul li .fp-tooltip {
    background: #2c5aa0;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .section {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.2rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    
    .about-image-placeholder {
        height: 300px;
        margin-bottom: 2rem;
    }
    
    .contact-form {
        margin-bottom: 2rem;
    }
    
    #fp-nav {
        right: 10px;
    }
    
    #fp-nav ul li a span {
        width: 8px;
        height: 8px;
    }
}

/* Animation delays for staggered effects */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

/* Custom scrollbar for content areas */
.section::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Smooth transitions */
* {
    transition: all 0.3s ease;
}

/* Hover effects for buttons */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Form styling */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

/* Card hover effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Hero Background Image Styles */
.hero-bg-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    z-index: 2 !important;
    opacity: 1 !important; /* LUÔN hiển thị */
    visibility: visible !important;
    display: block !important;
}

.hero-bg-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
    display: none !important; /* Ẩn mask mờ che làm ảnh tối */
}

.hero-content {
    position: relative;
    z-index: 3;
}

/* Slides Navigation Styles */
#fp-nav ul li a span,
.fp-slidesNav ul li a span {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

#fp-nav ul li a.active span,
.fp-slidesNav ul li a.active span {
    background: #007bff;
    border-color: #007bff;
    transform: scale(1.2);
}

#fp-nav ul li a:hover span,
.fp-slidesNav ul li a:hover span {
    background: #007bff;
    border-color: #007bff;
    transform: scale(1.1);
}

/* Slides navigation positioning */
.fp-slidesNav {
    bottom: 30px !important;
    z-index: 1000;
}

.fp-slidesNav ul li {
    margin: 0 8px;
}

/* Override fullPage.js default arrow styles */
.fp-controlArrow.fp-arrow,
.fp-controlArrow.fp-arrow.fp-prev,
.fp-controlArrow.fp-arrow.fp-next {
    display: none !important; /* Ẩn fp-arrow trong hero section */
}

.fp-controlArrow.fp-arrow::before,
.fp-controlArrow.fp-arrow.fp-prev::before,
.fp-controlArrow.fp-arrow.fp-next::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 14px !important;
    content: "" !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: none !important;
}

/* Control arrows for slides - Override fullPage.js default styles */
.fp-controlArrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 50px !important;
    height: 50px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    z-index: 1000 !important;
    backdrop-filter: blur(8px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    text-decoration: none !important;
    outline: none !important;
}

.fp-controlArrow::before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 14px !important;
    content: "" !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: none !important;
}

.fp-controlArrow:hover {
    background: rgba(0, 0, 0, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    color: #007bff !important;
}

.fp-controlArrow:hover::before {
    transform: scale(1.2) !important;
}

.fp-controlArrow:active {
    transform: translateY(-50%) scale(0.95) !important;
    background: rgba(0, 0, 0, 0.6) !important;
}

.fp-controlArrow.fp-prev {
    left: 30px !important;
}

.fp-controlArrow.fp-prev::before {
    content: "\f053" !important; /* fa-chevron-left */
}

.fp-controlArrow.fp-next {
    right: 30px !important;
}

.fp-controlArrow.fp-next::before {
    content: "\f054" !important; /* fa-chevron-right */
}

/* Specific overrides for fp-arrow classes */
.fp-controlArrow.fp-arrow.fp-prev::before {
    content: "\f053" !important; /* fa-chevron-left */
}

.fp-controlArrow.fp-arrow.fp-next::before {
    content: "\f054" !important; /* fa-chevron-right */
}

.fp-controlArrow.fp-arrow.fp-prev {
    left: 30px !important;
}

.fp-controlArrow.fp-arrow.fp-next {
    right: 30px !important;
}

/* Responsive control arrows */
@media (max-width: 768px) {
    .fp-controlArrow {
        width: 45px !important;
        height: 45px !important;
        font-size: 14px !important;
    }
    
    .fp-controlArrow::before {
        font-size: 12px !important;
    }
    
    .fp-controlArrow.fp-prev {
        left: 15px !important;
    }
    
    .fp-controlArrow.fp-next {
        right: 15px !important;
    }
}

@media (max-width: 480px) {
    .fp-controlArrow {
        width: 40px !important;
        height: 40px !important;
        font-size: 12px !important;
    }
    
    .fp-controlArrow::before {
        font-size: 10px !important;
    }
    
    .fp-controlArrow.fp-prev {
        left: 10px !important;
    }
    
    .fp-controlArrow.fp-next {
        right: 10px !important;
    }
}
