/**
 * TRENJ - Hero Slider Styles
 * أنماط عرض الخلفيات المتحركة الاحترافية
 */

/* ========== Container ========== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background: #000;
}

@media (max-width: 1440px) {
    .hero-slider {
        height: 524px;
    }
}

@media (max-width: 1024px) {
    .hero-slider {
        height: 444px;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 350px;
    }
}

/* ========== Slides Wrapper ========== */
.hero-slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ========== Individual Slide ========== */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;  /* ✅ دائماً مرئية */
    visibility: visible;  /* ✅ دائماً مرئية */
    z-index: 1;  /* خلفية */
}

.hero-slide.active {
    z-index: 2;  /* ✅ الصورة النشطة في الأمام */
}

/* ========== Media (Image/Video) ========== */
.hero-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-image {
    animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

.hero-video {
    pointer-events: none;
}

/* ========== Overlay ========== */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(124, 179, 66, 0.3) 0%,
        rgba(253, 216, 53, 0.2) 100%
    );
    z-index: 3;
    pointer-events: none;
}

/* ========== Slide Info (Optional) - DISABLED ========== */
/* تم تعطيل عرض العنوان والوصف على الصور */
/*
.hero-slide-info {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 4;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.5s;
    max-width: 800px;
    padding: 0 20px;
}

.hero-slide.active .hero-slide-info {
    opacity: 1;
}

.hero-slide-info h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-slide-info p {
    font-size: 1.3rem;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .hero-slide-info {
        bottom: 40px;
    }
    
    .hero-slide-info h2 {
        font-size: 2rem;
    }
    
    .hero-slide-info p {
        font-size: 1rem;
    }
}
*/

/* ========== Navigation Arrows ========== */
.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.hero-arrow i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.hero-arrow-prev {
    right: 30px;
}

.hero-arrow-next {
    left: 30px;
}

@media (max-width: 768px) {
    .hero-arrow {
        width: 40px;
        height: 40px;
    }
    
    .hero-arrow i {
        font-size: 1rem;
    }
    
    .hero-arrow-prev {
        right: 15px;
    }
    
    .hero-arrow-next {
        left: 15px;
    }
}

/* ========== Indicators (Dots) ========== */
.hero-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.hero-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hero-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.hero-indicator.active {
    background: white;
    width: 30px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .hero-indicators {
        bottom: 15px;
    }
    
    .hero-indicator {
        width: 8px;
        height: 8px;
    }
    
    .hero-indicator.active {
        width: 20px;
    }
}

/* ========== Transition Effects ========== */

/* Slide Left - انزلاق من اليمين */
.hero-slide.transition-slide-left {
    animation: slideInLeft 1s ease-in-out;
    z-index: 3;  /* ✅ فوق الصورة السابقة */
}

@keyframes slideInLeft {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Slide Right - انزلاق من اليسار */
.hero-slide.transition-slide-right {
    animation: slideInRight 1s ease-in-out;
    z-index: 3;  /* ✅ فوق الصورة السابقة */
}

@keyframes slideInRight {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Fade - تحسين للانتقال السلس */
.hero-slide.transition-fade {
    animation: fadeInSmooth 1s ease;
}

@keyframes fadeInSmooth {
    from {
        opacity: 0;
        z-index: 3;  /* ✅ فوق الصورة السابقة */
    }
    to {
        opacity: 1;
        z-index: 3;  /* ✅ تبقى في الأمام */
    }
}

/* Zoom - تكبير تدريجي */
.hero-slide.transition-zoom {
    animation: zoomInSmooth 1s ease-out;
    z-index: 3;  /* ✅ فوق الصورة السابقة */
}

@keyframes zoomInSmooth {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fade In Up (for text) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========== Loading State ========== */
.hero-slider:not(.hero-slider-initialized) {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slider:not(.hero-slider-initialized)::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Accessibility ========== */
.hero-arrow:focus,
.hero-indicator:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* ========== Performance Optimizations ========== */
.hero-slider,
.hero-slide,
.hero-media {
    will-change: transform, opacity;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .hero-slider *,
    .hero-slider *::before,
    .hero-slider *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
