* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "Poppins", sans-serif;
    background-color: #1a1a1a;
    color: #fafafa;
    min-height: 100vh;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}
header {
    text-align: center;
    margin-bottom: 32px;
}
header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
}
header p {
    color: #666;
}
.controls {
    text-align: center;
    margin-bottom: 40px;
}
.shuffle-btn {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    background-color: #fafafa;
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.shuffle-btn:hover {
    background-color: #333;
    color: #fff;
}
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.image-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: #e5e5e5;
    aspect-ratio: 4/3;
    cursor: pointer;
}
.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.image-card:hover img {
    transform: scale(1.05);
}
.image-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}
.image-card:hover .overlay {
    opacity: 1;
}
.overlay a {
    color: #fff;
    font-size: 0.85rem;
    text-decoration: none;
}
.overlay a:hover {
    text-decoration: underline;
}
.load-more {
    display: block;
    margin: 0 auto;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    background-color: #fff;
    color: #1a1a1a;
    border-radius: 10px;
    border: 2px solid #e5e5e5;
    cursor: pointer;
    transition: all 0.2s ease;
}
.load-more:hover {
    border-color: #1a1a1a;
}
.loading {
    grid-column: 1/-1;
}
.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #333;
    border-radius: 50%;
    border-top-color: #fafafa;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.error {
    display: none;
    text-align: center;
    padding: 20px;
    background-color: #ff4444;
    color: #fff;
    border-radius: 10px;
    font-weight: 500;
    width: 50%;
    margin: 0 auto;
}
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal img {
    width: 80%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 16px;
    animation: zoomIn 0.35s cubic-bezier(0.17, 0.67, 0.33, 1);
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 42px;
    cursor: pointer;
}

@keyframes zoomIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
@media (max-width: 600px) {
    header h1 {
        font-size: 1.5rem;
    }
    .shuffle-btn {
        width: 100%;
    }
}
