/* ==================== HERO SLIDER CSS ==================== */

/* Main hero slider container */
#hero-slider {
    width: 100% !important;
    height: 500px !important; /* Fixed height for consistency */
    position: relative;
    overflow: hidden !important;
    border-radius: 0 !important; /* Remove border radius for full-width hero */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Enhanced carousel styling */
#hero-slider .carousel {
    height: 100% !important;
    width: 100% !important;
}

#hero-slider .carousel-inner {
    height: 100% !important;
    width: 100% !important;
}

/* Fixed dimensions for carousel items */
#hero-slider .carousel-item {
    height: 500px !important; /* Fixed height */
    width: 100% !important;
    position: relative;
    overflow: hidden !important;
    background-color: #f8f9fa; /* Fallback background */
}

/* Image styling with fixed dimensions and proper fitting */
#hero-slider .carousel-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Ensures image covers the entire area */
    object-position: center !important; /* Centers the image */
    display: block !important;
    transition: transform 0.3s ease;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Hover effect for images */
#hero-slider .carousel-item:hover img {
    transform: scale(1.02);
}

/* Enhanced overlay for better text readability */
#hero-slider .carousel-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0.1) 70%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 1;
}

/* Modern caption container with backdrop */
#hero-slider .carousel-caption {
    position: absolute !important;
    bottom: 15% !important;
    left: 6% !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    max-width: 650px !important;
    text-align: left !important;
    z-index: 3;
    padding: 40px 45px !important;
    animation: slideInFromLeft 1s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-80px) translateY(20px);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
        filter: blur(0);
    }
}

/* Modern typography for slide titles */
#hero-slider .carousel-caption h1,
#hero-slider .carousel-caption h5,
#hero-slider .carousel-caption .slide-title {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto",
        "Helvetica Neue", Arial, sans-serif !important;
    font-size: 3.2rem !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    color: #ffffff !important;
    margin-bottom: 1.5rem !important;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5) !important;
    letter-spacing: -0.02em !important;
    position: relative !important;
}

/* Add subtle underline accent to titles */
#hero-slider .carousel-caption h1::after,
#hero-slider .carousel-caption h5::after,
#hero-slider .carousel-caption .slide-title::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #067f4f 0%, #1f6b46 100%);
    border-radius: 2px;
    animation: expandLine 0.8s ease-out 0.5s both;
}

@keyframes expandLine {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 60px;
        opacity: 1;
    }
}

/* Enhanced description styling */
#hero-slider .carousel-caption p,
#hero-slider .carousel-caption .slide-description {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto",
        "Helvetica Neue", Arial, sans-serif !important;
    font-size: 1.25rem !important;
    line-height: 1.7 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 400 !important;
    margin-bottom: 2.5rem !important;
    margin-top: 1.5rem !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
    letter-spacing: 0.01em !important;
    max-width: 500px !important;
}

/* Enhanced call-to-action button */
#hero-slider .carousel-caption .btn,
#hero-slider .carousel-caption .btn-slide-action {
    background: linear-gradient(135deg, #067f4f 0%, #1f6b46 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto",
        "Helvetica Neue", Arial, sans-serif !important;
    font-weight: 600 !important;
    border-radius: 50px !important;
    font-size: 1.1rem !important;
    color: white !important;
    text-decoration: none !important;
    padding: 15px 35px !important;
    margin-top: 1rem !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    font-size: 0.95rem !important;
    backdrop-filter: blur(5px) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Button hover effects */
#hero-slider .carousel-caption .btn:hover,
#hero-slider .carousel-caption .btn-slide-action:hover {
    background: linear-gradient(135deg, #1f6b46 0%, #067f4f 100%) !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 15px 35px rgba(6, 127, 79, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    text-decoration: none !important;
}

/* Button active state */
#hero-slider .carousel-caption .btn:active,
#hero-slider .carousel-caption .btn-slide-action:active {
    transform: translateY(-1px) scale(1.02) !important;
}

/* Add subtle animation to button */
#hero-slider .carousel-caption .btn::before,
#hero-slider .carousel-caption .btn-slide-action::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s;
}

#hero-slider .carousel-caption .btn:hover::before,
#hero-slider .carousel-caption .btn-slide-action:hover::before {
    left: 100%;
}

/* Navigation controls */
#hero-slider .carousel-control-prev,
#hero-slider .carousel-control-next {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#hero-slider .carousel-control-prev {
    left: 20px;
}

#hero-slider .carousel-control-next {
    right: 20px;
}

