.infinite-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.slider-track {
    display: flex;
    animation: slide 20s linear infinite;
}

/* اضافه کردن کلاس جدید برای توقف */
.slider-track:hover {
    animation-play-state: paused;
}

/* اضافه کردن کلاس برای جهت RTL */
.slider-track.rtl {
    animation-name: slide-rtl;
}

@keyframes slide-rtl {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

.slider-item {
    flex: 0 0 auto;
    padding: 20px;
    margin: 0 10px;
    background: #f0f0f0;
    border-radius: 5px;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@keyframes slide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.slider-item.hover-enabled:hover {
    transform: scale(1.05);
    background: #e0e0e0;
}

.slider-item img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.image-item {
    display: inline-block;
    margin: 5px;
    position: relative;
}

.remove-image {
    margin-top: 5px;
    display: block;
}

@media (max-width: 480px) {
    .slider-item {
        min-width: 150px;
        padding: 15px;
    }
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* نسبت 16:9 */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-item {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.video-item {
    display: inline-block;
    margin: 10px;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.video-item video {
    margin-bottom: 10px;
    display: block;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-item video {
    max-height: 100%;
    width: auto;
}

.slider-item.video-slide {
    width: calc(25% - 20px);
    min-width: 250px;
    height: auto;
    padding: 10px;
    margin: 10px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 5px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* نسبت 16:9 */
    height: 0;
    overflow: hidden;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 1200px) {
    .slider-item.video-slide {
        width: calc(33.33% - 20px);
    }
}

@media (max-width: 900px) {
    .slider-item.video-slide {
        width: calc(50% - 20px);
    }
}

@media (max-width: 600px) {
    .slider-item.video-slide {
        width: calc(100% - 20px);
    }
}

@media (max-width: 768px) {
    .slider-item.video-slide {
        min-width: 200px;
    }
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    cursor: pointer;
}

.image-modal img {
    max-width: 90%;
    max-height: 90vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.image-modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal .modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    margin: 20px auto;
    text-align: center;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.image-modal img {
    max-width: 100%;
    max-height: calc(80vh - 100px);
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.image-caption {
    margin-top: 15px;
    padding: 15px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: right;
    direction: rtl;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.image-modal.active {
    background: rgba(0,0,0,0.85);
}

.image-modal .modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    margin: 30px auto;
    text-align: center;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.image-modal img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

.image-caption {
    margin-top: 15px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: justify;
    direction: rtl;
}

/* اضافه کردن انیمیشن برای نمایش caption */
.image-caption {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-item input[type="text"] {
    margin: 5px 0;
    width: 100%;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal .modal-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
}

.image-modal img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

.image-caption {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: right;
    direction: rtl;
}
