/* GenXGallery Public Styles */

.genxgallery-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Top Layout (Default) */
.genxgallery-container.layout-top {
    display: flex;
    flex-direction: column;
}

.genxgallery-header {
    background: #f5f5f5;
    padding: 15px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #ddd;
}

.genxgallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.layout-top .genxgallery-filters {
    padding: 0 20px;
}

.filter-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    color: #333;
    text-transform: uppercase;
}

.filter-btn:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.filter-btn.active {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

.filter-btn .count {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 11px;
}

.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
}

.genxgallery-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Side Layout */
.genxgallery-container.layout-side {
    display: flex;
    gap: 30px;
}

.genxgallery-sidebar {
    flex: 0 0 250px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.layout-side .genxgallery-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layout-side .filter-btn {
    text-align: left;
    width: 100%;
    justify-content: space-between;
    display: flex;
    align-items: center;
}

.genxgallery-content {
    flex: 1;
}

/* Gallery Grid */
.genxgallery-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.genxgallery-grid.cols-1 { grid-template-columns: repeat(1, 1fr); }
.genxgallery-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.genxgallery-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.genxgallery-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.genxgallery-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.genxgallery-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.genxgallery-grid.cols-7 { grid-template-columns: repeat(7, 1fr); }
.genxgallery-grid.cols-8 { grid-template-columns: repeat(8, 1fr); }

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f0f0f0;
}

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

.gallery-item-inner {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px;
    color: #fff;
    display: none;
    transition: all 0.3s ease;
}

.gallery-item-overlay h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.gallery-item-overlay p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Lightbox */
.genxgallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: #fff;
    transform: scale(1.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-caption {
    margin-top: 20px;
    color: #fff;
    text-align: center;
    max-width: 600px;
    font-size: 16px;
    line-height: 1.5;
}

.lightbox-caption small {
    opacity: 0.8;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .genxgallery-grid.cols-6,
    .genxgallery-grid.cols-7,
    .genxgallery-grid.cols-8 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .genxgallery-container.layout-side {
        flex-direction: column;
    }
    
    .genxgallery-sidebar {
        flex: 1;
        position: relative;
        top: 0;
    }
    
    .layout-side .genxgallery-filters {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .layout-side .filter-btn {
        flex: 1 1 auto;
        min-width: 150px;
    }
    
    .genxgallery-grid.cols-5,
    .genxgallery-grid.cols-6,
    .genxgallery-grid.cols-7,
    .genxgallery-grid.cols-8 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .genxgallery-filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .genxgallery-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .genxgallery-grid.cols-3,
    .genxgallery-grid.cols-4,
    .genxgallery-grid.cols-5,
    .genxgallery-grid.cols-6,
    .genxgallery-grid.cols-7,
    .genxgallery-grid.cols-8 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .genxgallery-container {
        padding: 15px;
    }
    
    .genxgallery-filters {
        gap: 5px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .genxgallery-grid {
        gap: 10px;
    }
    
    .genxgallery-grid.cols-2,
    .genxgallery-grid.cols-3,
    .genxgallery-grid.cols-4,
    .genxgallery-grid.cols-5,
    .genxgallery-grid.cols-6,
    .genxgallery-grid.cols-7,
    .genxgallery-grid.cols-8 {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeIn 0.5s ease-out;
}
