/* Container chính */
#dg-container {
    position: relative;
    width: 100%;
    height: 310px;
    perspective: 1200px;
}

/* Danh sách slide */
#dg-container ul {
    position: relative;
    width: 100%;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
    transform-style: preserve-3d;
    transition: transform 1s;
}

/* Từng slide */
#dg-container li {
    position: absolute;
    top: 0;
    left: 40%;
    width: 542px;
    height: 300px;
    margin-left: -140px;
    opacity: 0.6;
    transform-origin: 50% 50%;
    transition: all 0.6s ease-in-out;
    cursor: pointer;
}

#dg-container li img {
    width: 100%;
    height: 300px;
    border-radius: 16px 0 0 16px;
    object-fit: cover;
}

#dg-container li .content {
    background: linear-gradient(135deg, #007BFF, #0056d6);
    color: white;
    border-radius: 0 16px 16px 0;
    padding: 16px;
    text-align: left;
    margin-top: -8px;
}

#dg-container li h3 {
    font-size: 18px;
    margin-bottom: 10px;
    border-bottom: 2px solid white;
    padding-bottom: 5px;
}

#dg-container li p {
    font-size: 14px;
    line-height: 1.4;
}

#dg-container li button {
    border: 1px solid white;
    background: transparent;
    color: white;
    border-radius: 8px;
    padding: 6px 12px;
    margin-top: 8px;
    cursor: pointer;
    transition: 0.3s;
}

#dg-container li button:hover {
    background: white;
    color: #007BFF;
}

/* Nút điều hướng */
.dg-prev, .dg-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #007BFF;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 100;
}

.dg-prev { left: -60px; }
.dg-next { right: -60px; }

.dg-prev:hover, .dg-next:hover {
    background: #0056d6;
}

/* Vị trí 3D */
#dg-container li.dg-center {
    transform: translateX(0) translateZ(120px);
    opacity: 1;
    z-index: 3;
}

#dg-container li.dg-left {
    transform: translateX(-200px) rotateY(45deg);
    z-index: 2;
}

#dg-container li.dg-right {
    transform: translateX(200px) rotateY(-45deg);
    z-index: 2;
}

#dg-container li.dg-hidden {
    opacity: 0;
    z-index: 1;
}

.dg-dots {
    display: none;
    justify-content: center;
    margin-top: 15px;
    gap: 8px;
}

.dg-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s;
}

.dg-dots .dot.active {
    background: #333;
    transform: scale(1.2);
}


@media (max-width: 768px) {
    .dg-dots {
        display: flex;
    }
    #dg-container {
        width: 100%;
        height: 310px;
    }

    #dg-container li {
        width: 100%;
        margin-left: 0;
        left: 0;
        flex-direction: column;
        height: auto;
        transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    }

    /* Ẩn slide khác bằng opacity thay vì display:none */
    #dg-container li.dg-left,
    #dg-container li.dg-right,
    #dg-container li.dg-hidden {
        opacity: 0;
        pointer-events: none;
        transform: translateX(0) translateZ(0) scale(0.9);
    }

    #dg-container li.dg-center {
        opacity: 1;
        transform: translateX(0) translateZ(0) scale(1);
        z-index: 3;
    }

    /* Nút điều hướng nhỏ hơn */
    .dg-prev,
    .dg-next {
        display: none;
    }

    /* Ảnh nằm trên, text nằm dưới */
    #dg-container li img {
        height: 300px;
        object-fit: cover;
    }

    #dg-container li .content {
        text-align: center;
        height: 300px;
        margin-top: 0;
        /*border-radius: 0 0 16px 16px;*/
    }
}

