/**
 * ICS Calendar Subscription - Complete Styles
 * Base styling + Nintendo-style animations with particle effects
 */

/* ============================================================================
   BASE BUTTON STYLING
   ============================================================================ */

.calendar-subscription-container {
    text-align: center;
    padding: 40px 20px;
    margin: 40px auto;
    max-width: 600px;
}

.btn-subscribe-calendar {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #007CFF, #0056b3);
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 124, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-subscribe-calendar:hover {
    color: #ffffff;
    text-decoration: none;
}

.btn-subscribe-calendar .calendar-icon {
    font-size: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.subscription-help-text {
    margin-top: 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================================================
   PARTICLE EFFECTS
   ============================================================================ */

.subscribe-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #007CFF, #00BFFF);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: particleFloat 0.6s ease-out forwards;
    box-shadow: 0 0 3px rgba(0, 124, 255, 0.5);
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(
            calc(var(--end-x) - var(--start-x, 0px)), 
            calc(var(--end-y) - var(--start-y, 0px))
        ) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(
            calc(var(--end-x) - var(--start-x, 0px)), 
            calc(var(--end-y) - var(--start-y, 0px))
        ) scale(0.5);
    }
}

/* ============================================================================
   FIRST VISIT ANIMATION (BIG EXCITED WIGGLE)
   ============================================================================ */

@keyframes firstVisitWiggle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    10% {
        transform: translateY(-12px) rotate(-4deg);
    }
    15% {
        transform: translateY(-18px) rotate(4deg);
    }
    20% {
        transform: translateY(-6px) rotate(-3deg);
    }
    25% {
        transform: translateY(-12px) rotate(3deg);
    }
    30% {
        transform: translateY(-4px) rotate(-2deg);
    }
    35% {
        transform: translateY(-8px) rotate(2deg);
    }
    40% {
        transform: translateY(0) rotate(0deg);
    }
}

.calendar-subscription-container.first-visit {
    animation: firstVisitWiggle 2s ease-in-out;
}

/* ============================================================================
   CONTINUOUS SUBTLE ANIMATION
   ============================================================================ */

.calendar-subscription-container {
    animation: subscribeAttention 4s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes subscribeAttention {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    10% {
        transform: translateY(-4px) rotate(-2deg);
    }
    15% {
        transform: translateY(-8px) rotate(2deg);
    }
    20% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-3px) rotate(-1deg);
    }
    30% {
        transform: translateY(0) rotate(0deg);
    }
    /* Rest 70% of the time - stays still */
}

/* ============================================================================
   CALENDAR ICON EXCITEMENT
   ============================================================================ */

.btn-subscribe-calendar .calendar-icon {
    display: inline-block;
    animation: iconExcited 4s ease-in-out infinite;
}

@keyframes iconExcited {
    0%, 100% {
        transform: scale(1);
    }
    12% {
        transform: scale(1.2) rotate(-5deg);
    }
    18% {
        transform: scale(1.15) rotate(5deg);
    }
    24% {
        transform: scale(1);
    }
}

/* ============================================================================
   HOVER INTERACTIONS
   ============================================================================ */

.btn-subscribe-calendar {
    position: relative;
    transition: all 0.3s ease;
}

.btn-subscribe-calendar:hover {
    animation: hoverBounce 0.6s ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 124, 255, 0.3);
    transform: translateY(-2px);
}

@keyframes hoverBounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(-4px);
    }
    75% {
        transform: translateY(-6px);
    }
}

/* ============================================================================
   ACCESSIBILITY & PERFORMANCE
   ============================================================================ */

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .calendar-subscription-container,
    .calendar-subscription-container.first-visit,
    .btn-subscribe-calendar .calendar-icon,
    .btn-subscribe-calendar:hover,
    .subscribe-particle {
        animation: none !important;
    }
    
    .btn-subscribe-calendar:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 124, 255, 0.2);
    }
}

/* GPU acceleration for smoother animations */
.calendar-subscription-container,
.btn-subscribe-calendar,
.btn-subscribe-calendar .calendar-icon,
.subscribe-particle {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}