/**
 * HERO CAROUSEL SYSTEM STYLES - Enterprise-Grade Design
 * 
 * Design Principles:
 * - Hardware-accelerated animations for 60fps performance
 * - Elegant fade transitions with depth
 * - Responsive design for all screen sizes
 * - Accessible touch targets (min 44x44px)
 * - Elegant indicator design with progress rings
 * - Subtle, professional aesthetic
 * - RTL support for Arabic interface
 * 
 * @version 2.0.0
 */

/* ===== CAROUSEL CONTAINER ===== */
.hero-carousel-track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    /* Debug: ensure visibility */
    background: transparent !important;
}

/* ===== CAROUSEL SLIDES ===== */
.hero-carousel-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1000ms cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0ms 1000ms;
    will-change: opacity;
    z-index: 1;
    /* Debug: ensure background doesn't hide content */
    background: transparent;
    /* Debug: add subtle background to see slide area */
    /* background: rgba(200, 200, 200, 0.1); */
}

.hero-carousel-slide.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 1000ms cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0ms 0ms;
    z-index: 2;
}

.hero-carousel-slide.entering {
    z-index: 3;
    animation: slideEnter 1000ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-carousel-slide.exiting {
    z-index: 2;
    animation: slideExit 1000ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Slide animations */
@keyframes slideEnter {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideExit {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ===== IMAGE WRAPPER ===== */
.hero-image-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8%;
    z-index: 1;
    overflow: hidden;
    /* Ensure wrapper doesn't block content */
    pointer-events: none;
}

/* ===== CAROUSEL IMAGES ===== */
.hero-carousel-image {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 24px;
    transform: scale(1);
    display: block;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    filter: brightness(0.95) contrast(1.05);
    z-index: 1;
    /* Ensure images are interactive */
    pointer-events: auto;
    /* Ensure image is visible */
    opacity: 1;
    visibility: visible;
    /* Prevent image overflow */
    box-sizing: border-box;
}

/* Hover effect - subtle zoom */
.hero-carousel-slide.active .hero-carousel-image {
    animation: imageFloat 8s ease-in-out infinite;
}

@keyframes imageFloat {
    0%, 100% {
        transform: translateZ(0) translateY(0) scale(1);
    }
    50% {
        transform: translateZ(20px) translateY(-10px) scale(1.02);
    }
}

/* Container hover effect */
.split-hero-visual:hover .hero-carousel-image {
    transform: scale(1.03);
    filter: brightness(1) contrast(1.05) saturate(1.05);
}

/* ===== IMAGE OVERLAY ===== */
.hero-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(248, 246, 240, 0) 0%,
        rgba(232, 230, 223, 0.05) 100%);
    border-radius: 24px;
    pointer-events: none;
    z-index: 2;
    opacity: 1;
}

/* Subtle overlay for depth - REMOVED DARK VIGNETTE */
.hero-carousel-slide.active .hero-image-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, 
        rgba(93, 64, 55, 0.05) 0%,
        rgba(139, 115, 85, 0.03) 100%);
    border-radius: 24px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    animation: overlayFade 1s ease-out 0.5s forwards;
}

@keyframes overlayFade {
    to {
        opacity: 1;
    }
}

/* REMOVED: Dark circular vignette effect */

/* ===== FLOATING PARTICLES ===== */
.hero-floating-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
    border-radius: 24px;
}

.hero-floating-particles::before {
    content: '';
    position: absolute;
    bottom: 10%;
    right: 10%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.08) 0%, transparent 70%);
    border-radius: 45% 55% 60% 40% / 50% 60% 40% 50%;
    opacity: 0;
    animation: particleFloat 6s ease-in-out infinite;
}

.hero-carousel-slide.active .hero-floating-particles::before {
    animation: particleFloat 6s ease-in-out 1s infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translate(-20px, -20px) rotate(10deg);
        opacity: 0.8;
    }
}

