/* Sneaky EPUB Download Button Styles */

/* Magazine dropdown container */
.magazine-dropdown {
    position: relative;
}

/* The sneaky download button */
.sneaky-epub-btn {
    position: absolute;
    background: linear-gradient(45deg, #FFE66D, #FF6B35);
    border: 2px dashed #4ECDC4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 9999;
}

/* Initial state - just shows download icon */
.sneaky-epub-btn .download-text {
    display: block;
    font-size: 18px;
    transition: all 0.3s ease;
}

.sneaky-epub-btn .hover-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    transition: all 0.3s ease;
    opacity: 0;
}

/* On hover - reveals EPUB text */
.sneaky-epub-btn:hover {
    transform: scale(1.2) rotate(360deg) !important;
    background: linear-gradient(45deg, #4ECDC4, #FFE66D);
    border-color: #FF6B35;
    width: 60px;
    height: 60px;
    opacity: 1 !important;
}

.sneaky-epub-btn:hover .download-text {
    transform: scale(0);
    opacity: 0;
}

.sneaky-epub-btn:hover .hover-text {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Subtle pulsing animation to catch attention */
.sneaky-epub-btn.subtle-pulse {
    animation: subtlePulse 2s infinite;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 230, 109, 0.6);
    }
}

/* Different visual states based on position */
.sneaky-epub-btn[style*="rotate(90deg)"] {
    border-style: dotted;
    background: linear-gradient(90deg, #FF6B35, #4ECDC4);
}

.sneaky-epub-btn[style*="rotate(-"] {
    border-radius: 30%;
    animation: wobble 4s ease-in-out infinite;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-5deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(-2deg); }
}

/* Make it look like a mistake or glitch */
.sneaky-epub-btn::before {
    content: '?';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #DC143C;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sneaky-epub-btn:hover::before {
    opacity: 1;
    animation: questionBounce 0.5s ease;
}

@keyframes questionBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Celebration animation for successful download */
@keyframes celebratePop {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(360deg);
        opacity: 0;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sneaky-epub-btn {
        /* More visible on mobile but still sneaky */
        opacity: 0.7 !important;
    }

    .sneaky-epub-btn[style*="right: -20px"] {
        right: 0 !important;
    }
}

/* Easter egg: Button occasionally "glitches" */
.sneaky-epub-btn {
    animation: occasionalGlitch 10s infinite;
}

@keyframes occasionalGlitch {
    0%, 94%, 100% {
        filter: none;
    }
    95% {
        filter: hue-rotate(180deg) saturate(3);
    }
    96% {
        filter: hue-rotate(90deg) contrast(2);
    }
    97% {
        filter: invert(1);
    }
    98% {
        filter: hue-rotate(270deg) brightness(1.5);
    }
    99% {
        filter: none;
    }
}

/* Tooltip that appears after hovering for 2 seconds */
.sneaky-epub-btn:hover::after {
    content: 'Yes, you can download the EPUB here!';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    animation: tooltipReveal 0.5s ease 2s forwards;
}

@keyframes tooltipReveal {
    to {
        opacity: 1;
        bottom: calc(100% + 10px);
    }
}

/* Make button look accidentally placed */
.sneaky-epub-btn {
    transform-origin: center;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Different styles for different "accidental" placements */
.sneaky-epub-btn[style*="top: 10px"] {
    /* Looks like a notification badge gone wrong */
    border-radius: 8px 50% 50% 8px;
}

.sneaky-epub-btn[style*="bottom:"] {
    /* Looks like a floating action button */
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* Fun hover message variations */
.sneaky-epub-btn[title]:hover {
    /* Changes cursor to indicate it's clickable despite looking weird */
    cursor: grab;
}

.sneaky-epub-btn:active {
    cursor: grabbing;
    transform: scale(0.95) !important;
}