/* Mobius Affiliates Frontend Styles */

/* Affiliate Widget Containers */
affiliate-qdf,
affiliate-el {
    display: block;
    margin: 20px 0;
    min-height: 200px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* Hide loading text when widget has content */
affiliate-qdf:not(:empty)::before,
affiliate-el:not(:empty)::before {
    display: none !important;
}

/* Loading State - only show when empty */
affiliate-qdf:empty::before,
affiliate-el:empty::before {
    content: "Loading affiliate widget...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6b7280;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 0;
    animation: fadeInLoading 2s ease-in-out forwards;
}

@keyframes fadeInLoading {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Hide loading text after 5 seconds regardless */
affiliate-qdf::before,
affiliate-el::before {
    animation: fadeInLoading 2s ease-in-out forwards, fadeOutLoading 1s ease-in-out 5s forwards;
}

@keyframes fadeOutLoading {
    0% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* Widget Styling */
affiliate-qdf iframe,
affiliate-el iframe {
    width: 100%;
    border: none;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    affiliate-qdf,
    affiliate-el {
        margin: 16px 0;
        min-height: 150px;
    }
}

/* Widget Wrapper for Better Integration */
.mobius-widget-wrapper {
    margin: 24px 0;
    padding: 0;
}

.mobius-widget-wrapper affiliate-qdf,
.mobius-widget-wrapper affiliate-el {
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.mobius-widget-wrapper affiliate-qdf:hover,
.mobius-widget-wrapper affiliate-el:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
