/* apartments/static/apartments/css/home/apartment_carousel.css */

/* Apartment Carousel Container */
.apartment-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 20px 0; /* Vertical padding */
}

/* Scrollable Apartments Container */
.apartment-scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden; /* Prevent vertical scrolling */
    scroll-behavior: smooth;
    padding: 0 60px;
    gap: 30px;
    touch-action: pan-x; /* Allow only horizontal panning */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.apartment-scroll-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar in WebKit browsers */
}

.apartment-scroll-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}


/* Scroll Buttons */
.btn-scroll {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.btn-scroll:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.btn-scroll-left {
    left: 10px;
}

.btn-scroll-right {
    right: 10px;
}

/* Apartment Item Link */
.apartment-item-link {
    text-decoration: none;
    color: inherit;
    flex: 0 0 auto; /* Prevents the link from stretching */
}

/* Apartment Item */
.apartment-item {
    position: relative;
    width: 350px;   /* Increased width */
    height: 525px;  /* Increased height */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1); /* Slightly larger shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apartment-item:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

/* Apartment Image */
.apartment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Apartment Name Overlay */
.apartment-name-overlay {
    position: absolute;
    bottom: 15px; /* Slightly above the bottom for aesthetics */
    left: 15px;   /* Slight padding from the left edge */
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    line-height: 1.2;
    /* Always visible */
    opacity: 1;
}

.apartment-name-overlay span {
    display: block;
    /* Ensure text wraps nicely */
    word-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .apartment-scroll-container {
        padding: 0 40px; /* Adjust padding for large screens */
        gap: 25px;       /* Adjust gap */
    }

    .apartment-item {
        width: 320px;
        height: 480px;
    }
}

@media (max-width: 992px) {
    .apartment-scroll-container {
        padding: 0 30px; /* Adjust padding for medium screens */
        gap: 20px;       /* Adjust gap */
    }

    .apartment-item {
        width: 300px;
        height: 450px;
    }
}

@media (max-width: 768px) {
    .apartment-scroll-container {
        padding: 0 20px;
        gap: 15px;
    }

    .apartment-item {
        width: 260px;
        height: 390px;
    }

    /* Hide scroll buttons on mobile */
    .btn-scroll {
        display: none;
    }
}

@media (max-width: 576px) {
    .apartment-item {
        width: 220px;
        height: 330px;
    }

    .apartment-name-overlay {
        font-size: 0.9rem;
        padding: 6px 10px;
        bottom: 10px;
        left: 10px;
    }
}
