/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: #5B9BD5;
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar h1 {
    font-size: 2rem;
    font-weight: 600;
}

/* Main content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Image grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.image-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state p {
    font-size: 1.2rem;
}

/* Pagination controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-selector label {
    font-weight: 500;
    color: #555;
}

#per-page {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    font-size: 1rem;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #5B9BD5;
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.page-link:not(.disabled):hover {
    background-color: #e8f4fd;
}

.page-link.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.page-info {
    font-weight: 500;
    color: #555;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox.hidden {
    display: none;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .navbar h1 {
        font-size: 1.5rem;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .pagination-controls {
        flex-direction: column;
        text-align: center;
    }
    
    .close-btn {
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 1rem 0.5rem;
    }
}
