/* ========================================
   MODERN SMART HERO SLIDER STYLES
   ======================================== */

/* Base Container */
.hero-slider-modern {
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 500px;
    overflow: hidden;
    background: #000;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ========================================
   SLIDE STRUCTURE
   ======================================== */

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(100%);
}

.slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 2;
}

.slide.prev {
    transform: translateX(-100%);
}

/* RTL Slide Transitions */
[dir="rtl"] .slide {
    transform: translateX(-100%);
}

[dir="rtl"] .slide.active {
    transform: translateX(0);
}

[dir="rtl"] .slide.prev {
    transform: translateX(100%);
}

.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.slide-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 15s ease-out;
    transform: scale(1);
    z-index: 0;
}

/* RTL Background Fix */
[dir="rtl"] .slide-background {
    left: 0;
    right: auto;
}

[dir="rtl"] .slide-bg-image {
    object-position: center;
}

.slide.active .slide-bg-image {
    transform: scale(1.05);
}

.slide-overlay {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 109, 109, 0.85) 10%,
        rgba(233, 81, 89, 0.75) 50%,
        rgba(61, 134, 153, 0.65) 100%
    );
    opacity: 0.6;
    z-index: 1;
}

/* RTL Overlay Fix */
[dir="rtl"] .slide-overlay {
    background: linear-gradient(
        225deg,
        rgba(42, 95, 110, 0.85) 0%,
        rgba(233, 81, 89, 0.75) 50%,
        rgba(61, 134, 153, 0.65) 100%
    );
}

/* ========================================
   SLIDE CONTENT
   ======================================== */

.slide-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 5%;
    z-index: 3;
}

/* RTL Content Fix */
[dir="rtl"] .slide-content {
    justify-content: flex-end;
    padding: 0 6% 0 5%;
    z-index: 3;
}

.content-wrapper {
    max-width: 800px;
    color: white;
    text-align: left;
    animation: slideContentIn 1.5s ease-out 0.5s both;
}

/* RTL Support */
[dir="rtl"] .content-wrapper {
    text-align: right;
    direction: rtl;
    z-index: 4;
    line-height: 1.6;
}

/* RTL Support for slide-content */
[dir="rtl"] .slide-content {
    justify-content: flex-start;
    padding: 0 5% 0 5%;
    direction: rtl;
}

/* RTL Debugging - ensure visibility */
[dir="rtl"] .hero-slider-modern {
    background: #000 !important;
}

[dir="rtl"] .slide {
    background: transparent !important;
}

[dir="rtl"] .slide-overlay {
    opacity: 0.9 !important;
}

@keyframes slideContentIn {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge */
.slide-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    /* Slightly larger internal padding for better readability */
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    /* Extra space below the badge to separate it from the title/description */
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out 0.8s both;
}

/* RTL Badge */
[dir="rtl"] .slide-badge {
    margin-bottom: 16px;
    flex-direction: row-reverse;
}

.slide-badge i {
    font-size: 16px;
    color: #ffb347;
}

/* Title */
.slide-title {
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 1s ease-out 1.1s both;
}

/* RTL Title */
[dir="rtl"] .slide-title {
    margin: 0 16px 0 0;
}

/* Description */
.slide-description {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 25px 0;
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 1.4s both;
}

/* RTL Description */
[dir="rtl"] .slide-description {
    margin: 0 25px 0 0;
}

/* Actions */
.slide-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-start;
    animation: fadeInUp 1s ease-out 2s both;
    /* Add space between the text block and the buttons */
    margin-top: 16px;
}

/* RTL Actions */
[dir="rtl"] .slide-actions {
    justify-content: flex-end;
}

/* Modern Buttons */
.btn-primary-modern,
.btn-secondary-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
}

