/* Hero Slider Styles */
.hero-slider-section {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #000;
    display: block;
}

/* Use a wrapper to maintain aspect ratio */
.hero-slider::before {
    content: "";
    display: block;
    padding-top: 39.0625%; /* 750/1920 * 100 = 39.0625% */
}

/* Slide Styles */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide.fade-in {
    opacity: 1;
    z-index: 2;
}

.slide.fade-out {
    opacity: 0;
    z-index: 1;
}

.slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
}

/* Alternative approach for better zoom handling */
@supports (aspect-ratio: 1) {
    .hero-slider::before {
        display: none;
    }
    
    .hero-slider {
        aspect-ratio: 1920 / 750;
        max-height: calc(100vh - 100px); /* Adjust based on header height */
    }
}

/* Slide Overlay - removed to show full image */
.slide-overlay {
    display: none;
}

/* Container - only for caption, not slider */
.slide-caption .container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Slide Content */
.slide-content {
    max-width: 800px;
    color: white;
    text-align: left;
    animation: slideInLeft 1s ease-out;
}

.slide.active .slide-content {
    animation: slideInLeft 1s ease-out;
}

.slide-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.slide-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.slide-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    border: none;
    font-family: inherit;
    min-width: 150px;
}

.btn-primary {
    background-color: #5B7FCC;
    color: white;
    border: 2px solid #5B7FCC;
}

.btn-primary:hover {
    background-color: #4c6fb8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(91, 127, 204, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: white;
    color: #5B7FCC;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

/* Navigation Arrows */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
}

/* Show navigation on slider hover */
.hero-slider:hover .slider-nav,
.hero-slider-section:hover .slider-nav {
    opacity: 1;
    visibility: visible;
}

.slider-nav:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.05);
}

/* Keep navigation visible on focus for accessibility */
.slider-nav:focus {
    opacity: 1;
    visibility: visible;
    outline: 2px solid white;
    outline-offset: 2px;
}

.slider-nav.prev {
    left: 30px;
}

.slider-nav.next {
    right: 30px;
}

.slider-nav svg {
    width: 24px;
    height: 24px;
}

