/* Sticky Side Banner Ads CSS */
/* Left and Right side banner ads with animations */

.sticky-side-banner {
    position: fixed;
    width: 90px;
    height: 750px;
    z-index: 1000;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    visibility: hidden;
}

/* Left side banner positioning */
.sticky-side-banner.left {
    left: -100px; /* Initially hidden off-screen */
}

.sticky-side-banner.right {
    right: -100px; /* Initially hidden off-screen */
}

/* Show animation */
.sticky-side-banner.show {
    opacity: 1;
    visibility: visible;
}

.sticky-side-banner.show.left {
    left: 10px;
}

.sticky-side-banner.show.right {
    right: 10px;
}

/* Hide animation */
.sticky-side-banner.hide {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) scale(0.8);
}

.sticky-side-banner.hide.left {
    left: -100px;
}

.sticky-side-banner.hide.right {
    right: -100px;
}

/* Banner content styling */
.banner-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    box-sizing: border-box;
}

/* Close button styling */
.banner-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.banner-close:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Ad image styling */
.banner-ad-image {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Ad text styling */
.banner-ad-text {
    font-size: 11px;
    text-align: center;
    color: #333;
    margin-top: 5px;
    line-height: 1.2;
}

/* Loading placeholder */
.banner-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 12px;
}

.banner-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse animation for attention */
@keyframes pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.02); }
    100% { transform: translateY(-50%) scale(1); }
}

.sticky-side-banner.pulse {
    animation: pulse 2s ease-in-out 3;
}

/* Slide in animation */
@keyframes slideInLeft {
    from {
        left: -100px;
        opacity: 0;
    }
    to {
        left: 10px;
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        right: -100px;
        opacity: 0;
    }
    to {
        right: 10px;
        opacity: 1;
    }
}

/* Slide out animation */
@keyframes slideOutLeft {
    from {
        left: 10px;
        opacity: 1;
    }
    to {
        left: -100px;
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        right: 10px;
        opacity: 1;
    }
    to {
        right: -100px;
        opacity: 0;
    }
}

/* Animation classes */
.sticky-side-banner.animate-in.left {
    animation: slideInLeft 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.sticky-side-banner.animate-in.right {
    animation: slideInRight 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.sticky-side-banner.animate-out.left {
    animation: slideOutLeft 0.6s ease-in forwards;
}

.sticky-side-banner.animate-out.right {
    animation: slideOutRight 0.6s ease-in forwards;
}

/* Mobile responsive design */
@media (max-width: 768px) {
    .sticky-side-banner.mobile-enabled {
        width: 60px !important;
        height: 400px !important;
        top: 20% !important;
    }
    
    .sticky-side-banner.mobile-enabled.left {
        left: 5px !important;
    }
    
    .sticky-side-banner.mobile-enabled.right {
        right: 5px !important;
    }
    
    .sticky-side-banner.mobile-enabled .banner-content {
        padding: 5px !important;
    }
    
    .sticky-side-banner.mobile-enabled .banner-close {
        width: 16px !important;
        height: 16px !important;
        font-size: 10px !important;
        top: 2px !important;
        right: 2px !important;
    }
}

/* Tablet responsive design */
@media (max-width: 1024px) and (min-width: 769px) {
    .sticky-side-banner.mobile-enabled {
        width: 75px !important;
        height: 500px !important;
    }
    
    .sticky-side-banner.mobile-enabled.left {
        left: 8px !important;
    }
    
    .sticky-side-banner.mobile-enabled.right {
        right: 8px !important;
    }
}

/* Desktop only mode - hide on smaller screens */
@media (max-width: 1199px) {
    .sticky-side-banner:not(.mobile-enabled) {
        display: none !important;
    }
}

/* Hover effects */
.sticky-side-banner:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Click tracking indicator */
.banner-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    cursor: pointer;
    z-index: 1000;
}

/* Admin preview mode */
.admin-preview .sticky-side-banner {
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.admin-preview .banner-content::before {
    content: 'PREVIEW MODE';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    background: rgba(0, 123, 255, 0.8);
    color: white;
    padding: 2px 8px;
    font-size: 8px;
    border-radius: 2px;
    z-index: 1002;
}

/* AdSense specific styling */
.sticky-side-banner .adsbygoogle {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.sticky-side-banner.left .adsbygoogle {
    max-width: 90px !important;
}

.sticky-side-banner.right .adsbygoogle {
    max-width: 90px !important;
}

/* Ensure AdSense ads fit within banner container */
.banner-content ins.adsbygoogle {
    overflow: hidden;
    border-radius: 8px;
}

/* AdSense responsive adjustments */
@media (max-width: 1199px) {
    .sticky-side-banner .adsbygoogle {
        display: none !important;
    }
}
