/* =========================================
   BMT DIGITAL HUB - MASTER STYLESHEET
   Slogan: Chu toàn trong từng dòng code.
========================================= */

/* --- 1. BIẾN TOÀN CỤC (VARIABLES) --- */
:root {
    --bg-color: #fbfbfd;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --accent-color: #0066cc;
    --nav-height: 60px; /* Tăng nhẹ cho thanh menu thoáng hơn */
}

/* --- 2. RESET & SETUP CƠ BẢN --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body, html {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden; /* Chống lỗi trượt ngang trên điện thoại */
    width: 100%;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* --- 3. HEADER & THANH ĐIỀU HƯỚNG --- */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: fixed; 
    top: 0; 
    width: 100%; 
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-wrapper { 
    display: flex; 
    justify-content: space-between; /* Đẩy Logo qua trái, Cụm Icon qua phải */
    align-items: center; 
    height: var(--nav-height); 
}

/* --- 3.1. LOGO TÙY BIẾN --- */
.logo a { 
    font-weight: 800; 
    font-size: 20px; 
    transition: 0.3s; 
    text-decoration: none; 
    color: var(--text-main); 
}
.logo span { color: var(--accent-color); }
.logo .hub-text { 
    transition: opacity 0.3s, transform 0.3s; 
    display: inline-block; 
}
.logo:hover .hub-text { 
    opacity: 0; 
    transform: translateX(10px); 
}

/* --- 3.2. MENU CHÍNH (DESKTOP) --- */
.main-nav { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    list-style: none; 
    gap: 40px; 
}
.main-nav a { 
    text-decoration: none; 
    color: var(--text-main); 
    font-size: 14px; 
    font-weight: 500; 
    transition: 0.3s;
}
.main-nav a:hover { color: var(--accent-color); }

