/* ==========================================================================
   VĂN NGÂN STUDIO - STYLE THEME 2026
   Tông màu: Quiet Luxury (Midnight Blue & Ocean Blue)
   Phong cách: Glassmorphism, Cinematic, Elegant
   ========================================================================== */

/* --- 1. BIẾN TOÀN CỤC (CSS VARIABLES) --- */
:root {
    /* Bảng màu chính */
    --primary-color: #0f172a; /* Xanh Navy sâu (Midnight) */
    --secondary-color: #1d4ed8; /* Xanh Royal (Ocean) */
    --accent-color: #38bdf8; /* Xanh Sky sáng (Tạo điểm nhấn) */
    
    /* Bảng màu Text & Nền */
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-color: #f8fafc; /* Nền xám xanh cực nhạt, sang trọng hơn trắng tinh */
    
    /* Hiệu ứng Kính (Glassmorphism) */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Font chữ */
    --font-heading: 'Playfair Display', serif; /* Font Tiêu đề cổ điển */
    --font-body: 'Plus Jakarta Sans', sans-serif; /* Font Nội dung hiện đại */
    
    /* Hiệu ứng chuyển động */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* Các class tiện ích */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section-padding { padding: 100px 0; }
.text-center { text-align: center; }

/* --- 3. HIỆU ỨNG LOADING INTRO --- */
#page-loader {
    position: fixed;
    inset: 0;
    background: var(--primary-color);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#page-loader h1 {
    color: white;
    font-family: var(--font-heading);
    font-size: 3.5rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

#page-loader h1 span {
    color: var(--accent-color);
    font-style: italic;
    font-weight: 400;
}

.spinner {
    width: 60px; height: 60px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s infinite cubic-bezier(0.55, 0.15, 0.45, 0.85);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- 4. HEADER & ĐIỀU HƯỚNG (GLASSMORPHISM) --- */
.site-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 0;
    transition: var(--transition-smooth);
}

.site-header.scrolled {
    padding: 12px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    background: rgba(255, 255, 255, 0.95);
}

.header-inner {
    display: flex; justify-content: space-between; align-items: center;
}

.logo h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--primary-color);
    cursor: pointer;
    letter-spacing: 1px;
}

.logo span {
    color: var(--secondary-color);
    font-style: italic;
}

.nav-menu { display: flex; gap: 35px; }

.nav-menu a {
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dark);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--secondary-color);
    transition: 0.3s ease;
}

.nav-menu a:hover::after, .nav-menu a.active::after { width: 100%; }
.nav-menu a:hover, .nav-menu a.active { color: var(--secondary-color); }

.header-actions { display: flex; align-items: center; gap: 15px; }

/* --- 5. NÚT BẤM (BUTTONS) --- */
.btn {
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #0ea5e9);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(29, 78, 216, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* --- 6. HERO SECTION (TRANG CHỦ) --- */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    overflow: hidden;
}

.hero-bg {
    position: absolute; inset: 0;
    background: url('https://images.unsplash.com/photo-1511285560929-80b456fea0bc?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover;
    opacity: 0.5; /* Làm tối ảnh nền để chữ nổi bật */
    mix-blend-mode: luminosity;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 800px;
    padding-top: 80px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 5.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.hero-title span {
    color: var(--accent-color);
    font-style: italic;
    font-weight: 400;
}

.hero-desc {
    font-size: 1.25rem;
    color: #e2e8f0;
    margin-bottom: 40px;
    font-weight: 300;
    animation: fadeInUp 1.2s ease;
    max-width: 650px;
}

.hero-btns { animation: fadeInUp 1.4s ease; display: flex; gap: 20px; }

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

/* --- 7. TIÊU ĐỀ CÁC PHẦN (SECTION TITLES) --- */
.section-header { text-align: center; margin-bottom: 60px; }

.section-subtitle {
    display: inline-block;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 15px;
    position: relative;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--primary-color);
    line-height: 1.2;
}

/* --- 8. DỊCH VỤ CARD --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.service-card {
    background: white;
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.05);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px -12px rgba(29, 78, 216, 0.15);
    border-color: rgba(29, 78, 216, 0.1);
}

.service-icon {
    width: 80px; height: 80px;
    background: #eff6ff;
    color: var(--secondary-color);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin-bottom: 30px;
    transition: 0.4s;
}

.service-card:hover .service-icon {
    background: var(--secondary-color);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.service-card p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1.05rem;
}

/* --- 9. PORTFOLIO (THƯ VIỆN ẢNH) --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.portfolio-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.portfolio-item:nth-child(2n) { aspect-ratio: 4/3; }

.portfolio-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item:hover img { transform: scale(1.08); }

.portfolio-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.4) 50%, transparent 100%);
    opacity: 0;
    transition: 0.5s ease;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 40px 30px;
    color: white;
}

.portfolio-item:hover .portfolio-overlay { opacity: 1; }

.portfolio-overlay span {
    color: var(--accent-color);
    font-size: 0.85rem;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 10px;
    transform: translateY(20px);
    transition: 0.4s 0.1s;
    opacity: 0;
}

.portfolio-overlay h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    transform: translateY(20px);
    transition: 0.4s 0.2s;
    opacity: 0;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay span {
    transform: translateY(0);
    opacity: 1;
}

/* --- 10. STATS COUNTER --- */
.stats-wrapper {
    background: var(--primary-color);
    color: white;
    padding: 100px 0;
    position: relative;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    gap: 30px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    color: var(--accent-color);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 15px;
}

.stat-text {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 600;
}

/* --- 11. MODAL LOGIN & ĐĂNG KÝ --- */
.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    justify-content: center; align-items: center;
}

