/**
 * Footer Ads Styles for Affiliate Link Manager
 */

/* Footer Ad Container */
.alm-footer-ad-container {
    position: fixed;
    bottom: 0;
    z-index: 999999;
    background: #fff;
    
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    transition: all 0.3s ease;
}

/* Position Variants */
.alm-footer-ad-container.alm-position-bottom-left {
    left: 20px;
    right: auto;
    max-width: 320px;
}

.alm-footer-ad-container.alm-position-bottom-center {
    left: 50%;
    transform: translateX(-50%);
    max-width: 728px;
}

.alm-footer-ad-container.alm-position-bottom-right {
    right: 20px;
    left: auto;
    max-width: 320px;
}

/* Footer Ad Content */
.alm-footer-ad-content {
    position: relative;
    padding: 10px;
    background: #fff;
}

/* Close Button */
.alm-footer-ad-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #666;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.alm-footer-ad-close:hover {
    background: #333;
}

.alm-footer-ad-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Ad Wrapper */
.alm-footer-ad-wrapper {
    display: block;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.alm-footer-ad-wrapper.alm-loading {
    opacity: 0.7;
}

/* Ad Link */
.alm-footer-ad-link {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.alm-footer-ad-link:hover {
    transform: scale(1.02);
}

.alm-footer-ad-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Ad Image */
.alm-footer-ad-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    transition: opacity 0.3s ease;
	    margin: 0 auto;
}

.alm-footer-ad-image.alm-fade-out {
    opacity: 0;
}

.alm-footer-ad-image.alm-fade-in {
    opacity: 1;
}

/* Loading Spinner */
.alm-footer-ad-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.alm-footer-ad-loading.alm-show {
    display: block;
}

.alm-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: alm-spin 1s linear infinite;
}

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

/* Fade Animations */
.alm-footer-ad-container.alm-fade-in {
    animation: almFadeInUp 0.5s ease forwards;
}

.alm-footer-ad-container.alm-fade-out {
    animation: almFadeOutDown 0.3s ease forwards;
}

@keyframes almFadeInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes almFadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* Center position fade animation adjustment */
.alm-footer-ad-container.alm-position-bottom-center.alm-fade-in {
    animation: almFadeInUpCenter 0.5s ease forwards;
}

.alm-footer-ad-container.alm-position-bottom-center.alm-fade-out {
    animation: almFadeOutDownCenter 0.3s ease forwards;
}

@keyframes almFadeInUpCenter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes almFadeOutDownCenter {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(100%);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .alm-footer-ad-container {
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
        transform: none !important;
    }
    
    .alm-footer-ad-container.alm-position-bottom-center {
        left: 10px !important;
        transform: none !important;
    }
    
    .alm-footer-ad-content {
        padding: 8px;
    }
    
    .alm-footer-ad-close {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
    
    /* Mobile fade animations */
    .alm-footer-ad-container.alm-fade-in {
        animation: almFadeInUpMobile 0.5s ease forwards;
    }
    
    .alm-footer-ad-container.alm-fade-out {
        animation: almFadeOutDownMobile 0.3s ease forwards;
    }
    
    @keyframes almFadeInUpMobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes almFadeOutDownMobile {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(100%);
        }
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .alm-footer-ad-container {
        left: 5px !important;
        right: 5px !important;
    }
    
    .alm-footer-ad-content {
        padding: 6px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .alm-footer-ad-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .alm-footer-ad-container,
    .alm-footer-ad-wrapper,
    .alm-footer-ad-link,
    .alm-footer-ad-image {
        transition: none !important;
        animation: none !important;
    }
    
    .alm-loading-spinner {
        animation: none !important;
    }
}

/* Print Styles */
@media print {
    .alm-footer-ad-container {
        display: none !important;
    }
}

