/* PropSavvy Solutions - Hero Banner Responsive Fixes */

/* Cross-browser compatibility and mobile-first approach */
.hero-carousel-section {
    /* Allow content to expand naturally */
    overflow: visible !important;
    /* Cross-browser height support */
    height: 100vh;
    height: -webkit-fill-available;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    /* Ensure proper display on all devices */
    display: block;
    position: relative;
}

/* Cross-browser viewport height fix for mobile browsers */
@supports (-webkit-touch-callout: none) {
    .hero-carousel-section {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
}

/* Fallback for older browsers */
@supports not (height: 100vh) {
    .hero-carousel-section {
        height: 100%;
        min-height: 600px;
    }
}

/* Enhanced mobile-first responsive approach */
/* Large Desktop (1400px and up) */
@media (min-width: 1400px) {
    .hero-carousel-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 4rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
    }
    
    .hero-description {
        font-size: 1.2rem;
    }
}

/* Desktop (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .hero-carousel-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 3.5rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
}

/* Large Tablet (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .hero-carousel-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 3rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
}

/* Tablet (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-carousel-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
}

@media (max-width: 992px) {
    .hero-carousel-section {
        min-height: 85vh !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .hero-carousel-section .carousel-item {
        min-height: 85vh !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .hero-content {
        min-height: 85vh !important;
        height: auto !important;
        padding: 1.4rem 0 !important;
    }
}

/* Mobile Landscape (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .hero-carousel-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    .hero-buttons .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Mobile Portrait (480px to 575px) */
@media (min-width: 480px) and (max-width: 575px) {
    .hero-carousel-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-description {
        font-size: 0.85rem;
    }
    
    .hero-buttons .btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

/* Small Mobile (320px to 479px) */
@media (min-width: 320px) and (max-width: 479px) {
    .hero-carousel-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-description {
        font-size: 0.8rem;
    }
    
    .hero-buttons .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .hero-carousel-section,
    .hero-carousel-section .carousel-item,
    .hero-content {
        min-height: 65vh !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.6rem !important;
    }
    
    .hero-description {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
}

@media (max-width: 480px) {
    .hero-carousel-section {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
    }
    
    .hero-carousel-section .carousel-item {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
    }
    
    .hero-content {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        padding: 1rem 0 !important;
    }
    
    .hero-title {
        font-size: 1.4rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.6rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero-description {
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.8rem !important;
    }
    
    .hero-buttons {
        margin-top: 1rem !important;
    }
    
    .hero-buttons .btn {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.85rem !important;
    }
}

/* Ensure carousel items can expand */
.hero-carousel-section .carousel-item {
    height: auto !important;
    min-height: 100%;
}

.hero-carousel-section .carousel-inner {
    height: auto !important;
    min-height: 100%;
}

/* Background image/video positioning for better visibility */
@media (max-width: 768px) {
    .hero-video {
        object-fit: cover !important;
        object-position: center center !important;
    }
    
    .hero-image {
        background-size: cover !important;
        background-position: center center !important;
    }
}

@media (max-width: 576px) {
    .hero-video {
        object-fit: cover !important;
        object-position: center top !important;
    }
    
    .hero-image {
        background-size: cover !important;
        background-position: center top !important;
    }
}

/* Stats and features responsive adjustments */
@media (max-width: 768px) {
    .hero-stats,
    .hero-features {
        min-height: 250px !important;
    }
    
    .hero-stats .stat-item {
        padding: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero-stats .stat-item h3 {
        font-size: 1.8rem !important;
    }
    
    .hero-stats .stat-item p {
        font-size: 0.8rem !important;
    }
    
    .feature-item {
        padding: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .feature-item h4 {
        font-size: 1rem !important;
    }
    
    .feature-item p {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 576px) {
    .hero-stats,
    .hero-features {
        min-height: 200px !important;
    }
    
    .hero-stats .stat-item {
        padding: 0.6rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    .hero-stats .stat-item h3 {
        font-size: 1.5rem !important;
    }
    
    .hero-stats .stat-item p {
        font-size: 0.75rem !important;
    }
    
    .feature-item {
        padding: 0.6rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    .feature-item h4 {
        font-size: 0.9rem !important;
    }
    
    .feature-item p {
        font-size: 0.75rem !important;
    }
}

/* Carousel controls responsive positioning */
@media (max-width: 768px) {
    .carousel-control-prev,
    .carousel-control-next {
        width: 50px !important;
        height: 50px !important;
    }
    
    .carousel-control-prev {
        left: 15px !important;
    }
    
    .carousel-control-next {
        right: 15px !important;
    }
}

@media (max-width: 576px) {
    .carousel-control-prev,
    .carousel-control-next {
        width: 45px !important;
        height: 45px !important;
    }
    
    .carousel-control-prev {
        left: 10px !important;
    }
    
    .carousel-control-next {
        right: 10px !important;
    }
    
    .carousel-indicators {
        bottom: 15px !important;
    }
}

/* Ensure content is never cut off */
.hero-content .container {
    height: auto !important;
    min-height: 100%;
}

.hero-content .row {
    height: auto !important;
    min-height: 100%;
}

/* Cross-browser compatibility and touch optimizations */
.hero-carousel-section,
.hero-carousel-section .carousel,
.hero-carousel-section .carousel-inner,
.hero-carousel-section .carousel-item,
.hero-content {
    overflow: visible !important;
    /* Cross-browser compatibility */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    /* Smooth scrolling for touch devices */
    -webkit-overflow-scrolling: touch;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .hero-carousel-section .carousel-control-prev,
    .hero-carousel-section .carousel-control-next {
        width: 60px !important;
        height: 60px !important;
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    .hero-buttons .btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 20px !important;
    }
    
    .hero-carousel-section .carousel-indicators button {
        min-height: 44px !important;
        min-width: 44px !important;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-carousel-section .hero-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .hero-carousel-section {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
    
    .hero-carousel-section .carousel-item {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
}

/* Android Chrome specific fixes */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .hero-carousel-section {
        height: 100vh;
        min-height: 100vh;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
    }
    
    .hero-description {
        font-size: 0.8rem !important;
    }
}

/* DIRECT FIX: Force all banners to have exactly the same height */
.hero-carousel-section .carousel-item {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
}

.hero-carousel-section .hero-content {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
}

.hero-carousel-section .hero-content .container {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
}

.hero-carousel-section .hero-content .row {
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
}

/* Force consistent content heights */
.hero-stats,
.hero-features {
    height: 100% !important;
    min-height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-stats .row {
    height: 100% !important;
    display: flex;
    align-items: center;
}

.hero-features {
    flex-direction: column;
    gap: 1.5rem;
    height: 100% !important;
}

/* Performance optimizations */
.hero-carousel-section {
    /* Hardware acceleration for smooth animations */
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    /* Optimize repaints */
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .hero-carousel-section .carousel-item {
        transition: none !important;
    }
    
    .hero-carousel-section .carousel-control-prev,
    .hero-carousel-section .carousel-control-next {
        transition: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .hero-carousel-section .carousel-control-prev,
    .hero-carousel-section .carousel-control-next {
        background-color: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .hero-carousel-section .carousel-indicators button {
        background-color: rgba(255, 255, 255, 0.3) !important;
    }
    
    .hero-carousel-section .carousel-indicators button.active {
        background-color: rgba(255, 255, 255, 0.8) !important;
    }
}