﻿/* Hero Section (Carousel) Styling - FIXED VERSION */

/* Base carousel container setup */
#welcome {
    height: 100vh;
    overflow: hidden;
    position: relative; /* ADD: Ensure proper stacking context */
}

    /* Ensure carousel inner and items take full height */
    #welcome .carousel-inner,
    #welcome .carousel-item {
        height: 100%;
        /* REMOVE: background-color: #000; - This was causing the black screen! */
    }

        /* Image within carousel item */
        #welcome .carousel-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            /* ADD: Ensure images load smoothly without flickering */
            display: block;
            transition: opacity 0.3s ease-in-out;
        }

    /* CRITICAL FIX: Preload fallback to prevent black screens */
    #welcome .carousel-item {
        background-color: #f8f9fa; /* Light fallback instead of black */
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

        /* Enhanced overlay - more subtle */
        #welcome .carousel-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 255, 0.4); /* REDUCED: Lighter overlay */
            z-index: 1;
            /* ADD: Smooth transition for overlay */
            transition: background-color 0.3s ease-in-out;
        }

    /* Carousel Caption Styling */
    #welcome .carousel-caption {
        position: absolute;
        z-index: 2;
        background-color: transparent;
        padding: 1.5rem;
        border-radius: 0.5rem;
        bottom: 3rem;
        left: 50%;
        transform: translateX(-50%);
        text-align: center !important;
        max-width: 80%;
        width: 100%;
    }

        /* Text styles within caption */
        #welcome .carousel-caption h3,
        #welcome .carousel-caption p {
            color: #f8f9fa;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); /* ENHANCED: Better text shadow */
            margin-bottom: 0.5rem;
            text-align: center !important;
        }

        #welcome .carousel-caption h3 {
            font-size: 3rem;
            color: var(--bs-secondary-color) !important;
            /* ADD: Ensure text doesn't break awkwardly */
            line-height: 1.2;
        }

        #welcome .carousel-caption p {
            font-size: 1.25rem;
            line-height: 1.4; /* ADD: Better line spacing */
        }

        #welcome .carousel-caption .btn {
            font-weight: 600;
            border-radius: 0.5rem;
            margin-top: 1rem;
        }

    /* CRITICAL FIX: Smooth carousel transitions */
    #welcome .carousel-item {
        transition: transform 0.6s ease-in-out;
    }

        #welcome .carousel-item.active,
        #welcome .carousel-item-next,
        #welcome .carousel-item-prev {
            display: block;
        }

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    #welcome .carousel-caption {
        position: static;
        transform: none;
        bottom: auto;
        left: auto;
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 0;
        text-align: center;
        max-width: 100%;
    }

        #welcome .carousel-caption h3 {
            font-size: 1.8rem;
        }

        #welcome .carousel-caption p {
            font-size: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #welcome .carousel-caption .btn {
            font-size: 0.9rem;
            padding: 0.5rem 1rem;
        }
}

/* Enhanced Carousel Button Styling */
.carousal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    min-width: 200px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    background-color: transparent;
    border: 2px solid var(--bs-primary-color);
    color: var(--bs-primary-color);
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: color 0.4s ease-in-out, border-color 0.4s ease-in-out, transform 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

    .carousal-button i {
        margin-right: 0.7rem;
        font-size: 1.2rem;
        transition: transform 0.4s ease-in-out;
    }

    .carousal-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 0;
        height: 100%;
        background-color: var(--bs-secondary-color);
        transition: width 0.4s ease-in-out;
        z-index: -1;
        border-radius: 50px;
    }

    .carousal-button:hover {
        color: #fff;
        border-color: #007bff;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
    }

        .carousal-button:hover::before {
            width: 100%;
        }

        .carousal-button:hover i {
            transform: translateX(3px);
        }

    .carousal-button:active,
    .carousal-button:focus {
        outline: none;
        box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.5);
        transform: translateY(-1px);
    }
