/* General Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7f7f7;
}

.logo img {
    width: 120px;
    height: auto;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 100px 20px 60px;
    position: relative;
    color: #fff;
    overflow: hidden;
}

/* Background image with picture element */
.hero-section picture {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

/* Overlay to darken the background */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Dark overlay */
    z-index: -1;
}

.hero-section h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.hero-section p {
    font-size: 20px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

/* Search Box */
.search-box input {
    padding: 12px;
    font-size: 18px;
    border-radius: 25px;
    border: 1px solid #ddd;
    width: 50%;
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.7);
}

/* Horizontal Scrolling Categories */
.category-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 20px;
    gap: 10px;
}

.category-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    white-space: nowrap;
    overflow: hidden; /* Hide the scrollbar */
    width: 100%;
    transition: margin 0.3s ease;
}

/* Selected Category Styling */
.category.selected {
    padding: 6px 14px;
    background-color: #1c1f23;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #fff;
    cursor: pointer;
    transition: all .2s ease-in-out;
    position: relative;
}

/* Unselected Category Styling */
.category {
    padding: 6px 14px;
    background-color: #f7f9fa;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #1c1f23;
    cursor: pointer;
    transition: all .2s ease-in-out;
    position: relative;
}

.category:hover {
    color: #ffffff;
    background-color: #1c1f23;
}

.category-container a {
    text-decoration: none;
}

/* Navigation Arrows */
.arrow-btn {
    width: 32px;
    height: 32px;
    color: #34495e;
    background-color: #fff;
    border: none;
    cursor: pointer;
    padding: 2px;
    text-align: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.arrow-btn:hover {
    background-color: #f0f0f0;
}

/* Image Grid Section */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    margin: 40px;
}

.image-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.image-item img {
    width: 100%;
    height: auto;
    display: block;
}

.image-item .content {
    padding: 15px;
}

.image-item .name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.image-item .categories-list {
    font-size: 14px;
    color: #555;
    margin-top: 5px;
}

.image-item .categories-list span {
    margin-right: 10px;
    margin-bottom: 5px;
    display: inline-block;
    background-color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    width: 90%; /* Set width to 90% of the screen */
    max-width: 800px; /* Max width to prevent too wide modal */
    max-height: 90vh; /* Maximum height should not exceed 80% of the viewport */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box; /* Ensure padding is included in height/width calculations */
    overflow: hidden; /* Prevent scrolling in the modal */
}

/* Button container: Align buttons to the right */
.modal .button-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Download button style */
.modal .download-btn {
    padding: 10px 20px;
    background-color: #1c1f23; /* Dark background color */
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    width: auto; /* Automatically adjust the width based on content */
    max-width: 200px; /* Max width to avoid excessively wide button */
    text-align: center;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal .download-btn:hover {
    background-color: #34495e; /* Lighter shade on hover */
}

/* Close button in the modal footer */
.modal .print-btn {
    padding: 10px 20px;
    background-color: #f7f7f7; /* Red color for close button */
    color: #34495e;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal .print-btn:hover {
    background-color: #CCCCCC; /* Darker red on hover */
}

.modal img {
    width: 100%;
    height: auto;
    object-fit: contain; /* Ensure image resizes while maintaining aspect ratio */
    max-height: 50vh; /* Limit the height of the image to 60% of viewport height */
}

.modal .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    color: #fff;
    background: #9E9E9E;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

/* Responsive Modal Adjustments */
@media (max-width: 600px) {
    .modal-content {
        width: 95%; /* On smaller screens, reduce the width to 95% */
    }

    .modal .close {
        font-size: 25px;
        top: 5px;
        right: 5px;
    }
}

/* Back to Top Button Styling */
.back-to-top-btn {
    position: fixed;
    bottom: 20px; /* Position it 20px from the bottom */
    right: 0; /* Position it 20px from the right */
    cursor: pointer;
    display: none; /* Initially hidden */
    z-index: 1000; /* Make sure it appears on top of other elements */
    opacity: 0.37;
    background: none;
    border: none;
}

.back-to-top-btn:hover {
    opacity: 1;
}


/* footer styling */

footer {
    background-color: #2c3e50;
    color: white;
    padding: 40px 0;
    text-align: center;
}

footer a {
    color: #ccc;
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    text-decoration: underline;
}

/* Privacy Policy Page Styles */
.privacy-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #333;
}

.privacy-page h2 {
    color: #1c1f23;
    margin-top: 30px;
}

.privacy-page p,
.privacy-page ul {
    margin: 15px 0;
    line-height: 1.6;
}

.privacy-page ul {
    padding-left: 20px;
}

.privacy-page a {
    color: #1c1f23;
    text-decoration: underline;
}

.privacy-page a:hover {
    color: #34495e;
}

/* ===== 图片加载占位效果 ===== */
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 565/763;
    overflow: hidden;
    background-image: linear-gradient(90deg, #f5f5f5 25%, #e0e0e0 50%, #f5f5f5 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    cursor: pointer;
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.image-wrapper img.loaded {
    opacity: 1;
}

/* 图片加载完成后移除占位效果 */
.image-wrapper.loaded {
    background-image: none;
    animation: none;
}

/* ===== 错误状态处理 ===== */
.image-wrapper.error {
    background: #ffecec url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ff6b6b"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>') center/50px no-repeat;
    animation: none;
}

/* ===== 空状态提示 ===== */
.empty-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    display: none;
}

.empty-images.show {
    display: block;
}

.empty-images svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-images p {
    color: #666;
    font-size: 18px;
    margin-top: 10px;
}