/* Sidebar */
.left-sidebar {
    width: 250px;
    overflow-y: auto;
    border-right: 1px solid #ccc;
    padding: 10px;
    background: #f9f9f9;
}

/* Main content fills remaining space and is scrollable */
.content-wrapper {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
}

.main-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;

    /* Make main section scrollable */
    overflow-y: auto;
}

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-gap: 1rem;
    width: 100%;
}

/* Gallery item */
.gallery-item {
    display: flex;
    flex-direction: column; /* stack image and info */
    cursor: pointer;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Image wrapper */
.gallery-image-wrapper {
    position: relative;
}

/* Image */
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-item img.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Hover description overlay */
.gallery-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.5rem;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-hover {
    opacity: 1;
}

/* Info below image */
.gallery-info {
    padding: 0.5rem;
    text-align: center;
    background: #f9f9f9;
}

.gallery-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.gallery-creator-wood {
    font-size: 0.85rem;
    color: #555;
}

/* Filter group styling */
.filter-group {
    margin-bottom: 1em;
}

.filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.3em;
}

.filter-group select {
    width: 100%;
    padding: 0.3em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Archive Checkbox */
.filter-archive {
    margin-top: 1.2em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

/* Modal for enlarged image */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80%;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.modal-caption {
    text-align: center;
    color: white;
    margin-top: 10px;
    font-size: 1rem;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    .left-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}
