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


.gallery-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.sort-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sort-controls label {
    font-weight: bold;
    color: #2c3e50;
}

.sort-controls select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-controls select:hover {
    border-color: #3498db;
}

.sort-controls select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

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

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-item .image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    font-size: 12px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .image-info {
    transform: translateY(0);
}

.filename {
    font-weight: bold;
    margin-bottom: 3px;
}

.file-size {
    font-size: 11px;
    opacity: 0.8;
}

.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-info-full {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    text-align: center;
}

.no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.path-display {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 15px 0;
    font-family: monospace;
    word-break: break-all;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 5px;
}

.pagination-link {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #3498db;
    transition: all 0.3s ease;
}

.pagination-link:hover {
    background-color: #3498db;
    color: white;
}

.pagination-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .sort-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-controls label {
        margin-bottom: 5px;
    }
}
/* Horizontal limit styles */
.gallery[style*="grid-template-columns"] {
    gap: 15px;
}

.gallery-item {
    width: 100%;
}

/* Responsive adjustments for horizontal limits */
@media (max-width: 768px) {
    .gallery[style*="max_horizontal"] .gallery-item {
        min-width: 120px;
    }
}

/* Control for horizontal limiting */
.horizontal-limit-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;



.horizontal-limit-control label {
    font-weight: bold;
    color: #2c3e50;
}

.horizontal-limit-control select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
}