#hero-slider .carousel-control-prev:hover,
#hero-slider .carousel-control-next:hover {
    background-color: rgba(6, 127, 79, 0.8);
    transform: translateY(-50%) scale(1.1);
}

#hero-slider .carousel-control-prev-icon,
#hero-slider .carousel-control-next-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

/* Indicators */
#hero-slider .carousel-indicators {
    bottom: 30px;
    margin-bottom: 0;
}

#hero-slider .carousel-indicators button {
    background-color: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px;
    transition: all 0.3s ease;
}

#hero-slider .carousel-indicators button.active {
    background-color: #067f4f;
    border-color: #067f4f;
    transform: scale(1.3);
}

#hero-slider .carousel-indicators button:hover {
    background-color: rgba(6, 127, 79, 0.7);
    transform: scale(1.1);
}

/* Loading state */
#hero-slider .slider-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e0;
}

#hero-slider .spinner-border {
    color: #067f4f;
}

/* Error state */
#hero-slider .alert {
    margin: 0;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

/* Responsive Design - Enhanced for new styling */
@media (max-width: 1200px) {
    #hero-slider {
        height: 450px !important;
    }

    #hero-slider .carousel-item {
        height: 450px !important;
    }

    #hero-slider .carousel-caption {
        max-width: 580px !important;
        padding: 35px 40px !important;
    }

    #hero-slider .carousel-caption h1,
    #hero-slider .carousel-caption h5,
    #hero-slider .carousel-caption .slide-title {
        font-size: 2.8rem !important;
    }

    #hero-slider .carousel-caption p,
    #hero-slider .carousel-caption .slide-description {
        font-size: 1.15rem !important;
    }
}

@media (max-width: 992px) {
    #hero-slider {
        height: 400px !important;
    }

    #hero-slider .carousel-item {
        height: 400px !important;
    }

    #hero-slider .carousel-caption {
        left: 4% !important;
        right: 4% !important;
        max-width: 92% !important;
        bottom: 12% !important;
        padding: 30px 35px !important;
        border-radius: 16px !important;
    }

    #hero-slider .carousel-caption h1,
    #hero-slider .carousel-caption h5,
    #hero-slider .carousel-caption .slide-title {
        font-size: 2.4rem !important;
        margin-bottom: 1.2rem !important;
    }

    #hero-slider .carousel-caption p,
    #hero-slider .carousel-caption .slide-description {
        font-size: 1.1rem !important;
        margin-bottom: 2rem !important;
    }

    #hero-slider .carousel-caption .btn,
    #hero-slider .carousel-caption .btn-slide-action {
        padding: 12px 28px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    #hero-slider {
        height: 350px !important;
        margin-bottom: 1.5rem;
    }

    #hero-slider .carousel-item {
        height: 350px !important;
    }

    #hero-slider .carousel-caption {
        bottom: 8% !important;
        left: 3% !important;
        right: 3% !important;
        max-width: 94% !important;
        padding: 25px 30px !important;
        border-radius: 14px !important;
    }

    #hero-slider .carousel-caption h1,
    #hero-slider .carousel-caption h5,
    #hero-slider .carousel-caption .slide-title {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }

    #hero-slider .carousel-caption h1::after,
    #hero-slider .carousel-caption h5::after,
    #hero-slider .carousel-caption .slide-title::after {
        width: 45px !important;
        height: 3px !important;
    }

    #hero-slider .carousel-caption p,
    #hero-slider .carousel-caption .slide-description {
        font-size: 1rem !important;
        margin-bottom: 1.8rem !important;
        margin-top: 1.2rem !important;
    }

    #hero-slider .carousel-caption .btn,
    #hero-slider .carousel-caption .btn-slide-action {
        padding: 10px 24px !important;
        font-size: 0.85rem !important;
        border-radius: 40px !important;
    }

    #hero-slider .carousel-control-prev,
    #hero-slider .carousel-control-next {
        width: 50px;
        height: 50px;
    }

    #hero-slider .carousel-control-prev {
        left: 15px;
    }

    #hero-slider .carousel-control-next {
        right: 15px;
    }
}