/* --- 3.3. CỤM ICON BÊN PHẢI & DROPDOWN --- */
.right-elements {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-actions { 
    display: flex; 
    gap: 20px; 
    align-items: center; 
}
.action-item { position: relative; }
.action-icon { 
    font-size: 18px; 
    text-decoration: none; 
    cursor: pointer; 
    transition: 0.2s; 
}
.action-icon:hover { transform: scale(1.2); }

.action-dropdown {
    position: absolute; 
    top: 45px; 
    right: -10px; 
    width: 250px;
    background: #fff; 
    padding: 20px; 
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.action-dropdown.show { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}
.search-input { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    outline: none; 
}

/* --- 4. MEGA MENU (DESKTOP) --- */
.mega-menu-container {
    position: absolute; 
    top: var(--nav-height); 
    left: 0; 
    width: 100%;
    background: rgba(255, 255, 255, 0.98); 
    backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    height: 0; 
    overflow: hidden;
}
.mega-menu-container.show { opacity: 1; visibility: visible; transform: translateY(0); height: 300px; }
.mega-panel { position: absolute; top: 0; left: 0; width: 100%; padding: 40px 0; opacity: 0; visibility: hidden; transform: translateX(20px); transition: all 0.3s ease; }
.mega-panel.active { opacity: 1; visibility: visible; transform: translateX(0); transition-delay: 0.1s; }
.mega-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.column h3 { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; text-transform: uppercase; }
.column a { display: block; margin-bottom: 12px; font-size: 14px; color: #333; text-decoration: none; transition: 0.2s;}
.column a.big-link { font-size: 24px; font-weight: 600; color: var(--text-main); margin-bottom: 15px; }
.column a:hover { color: var(--accent-color); padding-left: 5px;}

.menu-overlay {
    position: fixed; top: var(--nav-height); left: 0; width: 100%; height: 100vh;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(5px);
    opacity: 0; visibility: hidden; z-index: 999; transition: all 0.4s ease;
}
.menu-overlay.show { opacity: 1; visibility: visible; }

/* --- 5. HERO & NÚT BẤM --- */
.hero {
    height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    text-align: center; 
    background: linear-gradient(180deg, #fbfbfd 0%, #e5e5ea 100%);
}
.hero h1 { font-size: 4rem; font-weight: 800; margin-bottom: 20px; letter-spacing: -1px;}
.hero p { font-size: 1.2rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; }
.btn-primary {
    background: var(--text-main); color: #fff; padding: 14px 30px; 
    border-radius: 30px; text-decoration: none; font-weight: 600; border: none; cursor: pointer;
    transition: transform 0.2s, background 0.2s; display: inline-block;
}
.btn-primary:hover { transform: scale(1.05); background: #000; }

/* --- 6. SERVICES & THẺ GLASSMORPHISM --- */
.services-section, .contact-section { padding: 100px 0; background: #1d1d1f; color: #fff; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 60px; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

.glass {
    background: rgba(255, 255, 255, 0.05); 
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 20px; 
    padding: 40px; 
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.glass:hover { transform: translateY(-10px); background: rgba(255, 255, 255, 0.08); box-shadow: 0 15px 40px rgba(0,0,0,0.4); }
.glass .icon { font-size: 3rem; margin-bottom: 20px; }

/* --- 7. FORM LIÊN HỆ --- */
.form-container { max-width: 500px; margin: 0 auto; text-align: center; }
form { display: flex; flex-direction: column; gap: 15px; }
input { padding: 15px; border-radius: 10px; border: none; outline: none; background: rgba(255,255,255,0.9); font-family: 'Inter', sans-serif; }
.feedback-text { margin-top: 15px; color: #34c759; font-weight: 600; }

/* --- 8. HIỆU ỨNG CUỘN (APPLE REVEAL) --- */
.apple-reveal { opacity: 0; transform: translateY(40px); filter: blur(5px); transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.apple-reveal.active { opacity: 1; transform: translateY(0); filter: blur(0); }
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* =========================================
   9. MOBILE RESPONSIVE (TỐI ƯU TUYỆT ĐỐI)
========================================= */
.mobile-toggle { display: none; } /* Ẩn trên máy tính */

@media (max-width: 768px) {
    /* Thu nhỏ chữ cho vừa màn hình */
    .hero h1 { font-size: 2.2rem; line-height: 1.2; padding: 0 10px; }
    .hero p { font-size: 1rem; padding: 0 15px; }
    
    /* Canh chỉnh lại khoảng cách trên Mobile */
    .services-grid { grid-template-columns: 1fr; padding: 0 15px; gap: 20px; }
    .glass { padding: 25px; }
    .form-container { padding: 0 15px; }

    /* NÚT HAMBURGER (Hiển thị & Cấu hình) */
    .mobile-toggle { 
        display: flex; 
        flex-direction: column; 
        justify-content: center;
        align-items: center;
        cursor: pointer; 
        z-index: 1001; 
        width: 24px; 
        height: 24px; 
        position: relative; 
    }
    
    /* 2 Gạch mặc định */
    .mobile-toggle .line { 
        width: 100%; 
        height: 2px; 
        background: var(--text-main); 
        position: absolute; 
        left: 0;
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.3s ease; 
    }
    .mobile-toggle .line:nth-child(1) { top: 30%; transform: translateY(-50%); }
    .mobile-toggle .line:nth-child(2) { top: 70%; transform: translateY(-50%); }

    /* Khi bấm Mở -> Biến thành dấu X chuẩn xác */
    .mobile-toggle.active .line:nth-child(1) { 
        top: 50%; 
        transform: translateY(-50%) rotate(45deg); 
    }
    .mobile-toggle.active .line:nth-child(2) { 
        top: 50%; 
        transform: translateY(-50%) rotate(-45deg); 
    }
    
    /* MENU MỞ RỘNG TRÊN MOBILE */
   /* MENU MỞ RỘNG TRÊN MOBILE (Đã đồng bộ màu sáng Glassmorphism) */
    .main-nav {
        position: fixed; 
        top: var(--nav-height); 
        left: 0; 
        width: 100%; 
        height: calc(100vh - var(--nav-height)); 
        background: rgba(255, 255, 255, 0.95); /* Đổi từ Đen (0,0,0) sang Trắng sáng (255,255,255) */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px); /* Cho mượt trên cả iPhone */
        flex-direction: column; 
        justify-content: flex-start; 
        padding-top: 40px;
        opacity: 0; 
        visibility: hidden; 
        transform: translateY(-20px);
        transition: all 0.4s ease; 
        z-index: 999;
    }
    
    .main-nav.mobile-active { opacity: 1; visibility: visible; transform: translateY(0); }
    .main-nav.mobile-active .nav-item { width: 100%; text-align: center; }
    
    .main-nav.mobile-active .nav-item a { 
        color: var(--text-main); /* Đổi chữ từ trắng sang màu chữ mặc định (tối) */
        font-size: 20px; 
        font-weight: 600; 
        padding: 20px; 
        border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Vạch kẻ ngăn cách đổi sang xám nhạt */
        display: block;
    }
    
    /* Ẩn Mega Menu trên đt vì đã có Menu ngang */
    .mega-menu-container { display: none !important; }
}