/* Tiny Slider Custom Styles */

/* Controls (Navigation Buttons) */
.tns-controls button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    color: #6b7280;
}

.tns-controls button:hover {
    background: var(--color-primary, #490251);
    border-color: var(--color-primary, #490251);
    color: white;
    transform: scale(1.05);
}

.tns-controls button:focus {
    outline: none;
}

/* Hero Slider Navigation - Position relative to hero section */
.hero-section {
    position: relative;
    overflow: hidden !important; /* Changed from visible to hidden to prevent horizontal scroll */
    max-width: 100%;
}

/* Ensure slider wrapper doesn't clip navigation */
.hero-section .tns-outer {
    overflow: hidden !important; /* Changed to hidden */
}

.hero-section .tns-ovh {
    overflow: hidden !important; /* Keep hidden to prevent horizontal scroll */
}

.hero-section .tns-inner {
    overflow: hidden !important; /* Changed to hidden */
}

.hero-section .tns-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050 !important; /* Above header (z-index: 1000) */
    display: flex !important;
    gap: 12px;
    align-items: center;
    pointer-events: auto;
    padding: 0 16px;
}

.hero-section .tns-nav button {
    position: relative;
    width: 30px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3) !important;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    pointer-events: auto;
}

.hero-section .tns-nav button:hover {
    background: rgba(255, 255, 255, 0.4) !important;
}

.hero-section .tns-nav button.tns-nav-active {
    width: 45px;
    background: rgba(255, 255, 255, 0.5) !important;
}

/* Tablet */
@media (min-width: 640px) {
    .hero-section .tns-nav {
        bottom: 25px;
        gap: 14px;
    }
    
    .hero-section .tns-nav button {
        width: 35px;
        height: 5px;
    }
    
    .hero-section .tns-nav button.tns-nav-active {
        width: 50px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .hero-section .tns-nav {
        bottom: 30px;
        gap: 16px;
    }
    
    .hero-section .tns-nav button {
        width: 40px;
        height: 6px;
    }
    
    .hero-section .tns-nav button.tns-nav-active {
        width: 60px;
    }
}

/* Progress bar inside nav button */
.hero-section .tns-nav button .nav-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 1) !important;
    border-radius: 3px;
    transition: width 0ms linear;
    z-index: 1;
    display: block !important;
}

.hero-section .tns-nav button.tns-nav-active .nav-progress {
    background: white !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Smooth fade animations for hero slider */
.hero-slider .tns-item {
    opacity: 0.3;
    transition: opacity 800ms ease-in-out;
}

.hero-slider .tns-slide-active {
    opacity: 1 !important;
}

/* Extra smooth for slide moving */
.hero-slider .tns-slide-active.tns-moving {
    transition: opacity 800ms ease-in-out;
}

/* CSS animation keyframes for extra smoothness */
@keyframes heroFadeIn {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

.hero-slider .tns-slide-active {
    animation: heroFadeIn 800ms ease-out;
}

/* Smooth slide transition */
.hero-slider .tns-inner {
    transition: transform 800ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ensure smooth rendering */
.hero-slider .hero-slide {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: opacity, transform;
}

/* Books & eBooks Slider Controls */
.tns-outer [data-action] {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.tns-outer [data-action="start"] {
    left: -20px;
}

.tns-outer [data-action="stop"] {
    right: -20px;
}

/* Smooth transitions */
.tns-item {
    transition: opacity 0.3s ease;
}

/* Ensure slides don't have weird gaps */
.tns-horizontal.tns-subpixel {
    white-space: nowrap;
}

.tns-horizontal.tns-subpixel > .tns-item {
    display: inline-block;
    vertical-align: top;
    white-space: normal;
}

/* Hide arrows on mobile */
@media (max-width: 768px) {
    .tns-controls {
        display: none;
    }
}

/* Responsive container */
.tns-outer {
    position: relative;
}

.tns-inner {
    overflow: hidden;
}

/* Loading state */
.tns-slider {
    transition: opacity 0.3s ease;
}

.tns-slider[data-tns="true"] {
    opacity: 1;
}

/* Mobile optimizations for hero slider text readability */
@media (max-width: 640px) {
    .hero-slide {
        min-height: 450px !important;
    }
    
    /* Ensure content area has proper padding and doesn't get cut off */
    .hero-slide .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Better text shadow for mobile readability */
    .hero-slide h1 {
        text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8),
                     0 2px 6px rgba(0, 0, 0, 0.6);
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .hero-slide p {
        text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7),
                     0 1px 4px rgba(0, 0, 0, 0.5);
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Button improvements for mobile */
    .hero-slide a[class*="btn"],
    .hero-slide a[class*="bg-"] {
        font-size: 0.75rem !important; /* 12px */
        padding: 0.5rem 0.875rem !important; /* 8px 14px */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }
    
    /* Improve button icon size */
    .hero-slide a i[data-lucide] {
        width: 0.875rem !important; /* 14px */
        height: 0.875rem !important;
    }
}

/* Small mobile phones (< 375px) */
@media (max-width: 375px) {
    .hero-slide {
        min-height: 420px !important;
    }
    
    .hero-slide h1 {
        font-size: 1.125rem !important; /* 18px */
        line-height: 1.25 !important;
    }
    
    .hero-slide p {
        font-size: 0.8125rem !important; /* 13px */
        line-height: 1.4 !important;
    }
}