@media (max-width: 576px) {
    #hero-slider {
        height: 300px !important;
        margin-bottom: 1rem;
    }

    #hero-slider .carousel-item {
        height: 300px !important;
    }

    #hero-slider .carousel-caption {
        bottom: 5% !important;
        left: 2% !important;
        right: 2% !important;
        max-width: 96% !important;
        padding: 20px 25px !important;
        border-radius: 12px !important;
    }

    #hero-slider .carousel-caption h1,
    #hero-slider .carousel-caption h5,
    #hero-slider .carousel-caption .slide-title {
        font-size: 1.6rem !important;
        margin-bottom: 0.8rem !important;
        line-height: 1.2 !important;
    }

    #hero-slider .carousel-caption h1::after,
    #hero-slider .carousel-caption h5::after,
    #hero-slider .carousel-caption .slide-title::after {
        width: 35px !important;
        height: 2px !important;
    }

    #hero-slider .carousel-caption p,
    #hero-slider .carousel-caption .slide-description {
        font-size: 0.9rem !important;
        margin-bottom: 1.5rem !important;
        margin-top: 1rem !important;
        line-height: 1.6 !important;
    }

    #hero-slider .carousel-caption .btn,
    #hero-slider .carousel-caption .btn-slide-action {
        padding: 8px 20px !important;
        font-size: 0.8rem !important;
        border-radius: 35px !important;
    }

    #hero-slider .carousel-control-prev,
    #hero-slider .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    #hero-slider .carousel-control-prev {
        left: 10px;
    }

    #hero-slider .carousel-control-next {
        right: 10px;
    }

    #hero-slider .carousel-indicators {
        bottom: 20px;
    }

    #hero-slider .carousel-indicators button {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
}

/* High-resolution displays - Enhanced styling */
@media (min-width: 1400px) {
    #hero-slider {
        height: 500px !important;
    }

    #hero-slider .carousel-item {
        height: 500px !important;
    }

    #hero-slider .carousel-caption {
        max-width: 750px !important;
        padding: 50px 55px !important;
        bottom: 18% !important;
    }

    #hero-slider .carousel-caption h1,
    #hero-slider .carousel-caption h5,
    #hero-slider .carousel-caption .slide-title {
        font-size: 3.8rem !important;
        margin-bottom: 1.8rem !important;
    }

    #hero-slider .carousel-caption h1::after,
    #hero-slider .carousel-caption h5::after,
    #hero-slider .carousel-caption .slide-title::after {
        width: 80px !important;
        height: 5px !important;
    }

    #hero-slider .carousel-caption p,
    #hero-slider .carousel-caption .slide-description {
        font-size: 1.4rem !important;
        margin-bottom: 3rem !important;
        margin-top: 2rem !important;
        max-width: 600px !important;
    }

    #hero-slider .carousel-caption .btn,
    #hero-slider .carousel-caption .btn-slide-action {
        padding: 18px 40px !important;
        font-size: 1.05rem !important;
    }
}

/* Accessibility improvements */
#hero-slider .carousel-control-prev:focus,
#hero-slider .carousel-control-next:focus,
#hero-slider .carousel-indicators button:focus {
    outline: 2px solid #067f4f;
    outline-offset: 2px;
}

/* Smooth transitions */
#hero-slider .carousel-item {
    transition: transform 0.6s ease-in-out;
}

#hero-slider .carousel-item.active {
    transform: translateX(0);
}

#hero-slider .carousel-item-next,
#hero-slider .carousel-item-prev {
    transform: translateX(0);
}

#hero-slider .carousel-item-next.carousel-item-start,
#hero-slider .carousel-item-prev.carousel-item-end {
    transform: translateX(0);
}

#hero-slider .carousel-item-next:not(.carousel-item-start),
#hero-slider .active.carousel-item-end {
    transform: translateX(100%);
}

#hero-slider .carousel-item-prev:not(.carousel-item-end),
#hero-slider .active.carousel-item-start {
    transform: translateX(-100%);
}

/* Fallback for images that fail to load */
#hero-slider .carousel-item img[src=""],
#hero-slider .carousel-item img:not([src]) {
    background-color: #e9ecef;
    background-image: url("data:image/svg+xml,%3csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100' height='100' fill='%23e9ecef'/%3e%3ctext x='50%25' y='50%25' font-size='18' text-anchor='middle' alignment-baseline='middle' font-family='monospace, monospace' fill='%236c757d'%3eImage%3c/text%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 200px 200px;
}

/* Additional image consistency rules */
#hero-slider .carousel-item img {
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
}

/* Print styles */
@media print {
    #hero-slider {
        height: auto !important;
        box-shadow: none !important;
    }

    #hero-slider .carousel-control-prev,
    #hero-slider .carousel-control-next,
    #hero-slider .carousel-indicators {
        display: none !important;
    }

    #hero-slider .carousel-item {
        height: auto !important;
    }

    #hero-slider .carousel-item::before {
        display: none !important;
    }
}
