/* Container for the corner ad */
.corner-ad {
    position: fixed;
    z-index: 99999;
    max-width: 300px;
    
    /* --- NEW: Effect on load --- */
    opacity: 0; /* Initially invisible */
    transform: scale(0.95); /* Initially slightly smaller */
    animation: fadeInScale 0.5s ease-out 1s forwards; /* 1-second delay before appearing */
    transition: transform 0.3s ease; /* Smooth transition for hover */
}

/* --- NEW: Hover effect --- */
.corner-ad:hover {
    transform: scale(1.05); /* Slightly enlarge on hover */
}

/* Image styling */
.corner-ad img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- NEW: Applying pulse animation to the link wrapper --- */
.corner-ad a {
    display: block;
    /* Starts after 2s, repeats indefinitely */
    animation: pulse 2.5s infinite 2s;
}

/* --- NEW: Keyframes for animations --- */

/* Fade-in and scale-up animation on load */
@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse effect to draw attention */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03); /* Pulse size */
    }
    100% {
        transform: scale(1);
    }
}


/* Positioning classes */
.corner-ad.bottom-right {
    bottom: 80px;
    right: 20px;
}
.corner-ad.bottom-left {
    bottom: 20px;
    left: 20px;
}
.corner-ad.top-right {
    top: 20px;
    right: 20px;
}
.corner-ad.top-left {
    top: 20px;
    left: 20px;
}

/* Close button styling */
.corner-ad-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #fff;
    color: #333;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    text-align: center;
    line-height: 26px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    font-family: Arial, sans-serif;
    font-weight: bold;
    z-index: 10; /* Ensure it's on top of the ad */
}

.corner-ad-close:hover {
    background-color: #f1f1f1;
}

/* Hidden state */
.corner-ad-hidden {
    display: none !important;
}

/* Responsive for mobile */
@media (max-width: 600px) {
    .corner-ad {
        max-width: 150px;
        bottom: 10px;
        right: 10px;
    }
    
    .corner-ad.bottom-left,
    .corner-ad.top-left,
    .corner-ad.top-right {
        right: 10px;
        left: auto;
    }
}