/* Slide Indicators */
.slider-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.indicator.active {
    background: white;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Slide Caption Area - Positioned below slider */
.slide-caption {
    background: transparent;
    color: #374151;
    padding: 0;
    position: relative;
    z-index: 5;
    margin-top: 0;
    display: block;
}

.caption-text {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
    color: #374151;
    text-shadow: none;
    padding: 0 20px;
    margin-top: 15px;
    white-space: pre-line;
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design - Focus on maintaining aspect ratio */
@media (max-width: 1920px) {
    .hero-slider {
        max-height: 750px; /* Original image height at full width */
    }
}

@media (max-width: 1600px) {
    .hero-slider {
        max-height: 625px; /* Proportional reduction */
    }
}

@media (max-width: 1400px) {
    .hero-slider {
        max-height: 547px;
    }
    
    .slide-title {
        font-size: 3rem;
    }
    
    .slide-subtitle {
        font-size: 1.3rem;
    }
}

@media (max-width: 1200px) {
    .hero-slider {
        max-height: 469px;
    }
    
    .slide-title {
        font-size: 2.5rem;
    }
    
    .slide-subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
    
    .slider-nav {
        width: 50px;
        height: 50px;
    }
    
    .slider-nav.prev {
        left: 20px;
    }
    
    .slider-nav.next {
        right: 20px;
    }
}

@media (max-width: 1024px) {
    .hero-slider {
        max-height: 400px;
    }
    
    .slide-content {
        max-width: 600px;
    }
    
    .slide-title {
        font-size: 2.2rem;
    }
    
    .slide-subtitle {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        min-width: 130px;
    }
}

@media (max-width: 768px) {
    /* Remove fixed height container - let images determine height */
    .hero-slider::before {
        display: none !important;
    }

    .hero-slider {
        height: auto !important;
        max-height: none !important;
        position: relative;
        min-height: 0 !important;
        display: block;
        overflow: visible;
    }

    /* All slides absolute positioned by default */
    .slide {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100%;
        height: 0;
        overflow: hidden;
    }

    /* Only active slide is relative and visible */
    .slide.active {
        position: relative !important;
        height: auto !important;
        overflow: visible;
    }

    /* Prevent image cropping - show full image at full width */
    .slide img {
        position: relative;
        width: 100%;
        height: auto !important;
        max-height: none;
        object-fit: cover;
        display: block;
        vertical-align: bottom;
        line-height: 0;
    }

    /* Always show navigation on mobile */
    .slider-nav {
        opacity: 1;
        visibility: visible;
        position: absolute;
    }
    
    .slide-content {
        text-align: center;
        max-width: 100%;
    }
    
    .slide-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .slide-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .slide-buttons {
        justify-content: center;
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
    
    .slider-nav {
        width: 45px;
        height: 45px;
    }
    
    .slider-nav.prev {
        left: 15px;
    }
    
    .slider-nav.next {
        right: 15px;
    }
    
    .slider-indicators {
        bottom: 20px;
        padding: 12px 20px;
        gap: 10px;
    }
    
    .indicator {
        width: 10px;
        height: 10px;
    }
    
    /* Responsive Caption Styles */
    .slide-caption {
        padding: 0;
    }
    
    .caption-text {
        font-size: 13px;
        padding: 0 15px;
        letter-spacing: 0.4px;
        margin-top: 12px;
    }
}

@media (max-width: 640px) {
    .slide-caption .container {
        padding: 0 15px;
    }
    
    .slide-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .slide-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }
    
    .slide-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
        padding: 0.75rem 1rem;
    }
    
    .slider-nav {
        width: 40px;
        height: 40px;
    }
    
    .slider-nav.prev {
        left: 10px;
    }
    
    .slider-nav.next {
        right: 10px;
    }
    
    .slider-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .slider-indicators {
        bottom: 15px;
        padding: 10px 15px;
        gap: 8px;
    }
    
    .indicator {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .slide-caption {
        padding: 0;
    }
    
    .caption-text {
        font-size: 12px;
        padding: 0 10px;
        letter-spacing: 0.3px;
        line-height: 1.3;
        margin-top: 10px;
    }
    
    .slide-title {
        font-size: 1.5rem;
    }
    
    .slide-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.625rem 0.875rem;
    }
    
    .slider-indicators {
        bottom: 10px;
        padding: 8px 12px;
        gap: 6px;
    }
}

/* Zoom level fixes */
@media (min-width: 1921px) {
    .hero-slider {
        max-height: calc(100vw * 750 / 1920);
    }
}

/* Force full width at all zoom levels */
.hero-slider-section,
.hero-slider,
.slide {
    min-width: 100%;
    width: 100% !important;
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .slide img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .slide {
        transition: opacity 0.3s ease;
    }
    
    .slide-content {
        animation: none;
    }
    
    .btn,
    .slider-nav,
    .indicator {
        transition: none;
    }
}

/* Print styles */
@media print {
    .hero-slider-section {
        height: auto;
        max-height: none;
    }
    
    .slider-nav,
    .slider-indicators {
        display: none;
    }
    
    .slide {
        position: static;
        opacity: 1;
        page-break-after: always;
    }
    
    .slide:last-child {
        page-break-after: avoid;
    }
}

/* Loading state */
.hero-slider.loading .slide {
    opacity: 0;
}

.hero-slider.loading .slide:first-child {
    opacity: 1;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Slider preloader */
.slider-preloader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.slider-preloader.hidden {
    display: none;
}

/* Slide counter (optional) */
.slide-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10;
    backdrop-filter: blur(5px);
}

@media (max-width: 768px) {
    .slide-counter {
        top: 15px;
        right: 15px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}