/* CSS Tùy chỉnh */

/* --- Biến và Cài đặt chung --- */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --body-font: 'Poppins', sans-serif;
    --body-color: #555;
}

html { scroll-behavior: smooth; }
body { font-family: var(--body-font); color: var(--body-color); padding-top: 120px; /* Khoảng đệm cho header mới */ }

/* --- Preloader --- */
#preloader { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: #fff; z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.75s ease-out; }
#preloader.loaded { opacity: 0; pointer-events: none; }
.preloader-container { position: relative; display: flex; justify-content: center; align-items: center; }
.preloader-logo-img { width: 80px; height: auto; }
.spinner { position: absolute; width: 120px; height: 120px; border: 4px solid var(--primary-color); border-top-color: transparent; border-bottom-color: transparent; border-radius: 50%; animation: spin 1.5s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Header & Navbar mới --- */
.navbar { padding-top: 1rem; padding-bottom: 1rem; transition: all 0.4s ease-in-out; }
.navbar-brand { position: absolute; left: 50%; transform: translateX(-50%); top: 10px; background: #fff; padding: 15px 25px; border-radius: 50%; box-shadow: 0 5px 15px rgba(0,0,0,0.1); z-index: 100; transition: all 0.4s ease-in-out; }
.navbar-brand img { height: 120px; transition: height 0.4s ease-in-out; }
.nav-link {
    color: #fff;
    font-weight: 600;
    padding: 8px 18px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #000;
    background-color: rgba(255, 255, 255, 0.25);
}
.navbar.navbar-scrolled { background-color: #fff; padding-top: 0.5rem; padding-bottom: 0.5rem; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.navbar.navbar-scrolled .navbar-brand { top: 5px; padding: 5px 15px; }
.navbar.navbar-scrolled .navbar-brand img { height: 60px; }
.navbar.navbar-scrolled .nav-link {
    color: var(--dark-color); /* Chữ đen trên nền trắng */
    text-shadow: none;
    background-color: transparent;
    border-color: transparent;
}

.navbar.navbar-scrolled .nav-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.navbar.navbar-scrolled .nav-link.active {
    color: var(--primary-color);
    font-weight: 700;
    background-color: var(--light-color);
}

/* --- Counters, Reveal Effects --- */
#counters h3 { font-size: 2.5rem; color: var(--primary-color); }
.reveal { opacity: 0; transform: translateY(50px); transition: all 1s ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* --- Khu vực Hero (Slider) --- */
.hero-swiper { width: 100%; height: 100vh; }
.hero-slide { display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; position: relative; }
.hero-slide::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); }
.hero-slide h1, .hero-slide p { position: relative; text-shadow: 0px 0px 12px rgba(0, 0, 0, 0.8); }
.hero-slide .btn-primary { box-shadow: 0 0 20px rgba(255, 255, 255, 0.4); transition: all 0.3s ease; }
.hero-slide .btn-primary:hover { transform: translateY(-3px); box-shadow: 0 5px 25px rgba(255, 255, 255, 0.6); }

/* --- Dịch vụ (Tabs) --- */
.service-tabs .nav-link { text-align: left; padding: 15px; margin-bottom: 10px; border: 1px solid #000; border-radius: .375rem; color: var(--dark-color); font-weight: 600; transition: all 0.3s ease; }
.service-tabs .nav-link.active, .service-tabs .nav-link:hover { background-color: var(--primary-color); color: #000; border-color: var(--primary-color); transform: translateX(10px); }
.service-tabs .nav-link.active::after, .service-tabs .nav-link:hover::after { width: 0; }
.tab-content p { line-height: 1.8; }

/* --- Dự án (Swiper Slider) --- */
.project-swiper { width: 100%; padding-top: 20px; padding-bottom: 50px; }
.project-swiper .swiper-slide { width: auto; }
.project-swiper .card { margin: 0 10px; transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; }
.project-swiper .card:hover { transform: scale(1.05); box-shadow: 0 15px 25px rgba(0,0,0,0.12); }
.swiper-pagination-bullet-active { background-color: var(--primary-color) !important; }
.swiper-button-next, .swiper-button-prev { color: var(--primary-color) !important; background-color: rgba(255, 255, 255, 0.8); border-radius: 50%; width: 44px; height: 44px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.swiper-button-next:after, .swiper-button-prev:after { font-size: 18px !important; font-weight: bold; }

/* --- Đối tác & Khách hàng (Lưới mới) --- */
.partner-grid-logo {
    height: 45px;
    width: 100%;
    filter: grayscale(100%);
    opacity: 0.7;
    object-fit: contain;
    transition: all 0.3s ease;
}
.partner-grid-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* --- Văn phòng - Cải tiến --- */
.office-filter-btn { 
    text-decoration: none; 
    color: var(--secondary-color); 
    padding: 8px 16px; 
    margin: 0 5px; 
    font-weight: 600; 
    border: 2px solid transparent;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: rgba(248, 249, 250, 0.8);
}
.office-filter-btn:hover { 
    color: var(--primary-color);
    background: rgba(13, 110, 253, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
.office-filter-btn.active { 
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

/* Office List Items */
#office-list .list-group-item { 
    cursor: pointer; 
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 8px;
    border-radius: 10px !important;
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#office-list .list-group-item:hover { 
    background: rgba(13, 110, 253, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

#office-list .list-group-item.active { 
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.3);
    border-color: var(--primary-color);
}

#office-list .list-group-item.active .text-muted {
    color: rgba(255,255,255,0.8) !important;
}

#office-list .list-group-item.active .text-primary {
    color: rgba(255,255,255,0.9) !important;
}

/* Office Icons */
.office-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.office-item.active .office-icon {
    background: rgba(255,255,255,0.2);
}

/* Map Container Improvements */
.map-container { 
    overflow: hidden; 
    height: 450px;
    border-radius: 15px;
    position: relative;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-container:hover::before {
    opacity: 1;
}

#office-map {
    border-radius: 15px;
    transition: all 0.3s ease;
    filter: brightness(1.05) contrast(1.02);
}

/* Map Loading Animation */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(255,255,255,0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
}

.map-loading .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

/* Smooth transitions for office section */
#offices {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .office-filter-btn {
        padding: 6px 12px;
        font-size: 14px;
        margin: 2px;
    }
    
    .map-container {
        height: 300px;
        margin-top: 20px;
    }
    
    #office-list .list-group-item {
        padding: 12px;
    }
}

/* --- Liên hệ --- */
.contact-info p { font-size: 1.1rem; margin-bottom: 1.5rem; }

/* --- Các style chung khác --- */
h2 { font-weight: 600; }
section { padding: 80px 0; }
.bg-light { background-color: #f8f9fa !important; }
.card-img-top { height: 200px; object-fit: cover; }
.footer a { text-decoration: none; transition: color 0.3s; }
.footer a:hover { color: var(--primary-color) !important; text-decoration: underline; }
