.ad-rotator-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    cursor: pointer;
    text-align: center;
    background-color: #fff; /* Optional: A background for the ad wrapper */
    padding: 10px; /* Optional: Padding around the ad */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Optional: Shadow for better visibility */
    border-radius: 8px; /* Optional: Rounded corners */
    transition: width 0.5s ease-in-out, opacity 0.5s ease-in-out; /* Smooth transition for width and opacity */
}

.ad-display-wrapper {
    position: relative;
    display: inline-block; /* To contain image and button */
    width: 100%; /* Take full width of container */
    overflow: hidden; /* Hide overflow if image is too big */
}

.rotating-ad-image {
    max-width: 100%;
    height: auto;
    display: block; /* Remove extra space below image */
}

.ad-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* Ensure link is clickable */
    display: block; /* Make the whole image clickable */
}

.ad-toggle-button {
    position: absolute;
    bottom: 5px; /* Adjust as needed */
    left: 5px; /* Adjust as needed */
    z-index: 99999;
    padding: 5px; /* Adjusted padding for better fit with dynamic size */
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    transition: background-color 0.3s ease;
}


/* Optional: Add a subtle animation for initial appearance */
.ad-rotator-container {
      display: none;
    opacity: 0;
    animation: fadeInAd 1s forwards;
    animation-delay: 0.5s; /* Delay before first appearance */
}

@keyframes fadeInAd {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Responsive adjustments */
@media (max-width: 700px) {
    /* Width will be set by JS based on mobile_width setting */
}