/* 1. THIẾT LẬP BIẾN MÀU SẮC (Quan trọng cho Idea 4) */
:root {
    --bg-color: #1a1a1a;
    --text-color: #f4f4f4;
    --nav-bg: #000000;
    --accent-color: #d4af37;
    --card-bg: #333;
}

[data-theme="light"] {
    --bg-color: #f9f7f2; /* Trắng kem */
    --text-color: #1a1a1a;
    --nav-bg: #ffffff;
    --accent-color: #8e735b;
    --card-bg: #eceae5;
}

/* 2. RESET & CHUNG */
* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-color) !important;
    color: var(--text-color) !important;
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
/* 3. NAVBAR */
.navbar {
    display: flex;
    justify-content: flex-end; /* Đẩy Menu sang phải, Logo sẽ căn giữa theo position absolute */
    align-items: center;
    padding: 15px 15%;        /* Giữ nguyên padding 15% của bạn */
    background-color: #000;    /* Màu đen đặc lúc ở trên cùng */
    position: fixed;           /* Chuyển từ sticky sang fixed để mượt hơn khi làm gradient */
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.5s ease; /* Hiệu ứng chuyển màu mượt mà */
    box-sizing: border-box;
}

/* Lớp này sẽ tự động thêm vào nhờ JavaScript khi cuộn */
.navbar.scrolled {
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    padding: 15px 15%;        /* Thu gọn nhẹ chiều cao khi cuộn */
    backdrop-filter: blur(3px); /* Làm mờ nhẹ nền ảnh bên dưới */
}

.logo {
    /* Thêm các dòng này để đưa Logo ra chính giữa */
    position: absolute;
    left: 15%;
    transform: translateX(-50%);
    
    font-family: 'Cormorant Upright', serif;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    /* margin-left: auto; không còn cần thiết vì navbar đã là flex-end */
}

.nav-links a {
    font-family: 'Cormorant Upright', serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
    color: #fff;
}
/* Logo */
.logo {
    font-family: 'Cormorant Upright', serif;
    font-size: 2rem;         /* Giảm từ 2.2 xuống 1.4 để nhỏ gọn hơn */
    font-weight: 600;           /* Độ đậm vừa phải */
    letter-spacing: 2px;        /* Khoảng cách chữ vừa đủ sang trọng */
    text-transform: uppercase;
    color: #f4f4f4;
}

