/* استایل‌های ویجت گالری تصاویر هوشمند */

.hfe-image-gallery {
    width: 100%;
    position: relative;
}

/* فیلتر دسته‌بندی */
.hfe-gallery-filter {
    margin-bottom: 30px;
    text-align: center;
}

.hfe-gallery-filter button {
    background: none;
    border: none;
    padding: 8px 20px;
    margin: 0 10px;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    outline: none;
}

.hfe-gallery-filter button:hover,
.hfe-gallery-filter button.active {
    color: #667eea;
}

.hfe-gallery-filter button.active:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
    border-radius: 2px;
}

/* کانتینر گالری */
.hfe-gallery-container {
    width: 100%;
}

/* گالری شبکه‌ای */
.hfe-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hfe-gallery-grid.columns-1 {
    grid-template-columns: repeat(1, 1fr);
}

.hfe-gallery-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.hfe-gallery-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.hfe-gallery-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.hfe-gallery-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.hfe-gallery-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* گالری ماسونری */
.hfe-gallery-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 10px;
    gap: 20px;
}

.hfe-gallery-masonry .hfe-gallery-item {
    grid-row-end: span 20;
}

.hfe-gallery-masonry .hfe-gallery-item:nth-child(2n) {
    grid-row-end: span 25;
}

.hfe-gallery-masonry .hfe-gallery-item:nth-child(3n) {
    grid-row-end: span 30;
}

.hfe-gallery-masonry .hfe-gallery-item:nth-child(4n) {
    grid-row-end: span 18;
}

/* آیتم گالری */
.hfe-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.hfe-gallery-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hfe-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.5s ease;
}

/* Overlay */
.hfe-gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: all 0.5s ease;
    color: white;
    text-align: center;
}

.hfe-gallery-item-content {
    transform: translateY(20px);
    transition: transform 0.5s ease;
}

.hfe-gallery-item-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.hfe-gallery-item-category {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-bottom: 10px;
}

.hfe-gallery-item-description {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 10px;
}

/* Actions */
.hfe-gallery-item-actions {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
}

.hfe-gallery-item-action {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hfe-gallery-item-action:hover {
    background: white;
    transform: scale(1.1);
}

/* افکت‌های هاور */
.hfe-gallery-item:hover .hfe-gallery-item-overlay {
    opacity: 1;
}

.hfe-gallery-item:hover .hfe-gallery-item-content,
.hfe-gallery-item:hover .hfe-gallery-item-actions {
    transform: translateY(0);
    opacity: 1;
}

/* افکت‌های تصویر */
.hfe-hover-zoom-in:hover img {
    transform: scale(1.1);
}

.hfe-hover-zoom-out img {
    transform: scale(1.1);
    transition: transform 0.5s ease;
}

.hfe-hover-zoom-out:hover img {
    transform: scale(1);
}

.hfe-hover-rotate:hover img {
    transform: rotate(5deg) scale(1.1);
}

.hfe-hover-grayscale img {
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

.hfe-hover-grayscale:hover img {
    filter: grayscale(0);
}

/* افکت‌های Overlay */
.hfe-overlay-slide-top .hfe-gallery-item-overlay {
    transform: translateY(-100%);
}

.hfe-overlay-slide-top:hover .hfe-gallery-item-overlay {
    transform: translateY(0);
}

.hfe-overlay-slide-bottom .hfe-gallery-item-overlay {
    transform: translateY(100%);
}

.hfe-overlay-slide-bottom:hover .hfe-gallery-item-overlay {
    transform: translateY(0);
}

.hfe-overlay-slide-left .hfe-gallery-item-overlay {
    transform: translateX(-100%);
}

.hfe-overlay-slide-left:hover .hfe-gallery-item-overlay {
    transform: translateX(0);
}

.hfe-overlay-slide-right .hfe-gallery-item-overlay {
    transform: translateX(100%);
}

.hfe-overlay-slide-right:hover .hfe-gallery-item-overlay {
    transform: translateX(0);
}

.hfe-overlay-zoom .hfe-gallery-item-overlay {
    transform: scale(0);
}

.hfe-overlay-zoom:hover .hfe-gallery-item-overlay {
    transform: scale(1);
}

/* اسلایدر/کاروسل */
.hfe-gallery-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hfe-gallery-slider {
    display: flex;
    transition: transform 0.5s ease;
}

.hfe-gallery-slider .hfe-gallery-item {
    flex: 0 0 calc(100% / var(--slides-to-show, 3));
    padding: 0 10px;
}

.hfe-gallery-slider-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.hfe-gallery-slider-prev,
.hfe-gallery-slider-next {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hfe-gallery-slider-prev:hover,
.hfe-gallery-slider-next:hover {
    background: white;
    transform: scale(1.1);
}

.hfe-gallery-slider-prev {
    margin-left: 15px;
}

.hfe-gallery-slider-next {
    margin-right: 15px;
}

.hfe-gallery-slider-dots {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 8px;
}

.hfe-gallery-slider-dots .dot {
    width: 10px;
    height: 10px;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hfe-gallery-slider-dots .dot.active {
    background: #667eea;
    transform: scale(1.2);
}

/* واکنش‌گرایی */
@media (max-width: 1024px) {
    .hfe-gallery-grid.columns-5,
    .hfe-gallery-grid.columns-6 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hfe-gallery-slider .hfe-gallery-item {
        flex: 0 0 calc(100% / var(--slides-to-show-tablet, 2));
    }
}

@media (max-width: 768px) {
    .hfe-gallery-grid.columns-3,
    .hfe-gallery-grid.columns-4,
    .hfe-gallery-grid.columns-5,
    .hfe-gallery-grid.columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hfe-gallery-filter button {
        padding: 6px 15px;
        margin: 0 5px;
        font-size: 14px;
    }
    
    .hfe-gallery-slider .hfe-gallery-item {
        flex: 0 0 calc(100% / var(--slides-to-show-mobile, 1));
    }
    
    .hfe-gallery-slider-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .hfe-gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hfe-gallery-filter {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .hfe-gallery-filter button {
        margin: 0;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .hfe-gallery-item-title {
        font-size: 16px;
    }
    
    .hfe-gallery-item-category {
        font-size: 12px;
    }
}

/* انیمیشن‌ها */
@keyframes hfeGalleryFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hfe-gallery-item {
    animation: hfeGalleryFadeIn 0.6s ease forwards;
}

.hfe-gallery-item:nth-child(2) {
    animation-delay: 0.1s;
}

.hfe-gallery-item:nth-child(3) {
    animation-delay: 0.2s;
}

.hfe-gallery-item:nth-child(4) {
    animation-delay: 0.3s;
}

.hfe-gallery-item:nth-child(5) {
    animation-delay: 0.4s;
}

.hfe-gallery-item:nth-child(6) {
    animation-delay: 0.5s;
}

/* حالت RTL */
body.rtl .hfe-gallery-slider-prev i:before {
    content: "\e89a"; /* آیکون راست */
}

body.rtl .hfe-gallery-slider-next i:before {
    content: "\e899"; /* آیکون چپ */
}