/**
 * Elf Promotional Image Component Styles
 * Provides styling for the floating, draggable promotional image
 * Supports both desktop and mobile devices with responsive design
 */

/* ============================================
   Container Styles
   ============================================ */

#elf-promo-container {
    /* Position set dynamically via JS (fixed or absolute) */
    display: none;
    cursor: move;
    cursor: grab;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: scale(0.9);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* Note: position, left, top, z-index set dynamically */
}

/* Visible state */
#elf-promo-container.elf-promo-visible {
    opacity: 1;
    transform: scale(1);
}

/* Dragging state */
#elf-promo-container.elf-dragging {
    cursor: grabbing;
    opacity: 0.9;
    transition: opacity 0.1s ease;
}

/* Closing state */
#elf-promo-container.elf-promo-closing {
    opacity: 0;
    transform: scale(0.8) rotate(10deg);
    pointer-events: none;
}

/* ============================================
   Image Styles
   ============================================ */

.elf-promo-image {
    width: auto;
    height: auto;
    max-height: 200px;
    display: block;
    border-radius: 8px;
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
                0 2px 4px rgba(0, 0, 0, 0.1); */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
}

/* Hover effect on desktop */
@@media (min-width: 769px) {
    #elf-promo-container:hover .elf-promo-image {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2),
            0 3px 6px rgba(0, 0, 0, 0.15);
    }
}

/* Link wrapper */
.elf-promo-link {
    display: block;
    text-decoration: none;
    outline: none;
}

.elf-promo-link:focus .elf-promo-image {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ============================================
   Close Button Styles
   ============================================ */

.elf-promo-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(220, 53, 69, 0.95);
    color: white;
    border: 2px solid white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1;
    display: none;
}

.elf-promo-close:hover {
    background-color: #c82333;
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.elf-promo-close:active {
    transform: scale(0.95);
}

.elf-promo-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* ============================================
   Mobile Optimizations
   ============================================ */

@@media (max-width: 768px) {
    #elf-promo-container {
        /* Slightly larger touch target */
        touch-action: none;
    }

    .elf-promo-close {
        /* Larger close button for mobile */
        width: 32px;
        height: 32px;
        font-size: 22px;
        top: -10px;
        right: -10px;
    }

    .elf-promo-image {
        /* More subtle shadow on mobile */
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12),
            0 1px 3px rgba(0, 0, 0, 0.08);
    }
}

/* ============================================
   Accessibility
   ============================================ */

/* Reduce motion for users who prefer it */
@@media (prefers-reduced-motion: reduce) {

    #elf-promo-container,
    .elf-promo-image,
    .elf-promo-close {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast mode support */
@@media (prefers-contrast: high) {
    .elf-promo-close {
        border-width: 3px;
    }

    .elf-promo-image {
        border: 2px solid currentColor;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@@media print {
    #elf-promo-container {
        display: none !important;
    }
}

/* ============================================
   Loading State (Optional)
   ============================================ */

#elf-promo-container.elf-loading {
    opacity: 0.5;
    pointer-events: none;
}

#elf-promo-container.elf-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: elf-spin 0.8s linear infinite;
}

@@keyframes elf-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ============================================
   Animation Effects
   ============================================ */

/* Subtle pulse animation (optional - can be enabled via class) */
@@keyframes elf-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.elf-promo-pulse {
    animation: elf-pulse 2s ease-in-out infinite;
}

/* Bounce in animation (optional) */
@@keyframes elf-bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-100px);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.elf-promo-bounce-in {
    animation: elf-bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}