.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 0.9rem; text-transform: uppercase; transition: 0.3s; }
.nav-links a:hover { color: #d4af37; /* Màu vàng kim */ }

/* 4. HERO  */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("images/hero.jpg");
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero h1 { font-family: 'Cormorant Upright', serif; font-size: 3rem; margin-bottom: 20px; text-transform: uppercase; }
.btn {
    padding: 10px 30px;
    background-color: #d4af37;
    color: #000;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    display: inline-block;
    margin-top: 20px;
}
.btn:hover { background-color: #fff; }

/* 5. SECTIONS CHUNG */
.section { padding: 80px 5%; }
.container { max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 50px; text-transform: uppercase; letter-spacing: 3px; }

/* About Section */
.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
}
.about-img img {
    width: 100%;
    max-width: 400px;           /* Giới hạn độ rộng tối đa của ảnh chân dung */
    border-radius: 4px;         /* Bo góc nhẹ cho hiện đại */
    display: block;
    margin: 0 auto;             /* Căn giữa ảnh */
}
.about-img img { width: 100%; border-radius: 5px; }
.about-text { flex: 1; min-width: 300px; }
.about-text h2 {
    font-family: 'Cormorant Upright', serif;
    font-size: 1.8rem;         /* Giảm tiêu đề "Về Tôi" xuống */
    color: #d4af37;             /* Màu vàng kim cho điểm nhấn */
    margin-bottom: 15px;
}

.about-text p {
    font-size: 0.95rem;         /* Giảm nhỏ chữ nội dung để tinh tế hơn */
    line-height: 1.8;           /* Tăng khoảng cách dòng cho dễ đọc */
    color: #ccc;                /* Màu xám nhạt để dịu mắt hơn trên nền đen */
    text-align: justify;        /* Căn đều hai bên cho chuyên nghiệp */
}

/* 6. GALLERY */
/* Gallery Section cập nhật tỉ lệ 4:5 */
.gallery-grid {
    display: grid;
    /* Chia làm 3 cột trên máy tính, bạn có thể chỉnh số 3 thành 2 hoặc 4 tùy ý */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 20px; /* Tăng khoảng cách giữa các ảnh cho thoáng */
}

.gallery-item {
    width: 100%;
    /* Thiết lập tỉ lệ khung hình 1080/1350 = 4/5 */
    aspect-ratio: 1080 / 1350; 
    overflow: hidden;
    background-color: #222; /* Nền tối khi ảnh chưa kịp tải */
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    /* Quan trọng: giữ ảnh không bị méo, tự động cắt lề để lấp đầy khung */
    object-fit: cover; 
    /* Căn giữa ảnh trong khung */
    object-position: center; 
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-item:hover img {
    transform: scale(1.05); /* Hiệu ứng phóng to nhẹ khi di chuột */
}
/* 7. CONTACT */
.contact-container { text-align: center; }
.contact-info { margin: 30px 0; }
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.contact-form input, .contact-form textarea {
    padding: 15px;
    background: #333;
    border: none;
    color: #fff;
    outline: none;
}
.contact-form button { width: 125px; align-self: center; }

/* 8. FOOTER */
footer { text-align: center; padding: 20px; background: #000; font-size: 0.8rem; }

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}
.lightbox-content { max-width: 90%; max-height: 90%; }
.close {
    position: absolute;
    top: 20px; right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}
/* Music Button */
.music-container {
    position: fixed;
    bottom: 20px; /* Đưa sát góc hơn một chút */
    left: 20px;
    z-index: 9999;
}

.music-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color); /* Sử dụng biến màu để đổi theo theme */
    
    /* Giảm kích thước xuống (từ 45px xuống 35px) */
    width: 35px; 
    height: 35px;
    
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0; /* Đảm bảo không có đệm làm lệch icon */
}

.music-btn i {
    font-size: 0.9rem; /* Thu nhỏ icon bên trong */
}

.music-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .nav-links { display: none; } /* Ẩn menu trên mobile để đơn giản hóa */
    .hero h1 { font-size: 2rem; }
    .about-container { flex-direction: column; }
}
/* Thêm icon contact */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-bottom: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
}

/* Màu cho các icon */
.contact-item i {
    color: #d4af37; /* Màu vàng kim giống nút bấm */
    font-size: 1.5rem;
    width: 30px; /* Cố định độ rộng để các hàng thẳng cột */
    text-align: center;
}

.contact-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.contact-item a:hover {
    color: #d4af37;
}
/* Responsive nâng cao cho Navbar trên Mobile */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column; /* Xếp Logo và Menu thành 2 hàng dọc */
        padding: 15px 5%;       /* Giảm padding lề cho rộng chỗ */
        justify-content: center;
        height: auto;
    }

    .logo {
        position: static;      /* Bỏ căn giữa tuyệt đối để không đè lên chữ khác */
        transform: none;
        margin-bottom: 15px;    /* Tạo khoảng cách với menu bên dưới */
        font-size: 1.2rem;      /* Giảm nhẹ size chữ logo */
    }

    .nav-links {
        justify-content: center;
        gap: 15px;              /* Thu hẹp khoảng cách giữa các mục menu */
        flex-wrap: wrap;        /* Nếu menu dài quá sẽ tự xuống dòng */
    }

    .nav-links a {
        font-size: 0.9rem;      /* Giảm size chữ menu cho dễ nhìn */
    }
}
/* Responsive nâng cao cho Gallery trên Mobile */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* Chỉ hiện 1 ảnh mỗi hàng cho rõ nét */
        gap: 10px;
    }
    
    .hero h1 {
        font-size: 2.5rem; /* Giảm size tiêu đề lớn trên trang chủ */
    }
}
/* Responsive nâng cao cho About Section trên Mobile */
@media (max-width: 768px) {
    .about-container { /* Giả sử đây là class bao quanh ảnh và chữ */
        flex-direction: column;
        text-align: center;
    }
    
    .about-text {
        padding: 20px 0;
    }
}
/* 6. Nút chuyển đổi giao diện sáng/tối */
.theme-btn {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: 0.3s;
    margin-left: 20px;
}

.theme-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}