/* Base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #333333;
    width: 100%;
    height: 100%;
    scroll-behavior: smooth;
}

/* Loading screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out;
}

.loading-logo {
    width: 120px;
    height: auto;
    animation: pulse 1.5s infinite ease-in-out;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 18px;
    letter-spacing: 1px;
    margin-top: 15px;
    color: #333333;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

.loading-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Main content initially hidden */
#page-content {
    opacity: 0;
    transition: opacity 0.8s ease;
}

#page-content.visible {
    opacity: 1;
}

/* Header */
header {
    background-color: #ffffff;
    position: relative;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.logo img {
    height: 60px;
    width: auto;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0 0.5rem 0;
}

.site-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #666;
}

/* Main content */
#main-content {
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    overflow: hidden;
}

/* Image grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 0 1rem 2rem 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background-color: #f5f5f5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-image-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(10px);
    transform: scale(1.1); /* Slightly larger to avoid blur edges showing */
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 2;
}

.gallery-image.loaded {
    opacity: 1;
}

.gallery-item:hover .gallery-image.loaded {
    transform: scale(1.05);
}

/* Loading indicator for each image */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 3;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-indicator.hidden {
    opacity: 0;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Footer */
footer {
    background-color: #f5f5f5;
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-text {
    margin-bottom: 1rem;
    opacity: 0.7;
    color: #666;
}

/* Media queries */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .site-title {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    header {
        padding: 1.5rem 1rem;
    }
    
    .site-title {
        font-size: 1.8rem;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    margin: 2rem auto;
    max-width: 600px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.empty-state h2 {
    margin-bottom: 1rem;
}

.empty-state p {
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

/* Custom Image Modal - No transition on close */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95); /* White background */
    z-index: 1000;
    overflow: auto;
    opacity: 1; /* Removed opacity transition */
}

.modal.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border: 1px solid #ddd;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #333; /* Dark text */
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 1001;
}

.close-modal:hover {
    color: #999;
}

/* Navigation buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #333; /* Dark text */
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 15px;
    user-select: none;
    background-color: rgba(255, 255, 255, 0.7); /* Light background */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}