/* General Reset */
body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Navbar */
.navbar {
    width: 100%;
    background-color: rgb(255, 255, 255);
    color: black;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Navbar Logo */
.navbar-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
}

.navbar-logo img {
    height: 40px;
    width: auto;
    margin-right: 10px;
}

.navbar-logo p {
    font-size: 20px;
    font-weight: bold;
    color: darkgreen;
    margin: 0;
    text-transform: uppercase;
}

.navbar-menu {
    display: flex;
    gap: 20px;
}

.navbar-menu a {
    color: darkblue;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar-menu a:hover {
    color: #f39c12;
}

/* Thanh tìm kiếm */
.search-bar {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 10px;
    padding: 5px 10px;
    border: solid 2px darkblue;
    margin-right: 15px; 
}

.search-bar input {
    border: none;
    outline: none;
    background: #fff;
    color: darkblue;
    padding: 5px 10px;
    font-size: 20px;
    width: 200px;
}

.search-bar input::placeholder {
    color: black;
}

.search-bar button {
    border: none;
    background-color: white;
    color: darkblue;
    font-size: 20px;
    cursor: pointer;
    margin-top: 5px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 10px;
    margin: 10px;
    overflow-y: auto;
}

.main-content h1 {
    font-size: 40px;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 10px;
    margin-top: 5px;
    text-align: center;
    text-transform: uppercase;
}

.main-content p {
    font-size: 16px;
    line-height: 1.5;
    color: black;
}

/* Gallery */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Hiển thị 3 cột */
    gap: 10px;
    padding: 10px;
    margin: 0 auto;
    max-width: 100%; /* Giới hạn chiều rộng tổng */
}

/* Gallery Item */
.gallery-item {
    position: relative;
    background-size: cover; /* Lấp đầy toàn bộ khung của item */
    background-position: center; /* Căn giữa ảnh */
    background-repeat: no-repeat;
    border-radius: 8px;
    height: 300px; /* Chiều cao của item */
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


/* Gallery Image */
.gallery-image {
    position: relative;
    width: 100%; /* Ảnh chiếm toàn bộ chiều rộng container */
    height: 100%; /* Ảnh chiếm toàn bộ chiều cao container */
    object-fit: cover; /* Đảm bảo ảnh phủ hết khung */
    border-radius: 8px;
    transition: opacity 1s ease-in-out, filter 1s ease-in-out;
    filter: blur(10px); /* Hiệu ứng blur khi chưa tải */
    opacity: 0; /* Ẩn ảnh khi chưa tải */
}

/* Khi ảnh đã tải xong */
.gallery-image[loading="lazy"]:not([src=""]) {
    opacity: 1;
    filter: blur(0); /* Xóa hiệu ứng blur khi ảnh đã tải */
}

/* Footer */
.footer {
    background-color: cornflowerblue;
    color: #fff;
    padding: 10px 0;
    box-shadow: 0px -2px 5px rgba(0, 0, 0, 0.2);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-shrink: 0;
}

.footer p {
    margin: 0;
}

/* User menu */
.user-menu {
    color: darkblue;
    text-decoration: none;
    padding: 10px;
    font-size: 20px;
    font-weight: bold;
    position: relative;
    cursor: pointer;
    margin-right: 15px;
}

.user-menu:hover {
    color: #f39c12;
}

/* Dropdown menu */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0px;
    background-color: #333;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.dropdown a {
    color: #fff;
    padding: 10px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
}

.dropdown a:hover {
    background-color: #f39c12;
}

/* Hiển thị dropdown khi hover vào user menu hoặc dropdown */
.user-menu:hover + .dropdown,
.dropdown:hover {
    display: block;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s 0s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .search-bar input {
        width: 150px;
    }

    .navbar-menu {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .navbar-menu a {
        text-align: center;
        width: 100%;
    }

    .main-content h1 {
        font-size: 20px;
    }

    .main-content p {
        font-size: 14px;
    }

    .gallery-container {
        grid-template-columns: 1fr 1fr;
    }
}
