/* Animations & Micro-interactions — Premium Quality */

/* ===== Card Hover Effects — more solid feel (UI/UX Pro Max) ===== */
.plan-card,
.top-plan,
.tm-glass-card {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s ease;
}

.plan-card:hover,
.top-plan:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
}

.plan-card:active,
.top-plan:active {
    transform: translateY(0);
    transition-duration: 0.1s;
}

/* ===== Heart Animation ===== */
.like-btn {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.like-btn i {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.like-btn:hover i {
    transform: scale(1.15);
}

.like-btn.liked i {
    animation: heartBeat 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ef4444;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.35); }
    60% { transform: scale(0.9); }
    80% { transform: scale(1.1); }
}

.plan-card:hover,
.top-plan:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* ===== Heart Animation ===== */
.like-btn {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.like-btn i {
    transition: transform 0.2s ease, color 0.2s ease;
}

.like-btn:hover i {
    transform: scale(1.2);
}

.like-btn.liked i {
    animation: heartBeat 0.6s ease;
    color: #ef4444;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.9);
    }
    75% {
        transform: scale(1.15);
    }
}

/* ===== Smooth Scroll ===== */
html {
    scroll-behavior: smooth;
}

/* ===== Button Press Feedback — subtle scale (UI/UX Pro Max) ===== */
.btn-primary,
.generate-btn,
.btn {
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.15s ease,
                background 0.15s ease;
}

.btn-primary:active,
.generate-btn:active,
.btn:active {
    transform: scale(0.97);
}

/* ===== Icon Animations ===== */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-fire {
    animation: flicker 2.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

/* ===== Fade In Up ===== */
.fade-in-up,
.animate-slide-up {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Scale In ===== */
.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Pulse Glow ===== */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.3); }
    50% { box-shadow: 0 0 0 12px rgba(6, 182, 212, 0); }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ===== Bounce ===== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.bounce {
    animation: bounce 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Tooltip ===== */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1e293b;
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ===== Skeleton Loading ===== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== Reduced Motion — Respect user's preference ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Loading Dots ===== */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ===== Confetti (for success) ===== */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #06b6d4;
    top: -8px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== Slide In Left ===== */
.slide-in-left {
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Ripple Effect — kept for visual richness ===== */
.generate-btn::after,
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.generate-btn:active::after,
.btn:active::after {
    width: 250px;
    height: 250px;
}

/* ===== Entrance stagger for list items ===== */
.stagger-item {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 60ms; }
.stagger-item:nth-child(3) { animation-delay: 120ms; }
.stagger-item:nth-child(4) { animation-delay: 180ms; }
.stagger-item:nth-child(5) { animation-delay: 240ms; }
.stagger-item:nth-child(6) { animation-delay: 300ms; }
