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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2a2839;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 2px solid #555;
}

h1 {
    font-size: 1.8rem;
    margin: 0;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.category-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-selector label {
    font-size: 1.3rem;
    color: #e0e0e0;
    font-weight: 500;
}

#category-dropdown {
    padding: 12px 18px;
    font-size: 1.2rem;
    background-color: #3a3849;
    color: #ffffff;
    border: 2px solid #666;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 140px;
}

#category-dropdown:hover {
    border-color: #888;
}

#category-dropdown:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Image grid styles */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #3a3849;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.image-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.image-item:hover img {
    opacity: 0.9;
}

.image-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    padding: 15px;
    background-color: #3a3849;
    border-top: 1px solid #555;
    text-align: center;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 40, 57, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ff4444;
}

#modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 1.2rem;
    display: none;
}

/* Loading state */
.loading .loading-spinner {
    display: block;
}

.loading #modal-image {
    display: none;
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #ccc;
}

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

/* Choose category message */
.choose-category-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 20px;
}

.choose-category-message p {
    font-size: 1.4rem;
    color: #aaa;
    margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .image-item img {
        height: 200px;
    }
    
    .close {
        font-size: 30px;
        top: 15px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .image-item img {
        height: 180px;
    }
    
    .category-selector {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .category-selector label {
        margin-bottom: 0;
    }
}
