body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: #f0f0f0;
}

.ad-container {
    width: 300px;
    height: 250px;
    perspective: 1500px; /* increase depth */
}

.ad {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    /*border-radius: 12px;*/
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.tagline {
    position: absolute;
    text-align: center;
    bottom: 0;
    left: 0;
    right: 0;
    color: white;
  background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
    z-index: 13;
    opacity: 0;
    transform: translateX(50px);
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    border-radius: 12px;
}

.front {
    background: white;
    z-index: 2;
}

.back {
    background: #000;
    color: white;
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad {
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

.face {
    backface-visibility: hidden;
}

.back {
    transform: rotateX(180deg); /* vertical flip */
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.cta-button {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 8px 16px;
    background-color: #04A454;
    color: #fff;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease-in-out;
    z-index: 20;
    background-image: linear-gradient(
            90deg,
            #04A454 0%,
            #33cc88 50%,
            #04A454 100%
    );
    background-size: 200% auto;
    animation: shimmer 3s infinite linear;
}

.face.back:hover .cta-button {
    opacity: 1;
    transform: translateY(0);
}

/* Video screen like cinematic */
.face.back {
    position: relative;
    overflow: hidden;
}

.face.back::before,
.face.back::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 20px; /* size of the black bar */
    background: rgba(0, 0, 0, 0.8); /* slightly transparent black */
    z-index: 3;
    pointer-events: none;
}

.face.back::before {
    top: 0;
}

.face.back::after {
    bottom: 0;
}

#adVideo {
    width: 100%;
    height: 100%;
    object-fit: contain; /* <– Fix: prevent cropping */
    z-index: 1;
    position: relative;
}




