/* Basic reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* UPDATED: Container height is now 600px */
#ad-container {
    width: 300px;
    height: 600px; /* Changed from 250px */
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #0077be; /* Fallback color */
}

/* UPDATED: Animation is now a pan and zoom */
#ad-background-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('https://i.ibb.co/TMT9fQDy/background-image.jpg');
    background-size: 100%;
    background-position: center top;
    
    /* Apply the updated, more dynamic animation for the vertical space */
    animation: kenBurnsEffectVertical 3s ease-out forwards;
}

/* UPDATED: Gradient adjusted for a taller ad */
#overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Center the logo at the top and support an image */
#logo {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap; /* keep single line if text used */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}

/* Ensure the logo image scales nicely within the 300px container */
#logo img {
    display: inline-block;
    max-width: 90%;
    height: auto;
}

/* UPDATED: Headline is now larger and vertically centered */
#headline {
    position: absolute;
    top: 280px; /* Positioned towards the middle */
    left: 15px;
    right: 15px;
    color: white;
    font-size: 42px; /* Increased font size */
    font-weight: bold;
    line-height: 1.2;
    text-align: center; /* Centered for better balance */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s forwards;
}

/* UPDATED: CTA button is now horizontally centered */
#cta-button {
    position: absolute;
    bottom: 30px; /* More space from the bottom edge */
    left: 50%; /* Start at the halfway point */
    width: 80%;
    padding: 12px 25px;
    background-color: #e60022;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    
    /* Combine transforms: center it horizontally AND prepare for scaling animation */
    transform: translateX(-50%) scale(0);
    opacity: 0;

    /* The animation now accounts for the new transform */
    animation: popInCentered 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) 2s forwards;
    transition: background-color 0.3s ease;
}

#cta-button:hover {
    background-color: #cc001d;
}

/* --- Animation Keyframes --- */

/* UPDATED: A new keyframe for a slow vertical pan + zoom out */
@keyframes kenBurnsEffectVertical {
    from {
        background-size: 200%;
        background-position: center top;
    }
    to {
        background-size: 130%;
        background-position: center bottom;
    }
}

/* Unchanged keyframes */
@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* UPDATED: Keyframe for the centered button animation */
@keyframes popInCentered {
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}