.btn-primary-modern {
    background: linear-gradient(135deg, #3d8699 0%, #2a5f6e 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 8px 32px rgba(61, 134, 153, 0.3);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(61, 134, 153, 0.4);
    background: linear-gradient(135deg, #4a9bb8 0%, #337a8a 100%);
}

.btn-secondary-modern {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary-modern:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Button Ripple Effect */
.btn-primary-modern::before,
.btn-secondary-modern::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.btn-primary-modern:active::before,
.btn-secondary-modern:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary-modern span,
.btn-secondary-modern span,
.btn-primary-modern i,
.btn-secondary-modern i {
    position: relative;
    z-index: 1;
}

/* RTL Button Support */
[dir="rtl"] .btn-primary-modern,
[dir="rtl"] .btn-secondary-modern {
    flex-direction: row-reverse;
}

/* ========================================
   NAVIGATION
   ======================================== */

.slider-navigation {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* Navigation Dots */
.nav-dots {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.nav-dot {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.dot-inner {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-dot.active .dot-inner {
    background: #ffb347;
    transform: scale(1.3);
    box-shadow: 0 0 20px rgba(255, 179, 71, 0.5);
}

.nav-dot.active .dot-inner::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid rgba(255, 179, 71, 0.3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.dot-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-dot:hover .dot-label,
.nav-dot.active .dot-label {
    opacity: 1;
}

/* Arrow Navigation - Disabled */
.nav-arrow,
.nav-prev,
.nav-next {
    display: none !important;
}

/* ========================================
   PROGRESS INDICATOR
   ======================================== */

.progress-indicator {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

/* RTL Progress Indicator */
[dir="rtl"] .progress-indicator {
    right: auto;
    left: 30px;
}

.progress-bar {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3d8699 0%, #ffb347 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 33.33%;
}

.progress-info {
    color: white;
    font-size: 14px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.slide-separator {
    opacity: 0.5;
    margin: 0 2px;
}

/* ========================================
   SMART FEATURES
   ======================================== */

.slider-features {
    position: absolute;
    top: 30px;
    left: 30px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

/* RTL Slider Features */
[dir="rtl"] .slider-features {
    left: auto;
    right: 30px;
}

.feature-control {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.feature-control:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.feature-control.active {
    background: rgba(255, 179, 71, 0.2);
    border-color: rgba(255, 179, 71, 0.4);
    color: #ffb347;
}

/* ========================================
   THUMBNAILS
   ======================================== */

.slide-thumbnails {
    position: absolute;
    bottom: 20px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

/* RTL Thumbnails */
[dir="rtl"] .slide-thumbnails {
    right: auto;
    left: 30px;
}

.thumbnail {
    width: 80px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.thumbnail:hover {
    transform: scale(1.05);
    border-color: rgba(255, 179, 71, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.thumbnail:active {
    transform: scale(0.98);
    transition: all 0.1s ease;
}

.thumbnail.active {
    border-color: #ffb347;
    box-shadow: 0 0 20px rgba(255, 179, 71, 0.3);
    transform: scale(1.1);
}

.thumbnail.active:hover {
    transform: scale(1.12);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}

.thumbnail:hover img {
    transform: scale(1.1);
}

.thumbnail:active img {
    transform: scale(1.05);
}

.thumbnail.active img {
    transform: scale(1.05);
}

.thumbnail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    font-size: 10px;
    padding: 8px 6px 4px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.thumbnail:hover .thumbnail-overlay,
.thumbnail.active .thumbnail-overlay {
    transform: translateY(0);
    opacity: 1;
}

/* Add click feedback animation */
.thumbnail::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 179, 71, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.thumbnail:active::before {
    width: 60px;
    height: 60px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .slide-content {
        padding: 0 4%;
    }
    
    .content-wrapper {
        max-width: 500px;
    }
    
    /* RTL Support for Tablet Content Wrapper */
    [dir="rtl"] .content-wrapper {
        direction: rtl;
        text-align: right;
    }
    
    .slide-title {
        font-size: clamp(2rem, 4vw, 3rem);
    }
    
    .slide-thumbnails {
        right: 20px;
    }
    
    /* RTL Tablet Thumbnails */
    [dir="rtl"] .slide-thumbnails {
        right: auto;
        left: 20px;
    }
    
    .thumbnail {
        width: 70px;
        height: 45px;
    }
}

@media (max-width: 768px) {
    .hero-slider-modern {
        height: 65vh;
        min-height: 450px;
    }
    
    .slide-content {
        padding: 0 3%;
        align-items: center;
        padding-bottom: 140px;
    }
    
    .content-wrapper {
        max-width: 100%;
    }
    
    /* RTL Support for Mobile Content Wrapper */
    [dir="rtl"] .content-wrapper {
        direction: rtl;
        text-align: right;
    }
    
    .slide-title {
        font-size: clamp(1.6rem, 5vw, 2.2rem);
        margin-bottom: 12px;
    }
    
    /* RTL Mobile Title */
    [dir="rtl"] .slide-title {
        margin: 0 12px 0 0;
    }
    
    .slide-description {
        font-size: 14px;
        margin-bottom: 18px;
    }
    
    /* RTL Mobile Description */
    [dir="rtl"] .slide-description {
        margin: 0 18px 0 0;
    }
    
    .slide-actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .btn-primary-modern,
    .btn-secondary-modern {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 80px;
        flex: 1;
    }
    
    .slider-navigation {
        bottom: 60px;
    }
    
    .nav-dots {
        gap: 15px;
    }
    
    .progress-indicator {
        top: 20px;
        right: 20px;
    }
    
    .progress-bar {
        width: 80px;
    }
    
    .slider-features {
        top: 20px;
        left: 20px;
    }
    
    /* RTL Mobile positioning */
    [dir="rtl"] .progress-indicator {
        right: auto;
        left: 20px;
    }
    
    [dir="rtl"] .slider-features {
        left: auto;
        right: 20px;
    }
    
    /* Mobile Thumbnails - Show at bottom vertically */
    .slide-thumbnails {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 8px;
        right: auto;
    }
    
    /* RTL Mobile Thumbnails */
    [dir="rtl"] .slide-thumbnails {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
    
    .thumbnail {
        width: 60px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .slide-content {
        padding-bottom: 120px;
    }
    
    .slide-badge {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .nav-dots {
        gap: 12px;
    }
    
    .dot-label {
        display: none;
    }
    
    .progress-indicator {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-top: 20px;
    }
    
    .slider-features {
        gap: 8px;
    }
    
    .feature-control {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .slide-thumbnails {
        bottom: 5px;
        gap: 6px;
    }
    
    .thumbnail {
        width: 50px;
        height: 32px;
    }
    
    .slider-navigation {
        bottom: 45px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .slide,
    .slide-bg-image,
    .content-wrapper,
    .nav-dot .dot-inner,
    .btn-primary-modern,
    .btn-secondary-modern {
        transition: none;
        animation: none;
    }
    
    .slide.active .slide-bg-image {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .slide-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .btn-primary-modern {
        border-color: white;
    }
    
    .nav-dot.active .dot-inner {
        background: white;
    }
}

/* Focus styles for accessibility */
.nav-dot:focus,
.nav-arrow:focus,
.feature-control:focus,
.thumbnail:focus,
.btn-primary-modern:focus,
.btn-secondary-modern:focus {
    outline: 2px solid #ffb347;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .hero-slider-modern {
        height: auto;
        background: white;
    }
    
    .slide {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    
    .slide-overlay {
        display: none;
    }
    
    .slider-navigation,
    .progress-indicator,
    .slider-features,
    .slide-thumbnails {
        display: none;
    }
}