.modal-content {
    background: white;
    padding: 50px;
    border-radius: 24px;
    width: 100%; max-width: 450px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    animation: modalZoom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalZoom {
    from { transform: scale(0.8) translateY(30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute; top: 25px; right: 25px;
    font-size: 1.5rem; cursor: pointer; color: var(--text-light);
    transition: 0.3s;
}

.close-btn:hover { color: var(--primary-color); transform: rotate(90deg); }

.modal-tabs {
    display: flex; gap: 10px; margin-bottom: 35px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    flex: 1; padding: 12px; background: none; border: none;
    font-weight: 700; font-size: 1.1rem; color: var(--text-light);
    cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: 0.3s;
}

.tab-btn.active { color: var(--secondary-color); border-bottom-color: var(--secondary-color); }
.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.4s; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.input-group { position: relative; margin-bottom: 20px; }
.input-group i {
    position: absolute; left: 20px; top: 50%;
    transform: translateY(-50%); color: var(--secondary-color);
}

.input-group input {
    width: 100%; padding: 16px 16px 16px 55px;
    border: 1px solid #cbd5e1; border-radius: 12px;
    outline: none; background: #f8fafc;
    font-family: var(--font-body); font-size: 1rem;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.1);
}

/* --- 12. FOOTER CHUYÊN NGHIỆP --- */
.site-footer {
    background: var(--primary-color);
    padding: 100px 0 30px;
    color: #94a3b8;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 60px; margin-bottom: 60px;
}

.footer-col h3 {
    color: white; font-family: var(--font-heading);
    font-size: 1.5rem; margin-bottom: 25px;
}

.footer-col ul li { margin-bottom: 15px; }
.footer-col ul li a { transition: 0.3s; display: inline-block; }
.footer-col ul li a:hover { color: var(--accent-color); transform: translateX(5px); }

.social-links { display: flex; gap: 15px; margin-top: 25px; }
.social-links a {
    width: 45px; height: 45px; border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex; align-items: center; justify-content: center;
    color: white; transition: 0.3s;
}

.social-links a:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.4);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px; text-align: center; font-size: 0.95rem;
}

/* ==========================================================================
   TỐI ƯU HÓA GIAO DIỆN ĐIỆN THOẠI & TABLET (RESPONSIVE 2026)
   ========================================================================== */

/* --- Dành cho Máy tính bảng (iPad) --- */
@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* Giảm từ 3 cột xuống 2 cột */
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr); /* Chia footer thành 2 cột */
    }
    .hero-title {
        font-size: 4rem;
    }
}

/* --- Dành cho Điện thoại di động (iPhone, Android) --- */
@media (max-width: 768px) {
    /* 1. Căn lề & khoảng cách */
    .section-padding { padding: 60px 0; }
    .container { padding: 0 15px; }

    /* 2. Header & Thanh Menu */
    .site-header { padding: 10px 0; }
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    .logo h2 { font-size: 1.8rem; }
    
    /* Làm cho menu cuộn ngang trên điện thoại để không bị rối */
    .nav-menu {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 5px;
        gap: 20px;
        white-space: nowrap; /* Chống rớt dòng */
    }
    .nav-menu::-webkit-scrollbar { display: none; } /* Ẩn thanh cuộn cho đẹp */
    .header-actions { width: 100%; justify-content: center; }

    /* 3. Hero Section (Màn hình chính) */
    .hero-content { padding-top: 120px; text-align: center; }
    .hero-title { font-size: 2.8rem; }
    .hero-desc { font-size: 1rem; margin-bottom: 30px; }
    
    /* Các nút bấm xếp chồng lên nhau */
    .hero-btns { flex-direction: column; gap: 15px; width: 100%; }
    .hero-btns .btn { width: 100%; justify-content: center; }

    /* 4. Tiêu đề các mục */
    .section-title { font-size: 2.2rem; }
    .section-subtitle { font-size: 0.8rem; }

    /* 5. Dịch vụ (Chuyển thành 1 cột) */
    .services-grid { grid-template-columns: 1fr; gap: 20px; }
    .service-card { padding: 30px 20px; }

    /* 6. Thống kê (Chuyển thành 2 cột x 2 hàng) */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 15px; }
    .stat-number { font-size: 3rem; }

    /* 7. Thư viện ảnh Portfolio (Chuyển thành 1 cột) */
    .portfolio-grid { grid-template-columns: 1fr; gap: 15px; }
    .portfolio-item, .portfolio-item:nth-child(2n) { aspect-ratio: 4/5; } /* Đưa ảnh về chung 1 tỷ lệ dọc */

    /* 8. Footer (Chuyển thành 1 cột, căn giữa) */
    .footer-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .social-links { justify-content: center; }
    .footer-col ul li { display: flex; justify-content: center; align-items: center; }
    .footer-col ul li i { margin-right: 5px; }

    /* 9. Modal Đăng nhập (Thu gọn vừa màn hình) */
    .modal-content { 
        padding: 30px 20px; 
        margin: 15px; 
        width: 95%; 
    }
}

/* --- Dành cho Điện thoại màn hình rất nhỏ (iPhone SE) --- */
@media (max-width: 480px) {
    .hero-title { font-size: 2.4rem; }
    .stat-number { font-size: 2.5rem; }
    .btn { padding: 12px 20px; font-size: 0.9rem; }
}