/* Carousel Navigation Buttons */
.carousel-nav-btn {
    position: absolute;
    z-index: 2;
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-control-prev.carousel-nav-btn {
    left: 10px;
}

.carousel-control-next.carousel-nav-btn {
    right: 10px;
}

.carousel-nav-btn:hover {
    background: rgba(0, 0, 0, 0.4);
}

/* Outline Button with Dynamic Text Color */
.btn-outline-light[data-text-color] {
    --btn-outline-color: #ffffff;
    border-color: var(--btn-outline-color);
    color: var(--btn-outline-color);
}

.btn-outline-light[data-text-color]:hover {
    background-color: var(--btn-outline-color);
    color: var(--hero-bg-color, #4361ee);
}

/* Dynamic Hero Styles */
.hero-section {
    min-height: auto !important;
    padding: 0.3rem 0 !important;
    margin: 0;
}

.hero-card {
    background-color: var(--hero-bg-color, #4361ee);
    color: var(--hero-text-color, #ffffff);
    border-radius: 0.4rem;
    margin-bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: auto !important;
}

.hero-card .card-body {
    padding: 0.4rem 0.5rem !important;
    width: 100%;
    flex: 0 0 auto;
}

.hero-card .text-uppercase {
    color: var(--hero-text-color, #ffffff);
    opacity: 0.8;
    letter-spacing: 0.5px;
    font-size: 0.6rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-card .display-5 {
    color: var(--hero-text-color, #ffffff);
    font-size: 0.68rem;
    margin: 0.05rem 0;
    line-height: 1.1;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 1.5em;
}

.hero-card .text-white-50 {
    display: none; /* Hide description completely */
}

.hero-card .btn {
    padding: 0.08rem 0.3rem;
    font-size: 0.54rem;
    font-weight: 600;
    border-radius: 2px;
    transition: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
    margin: 0.03rem 0.05rem 0.03rem 0;
    line-height: 1;
    white-space: nowrap;
    min-height: auto;
}

.hero-card .btn-primary {
    background-color: var(--btn-bg, #ffffff);
    color: var(--btn-color, #4361ee);
    border: none;
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-card .btn-outline-light {
    border: 2px solid var(--btn-outline-color, #ffffff);
    color: var(--btn-outline-color, #ffffff);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
}

.hero-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.hero-stats-item .stat-value {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--hero-text-color, #ffffff);
    margin: 0;
    line-height: 1;
}

.hero-stats-item .stat-label {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-card .hero-stats-item {
    text-align: center;
    position: relative;
}

.hero-stats-item {
    text-align: center;
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    flex: 1;
    min-width: 40px;
    line-height: 1;
}

.hero-card .stats-row {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.1rem;
    margin-top: 0.1rem;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.15rem;
    overflow: hidden;
    width: 100%;
}

.hero-card .hero-stats-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
}

.hero-text-card {
    padding: 0 !important;
    display: flex;
    align-items: stretch;
    height: 100%;
}

.hero-text-card .card {
    height: 100% !important;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    border: none !important;
}

.hero-text-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem !important;
}

.hero-buttons {
    display: flex;
    gap: 0.1rem;
    margin: 0.1rem 0 0 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    width: 100%;
}

.hero-buttons::-webkit-scrollbar {
    display: none;
}

.hero-buttons .btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.hero-buttons .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.hero-buttons .btn:hover::after {
    opacity: 1;
}

.video-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

/* Carousel controls */
.carousel-control-prev,
.carousel-control-next {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(0, 0, 0, 0.4);
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Hero image styles */
.hero-image-card {
    display: flex;
    align-items: stretch;
    height: 100%;
    padding: 0 !important;
}

.hero-image-card .card {
    border-radius: 0.4rem;
    overflow: hidden;
    height: 100%;
    width: 100%;
    display: flex;
    margin: 0;
    border: none !important;
}

.hero-image-card img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    min-height: 160px;
    flex: 1;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .hero-card .display-5 {
        font-size: 0.9rem;
        margin: 0.1rem 0;
        line-height: 1.1;
    }
    
    .hero-card .card-body {
        padding: 0.5rem 0.6rem !important;
    }
}

@media (min-width: 992px) {
    .hero-card .display-5 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem !important;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        max-height: none;
    }
    
    .hero-card .card-body {
        padding: 1.5rem !important;
    }
    
    .hero-image-card,
    .hero-text-card {
        min-height: 200px;
        height: 100%;
    }
    
    .hero-image-card .card,
    .hero-text-card .card {
        min-height: 200px;
        height: 100%;
    }
    
    .hero-image-card img {
        min-height: 200px;
    }
    
    .hero-text-card .card-body {
        padding: 1.5rem !important;
    }
}

@media (max-width: 991.98px) {
    /* Stacked layout for tablets */
    .hero-text-card {
        order: 1;
        padding: 0 !important;
        flex: 0 0 100%;
        max-width: 100%;
        height: auto;
        min-height: auto;
    }
    
    .hero-text-card .card {
        height: auto !important;
    }
    
    .hero-image-card {
        order: 2;
        padding: 0 !important;
        flex: 0 0 100%;
        max-width: 100%;
        display: flex;
        align-items: stretch;
        height: 220px;
    }
    
    .hero-image-card .card,
    .hero-image-card .card img {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }
    
    .hero-image-card .card-img-top {
        width: 100%;
        height: auto;
        object-fit: cover;
        max-height: 120px;
    }
    
    .hero-card {
        margin-bottom: 1rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .hero-buttons .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .stats-row {
        justify-content: center;
    }
    
    .hero-stats-item {
        flex: 0 0 auto;
        width: auto;
        padding: 0 1rem;
    }
}

@media (max-width: 767.98px) {
    /* Mobile-specific adjustments */
    .hero-text-card .card {
        display: flex;
        flex-direction: column;
        height: auto !important;
    }
    
    .hero-card {
        margin-bottom: 0.75rem;
        height: auto !important;
        min-height: auto !important;
        display: block;
        overflow: visible;
    }
    
    .hero-text-card,
    .hero-image-card {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 0.5rem !important;
    }
    
    .hero-card .card-body {
        padding: 0.75rem 1rem !important;
        display: block;
        height: auto !important;
        min-height: auto !important;
        overflow: visible;
        flex: 0 0 auto !important;
    }
    
    .hero-card .display-5 {
        font-size: 0.95rem !important;
        margin: 0 0 0.2rem 0 !important;
        line-height: 1.2 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .hero-card .text-uppercase {
        font-size: 0.6rem !important;
        margin-bottom: 0.05rem !important;
        letter-spacing: 0.5px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .hero-card .btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.7rem !important;
        margin: 0.25rem 0 0 0 !important;
        border-radius: 4px !important;
        width: auto;
        display: inline-block;
    }
    
    .hero-stats-item {
        padding: 0.15rem 0.2rem !important;
        min-width: 50px !important;
        margin: 0.1rem !important;
    }
    
    .hero-stats-item .stat-value {
        font-size: 0.75rem !important;
        line-height: 1;
    }
    
    .hero-stats-item .stat-label {
        font-size: 0.5rem !important;
        line-height: 1;
        margin-bottom: 0;
    }
    
    .hero-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        margin: 0.5rem 0 0 0 !important;
        padding: 0;
    }
    
    .hero-buttons .btn {
        flex: 1 !important;
        min-width: 60px !important;
        padding: 0.15rem 0.25rem !important;
        font-size: 0.55rem !important;
        margin: 0 !important;
        white-space: nowrap;
        text-align: center;
    }
    
    .stats-row {
        margin: 0.5rem 0 0 0 !important;
        padding: 0.5rem 0 0 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

    /* Mobile Responsive Adjustments */
@media (max-width: 767.98px) {
    .hero-image-card {
        height: 200px; /* Slightly reduced height for side-by-side layout */
        order: 2; /* Image card on the right */
        padding-left: 0.5rem;
    }
    
    .hero-image-card .card,
    .hero-image-card .card img {
        height: 100%;
        width: 100%;
        object-fit: cover;
        border-radius: 0.5rem;
    }
    
    .hero-text-card {
        order: 1; /* Text card on the left */
        padding-right: 0.5rem;
        height: 200px; /* Match image card height */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    /* Side by side layout */
    .row.g-4 {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
    }
    
    /* Equal width columns */
    .hero-text-card,
    .hero-image-card {
        flex: 1;
        min-width: 0; /* Prevent flex items from overflowing */
    }
}

/* Ensure text doesn't overflow */
    .hero-card .card-title {
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        margin: 0 0 0.2rem 0;
        padding: 0;
        line-height: 1.2;
        max-height: 2.4em; /* 2 lines of text */
    }
    
    .hero-card .card-text {
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        margin: 0 0 0.3rem 0;
        padding: 0;
        line-height: 1.2;
        max-height: 2.4em; /* 2 lines of text */
        height: 2.4em; /* Fixed height to match max-height */
    }
    
    /* Adjust image height for very small screens */
    .hero-image-card .card-img-top {
        max-height: 100px;
    }

/* Small mobile adjustments */
@media (max-width: 400px) {
    .hero-text-card,
    .hero-image-card {
        padding: 0.25rem !important;
    }
    
    .hero-card .btn {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.4rem !important;
    }
    
    .hero-stats-item {
        min-width: 50px !important;
        padding: 0.15rem 0.2rem !important;
    }
    
    .hero-stats-item .stat-value {
        font-size: 0.8rem !important;
    }
    
    .hero-stats-item .stat-label {
        font-size: 0.5rem !important;
    }
}