/* ===== NAVIGATION BUTTONS ===== */
.hero-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(215, 193, 169, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(93, 64, 55, 0.08);
}

.hero-carousel-nav:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--color-accent-primary);
    box-shadow: 0 4px 20px rgba(93, 64, 55, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.hero-carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.hero-carousel-nav svg {
    width: 24px;
    height: 24px;
    color: var(--color-text-primary);
    transition: color 0.3s ease;
}

.hero-carousel-nav:hover svg {
    color: var(--color-accent-primary);
}

/* Position navigation buttons */
.hero-carousel-prev {
    right: 20px;
}

.hero-carousel-next {
    left: 20px;
}

/* ===== INDICATORS ===== */
.hero-carousel-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 50;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 100px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(93, 64, 55, 0.08);
}

.hero-carousel-indicator {
    position: relative;
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    background: rgba(139, 115, 85, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-carousel-indicator:hover {
    background: rgba(139, 115, 85, 0.5);
    transform: scale(1.2);
}

.hero-carousel-indicator.active {
    background: var(--color-accent-primary);
    width: 12px;
    height: 12px;
}

/* Progress ring for active indicator */
.indicator-progress-ring {
    position: absolute;
    inset: -6px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: var(--color-accent-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hero-carousel-indicator.active .indicator-progress-ring {
    opacity: 1;
    animation: ringRotate 5s linear infinite;
}

@keyframes ringRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== PROGRESS BAR ===== */
.hero-carousel-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(139, 115, 85, 0.15);
    overflow: hidden;
    z-index: 50;
    opacity: 0.8;
}

.hero-carousel-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        var(--color-accent-primary) 0%,
        var(--color-accent-secondary) 100%);
    transition: width 0ms linear;
    box-shadow: 0 0 8px rgba(212, 165, 116, 0.4);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .hero-image-wrapper {
        width: 90%;
        height: 70%;
    }

    .hero-carousel-nav {
        width: 44px;
        height: 44px;
    }

    .hero-carousel-prev {
        right: 15px;
    }

    .hero-carousel-next {
        left: 15px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .hero-image-wrapper {
        width: 95%;
        height: 65%;
    }

    .hero-carousel-nav {
        display: none;  /* Hide navigation buttons on mobile */
    }

    .hero-carousel-prev {
        right: 10px;
    }

    .hero-carousel-next {
        left: 10px;
    }

    .hero-carousel-indicators {
        display: none;  /* Hide indicators on mobile for cleaner view */
    }

    .hero-carousel-progress {
        height: 2px;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    .hero-image-wrapper {
        width: 100%;
        height: 100%;
        padding: 6%;  /* Reduce padding for more image space */
    }

    .hero-carousel-image {
        border-radius: 16px;
        max-width: 100%;
    }

    .hero-carousel-nav {
        width: 36px;
        height: 36px;
    }

    .hero-carousel-nav svg {
        width: 18px;
        height: 18px;
    }

    .hero-carousel-indicators {
        display: none;  /* Keep hidden on small mobile */
    }
}

/* ===== ACCESSIBILITY ===== */

/* Focus styles for keyboard navigation */
.hero-carousel-nav:focus-visible,
.hero-carousel-indicator:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hero-carousel-slide,
    .hero-carousel-image,
    .hero-carousel-nav,
    .hero-carousel-indicator,
    .hero-image-overlay::before,
    .hero-floating-particles::before,
    .indicator-progress-ring {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .hero-carousel-slide {
        transition: opacity 300ms ease;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-carousel-nav {
        border: 2px solid currentColor;
    }

    .hero-carousel-indicator {
        border: 1px solid currentColor;
    }
}

/* ===== LOADING STATE ===== */
.hero-carousel-slide.loading .hero-carousel-image {
    opacity: 0;
    animation: imagePulse 1.5s ease-in-out infinite;
}

@keyframes imagePulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* ===== END OF CAROUSEL STYLES ===== */
