/* Hiệu ứng cuộn mượt mà */
html {
    scroll-behavior: smooth;
}

a {
    scroll-behavior: smooth; /* Thêm cho các liên kết di chuyển đến các mục trong trang */
}

/* Hiệu ứng hover cho các mục trong thanh điều hướng */
.nav-link {
    transition: all 0.3s ease;
}

    .nav-link:hover {
        color: #fbbf24; /* Màu vàng khi hover */
        transform: scale(1.1); /* Phóng to một chút */
        background-color: rgba(255, 255, 255, 0.2); /* Thêm nền mờ khi hover */
        border-radius: 5px; /* Bo góc cho hiệu ứng hover */
    }

/* Hiệu ứng hover cho ảnh trong Image Grid */
.image-hover:hover {
    transform: scale(1.05);
    transition: all 0.3s ease-in-out;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2); /* Thêm hiệu ứng đổ bóng */
}

/* Thêm hiệu ứng cho video */
iframe {
    transition: transform 0.3s ease-in-out;
}

    iframe:hover {
        transform: scale(1.05);
    }

/* Animation for sliding images */
.slide-in {
    animation: slide-in 1s forwards;
}

.slide-out {
    animation: slide-out 1s forwards;
}

@keyframes slide-in {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

body {
    background-color: white;
    margin: 0;
    padding: 0;
}
/* Wrapper with larger side padding to prevent overflow */
.phones-container-wrapper {
    padding: 0.5rem;
}
/* Each phone fixed width and height, scaled for responsiveness */
.phone {
    position: relative;
    width: 250px;
    height: 410px; /* 250 * 1.638 */
    background-color: #2d3748; /* Tailwind gray-800 */
    border-radius: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    border: 4px solid #4a5568; /* Tailwind gray-600 */
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}
/* Front face */
.phone-front {
    position: absolute;
    inset: 0;
    background: black;
    border-radius: 1.5rem;
    border: 4px solid #4a5568;
    overflow: hidden;
    z-index: 10;
}

    .phone-front img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 1.5rem;
        position: absolute;
        inset: 0;
    }
/* Adjusted Notch */
.notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 20px;
    background: black;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.1), 0 2px 6px rgba(0,0,0,0.6);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 0.6rem;
}

.notch-camera {
    width: 18px;
    height: 18px;
    background: #222;
    border-radius: 50%;
    position: relative;
}

    .notch-camera::before {
        content: "";
        position: absolute;
        top: 25%;
        left: 25%;
        width: 50%;
        height: 50%;
        background: #333;
        border-radius: 50%;
    }

.notch-speaker {
    width: 40px;
    height: 10px;
    background: #222;
    border-radius: 3px;
    position: relative;
}

    .notch-speaker::before {
        content: "";
        position: absolute;
        top: 20%;
        left: 15%;
        width: 70%;
        height: 60%;
        background: #333;
        border-radius: 2px;
    }
/* Screen container */
.screen {
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    overflow: hidden;
    background-color: #2d3748;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Slideshow images */
.slideshow {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
}

    .slideshow img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0;
        transition: opacity 1s ease-in-out;
        border-radius: 1.5rem;
    }

        .slideshow img.active {
            opacity: 1;
            position: relative;
            z-index: 10;
        }
/* Button "Thuê Ngay" */
.button-wrapper {
    pointer-events: none;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
}

    .button-wrapper a {
        pointer-events: auto;
        background-color: #22c55e; /* Tailwind green-500 */
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px rgba(34,197,94,0.5);
        font-weight: 600;
        font-size: 1rem;
        transition: background-color 0.3s ease;
        user-select: none;
        text-decoration: none;
    }

        .button-wrapper a:hover {
            background-color: #16a34a; /* Tailwind green-600 */
        }
/* Bottom text */
.bottom-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0,0,0,0.5);
    color: white;
    text-align: center;
    padding: 0.4rem 0;
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
    user-select: none;
    font-weight: 600;
    font-size: 1rem;
    z-index: 20;
}
/* Responsive adjustments */
@media (max-width: 1024px) {
    .phone {
        width: 220px;
        height: 360px;
        min-width: 180px;
        min-height: 295px;
    }

    .notch {
        width: 35%;
        height: 9%;
    }

    .notch-camera {
        max-width: 12px;
        max-height: 15px;
    }

    .notch-speaker {
        max-width: 28px;
        max-height: 8px;
    }

    .phones-container-wrapper {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

@media (max-width: 640px) {
    .phones-container-wrapper {
        max-width: 100vw;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .phones-container {
        justify-content: flex-start;
        gap: 1rem;
        padding: 2rem 0;
    }

    .phone {
        width: 45vw;
        height: calc(45vw * 1.638);
        min-width: 140px;
        min-height: 229px;
    }

    .notch {
        width: 40%;
        height: 9%;
    }

    .notch-camera {
        max-width: 15px;
        max-height: 15px;
    }

    .notch-speaker {
        max-width: 35px;
        max-height: 8px;
    }
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

#backToTop.show {
    display: block;
    opacity: 1;
}
