/**
 * Enhanced Slider Widget Styles
 * Optimized for Performance & Browser Caching
 */

/* ========== Core Slider Styles ========== */
.enhanced-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.enhanced-slider-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

.carousel-inner {
    height: 100%;
}

.carousel-item {
    height: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ========== Ken Burns Effect ========== */
[data-ken-burns="yes"] .carousel-item.active img {
    animation: kenBurnsZoom 10s ease-out forwards;
}

@keyframes kenBurnsZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.15);
    }
}

/* ========== Overlay Styles ========== */
.slider-overlay-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.slider-overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

/* ========== Overlay Text Elements ========== */
.overlay-subtitle {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
    opacity: 0;
    color: #ffffff;
}

.overlay-title {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    opacity: 0;
    color: #ffffff;
    max-width: 900px;
}

.overlay-title .title-underline {
    display: block;
    width: 100px;
    height: 4px;
    margin: 20px auto 0;
    border-radius: 2px;
}

.overlay-description {
    font-size: 20px;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0;
    color: #ffffff;
    max-width: 700px;
}

.overlay-description p {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

.overlay-description * {
    color: inherit;
}

.slider-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.slider-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.slider-button:hover::before {
    width: 300px;
    height: 300px;
}

.slider-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.slider-button i {
    transition: transform 0.3s ease;
}

.slider-button:hover i {
    transform: translateX(5px);
}

/* Button Sizes */
.slider-button.btn-small {
    padding: 10px 25px;
    font-size: 14px;
}

.slider-button.btn-medium {
    padding: 15px 35px;
    font-size: 16px;
}

.slider-button.btn-large {
    padding: 18px 45px;
    font-size: 18px;
}

/* ========== Animations ========== */
.animate-element {
    opacity: 0;
}

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Down */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations */
.animate-element[data-animation="fadeIn"] {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-element[data-animation="fadeInUp"] {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-element[data-animation="slideInDown"] {
    animation: slideInDown 0.8s ease-out forwards;
}

.animate-element[data-animation="slideInLeft"] {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-element[data-animation="slideInRight"] {
    animation: slideInRight 0.8s ease-out forwards;
}

.animate-element[data-animation="zoomIn"] {
    animation: zoomIn 0.8s ease-out forwards;
}

.animate-element[data-animation="bounceIn"] {
    animation: bounceIn 0.8s ease-out forwards;
}

/* ========== Navigation Arrows ========== */
.carousel-control-prev,
.carousel-control-next {
    width: 60px;
    height: 60px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.enhanced-slider-wrapper:hover .carousel-control-prev,
.enhanced-slider-wrapper:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-prev {
    left: 30px;
}

.carousel-control-next {
    right: 30px;
}

.carousel-control-prev i,
.carousel-control-next i {
    font-size: 24px;
    color: #ffffff;
}

/* Arrow Style 1 - Circle */
.arrow-style-1.carousel-control-prev,
.arrow-style-1.carousel-control-next {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.arrow-style-1:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

/* Arrow Style 2 - Square */
.arrow-style-2.carousel-control-prev,
.arrow-style-2.carousel-control-next {
    background: rgba(151, 36, 36, 0.8);
    border-radius: 8px;
}

.arrow-style-2:hover {
    background: rgba(151, 36, 36, 1);
    transform: translateY(-50%) scale(1.1);
}

/* Arrow Style 3 - Minimal */
.arrow-style-3.carousel-control-prev,
.arrow-style-3.carousel-control-next {
    background: transparent;
    border: none;
}

.arrow-style-3 i {
    font-size: 36px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.arrow-style-3:hover i {
    transform: scale(1.2);
}

/* ========== Dots Indicators ========== */
.carousel-indicators {
    margin-bottom: 30px;
    z-index: 10;
}

.carousel-indicators li {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    margin: 0 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators li.active {
    width: 40px;
    border-radius: 6px;
    background: #972424;
    border-color: #972424;
}

.carousel-indicators li:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

/* Dots Positions */
.carousel-indicators.dots-bottom-center {
    justify-content: center;
}

.carousel-indicators.dots-bottom-left {
    justify-content: flex-start;
    left: 30px;
    right: auto;
}

.carousel-indicators.dots-bottom-right {
    justify-content: flex-end;
    left: auto;
    right: 30px;
}

/* ========== Progress Bar ========== */
.slider-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #972424 0%, #2596be 100%);
    width: 0%;
    transition: width linear;
}

/* ========== Responsive Design ========== */
@media (max-width: 1024px) {
    .overlay-title {
        font-size: 42px;
    }

    .overlay-subtitle {
        font-size: 16px;
    }

    .overlay-description {
        font-size: 18px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 50px;
        height: 50px;
    }

    .carousel-control-prev {
        left: 20px;
    }

    .carousel-control-next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .enhanced-slider-container {
        height: 100vh;
        min-height: 100vh;
    }

    .overlay-title {
        font-size: 32px;
    }

    .overlay-subtitle {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .overlay-description {
        font-size: 16px;
    }

    .overlay-description p {
        font-size: inherit;
    }

    .slider-button {
        padding: 12px 28px;
        font-size: 14px;
    }

    .slider-button.btn-small {
        padding: 10px 20px;
        font-size: 13px;
    }

    .slider-button.btn-large {
        padding: 14px 32px;
        font-size: 15px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    .carousel-control-prev i,
    .carousel-control-next i {
        font-size: 18px;
    }

    .carousel-control-prev {
        left: 15px;
    }

    .carousel-control-next {
        right: 15px;
    }

    .carousel-indicators {
        margin-bottom: 20px;
    }

    .carousel-indicators li {
        width: 10px;
        height: 10px;
    }

    .carousel-indicators li.active {
        width: 30px;
    }
}

@media (max-width: 480px) {
    .enhanced-slider-container {
        height: 100vh;
        min-height: 100vh;
    }

    .slider-overlay-content {
        padding: 20px 15px;
    }

    .overlay-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .overlay-subtitle {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .overlay-description {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .overlay-title .title-underline {
        width: 60px;
        height: 3px;
        margin-top: 12px;
    }

    .slider-button {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .carousel-indicators.dots-bottom-left,
    .carousel-indicators.dots-bottom-right {
        justify-content: center;
        left: 0;
        right: 0;
    }
}

/* ========== RTL Support ========== */
[dir="rtl"] .slider-button i {
    transform: rotate(180deg);
}

[dir="rtl"] .slider-button:hover i {
    transform: rotate(180deg) translateX(5px);
}

[dir="rtl"] .carousel-control-prev {
    left: auto;
    right: 30px;
}

[dir="rtl"] .carousel-control-next {
    right: auto;
    left: 30px;
}

[dir="rtl"] .carousel-indicators.dots-bottom-left {
    left: auto;
    right: 30px;
}

[dir="rtl"] .carousel-indicators.dots-bottom-right {
    right: auto;
    left: 30px;
}

/* ========== Accessibility ========== */
.carousel-control-prev:focus,
.carousel-control-next:focus,
.slider-button:focus {
    outline: 3px solid #2596be;
    outline-offset: 3px;
}

.carousel-indicators li:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ========== Print Styles ========== */
@media print {
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators,
    .slider-progress-bar {
        display: none;
    }

    .enhanced-slider-container {
        height: auto;
    }

    .carousel-item {
        page-break-inside: avoid;
    }
}

/* ========== Preloader ========== */
.slider-preloader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.slider-preloader.hide {
    opacity: 0;
    pointer-events: none;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #972424;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
