/* ==========================================================================
   WalletWatcher - Component Styles
   Reusable UI components, animations, and visual effects.
   All definitions are deduplicated -- each rule appears exactly once.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Card Hover  (single merged definition)
   -------------------------------------------------------------------------- */
.card-hover {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.25);
}

.card-hover:hover::before {
    left: 100%;
}

.dark .card-hover:hover {
    box-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.35);
}

/* --------------------------------------------------------------------------
   2. Card 3D  (single merged definition)
   -------------------------------------------------------------------------- */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-3d:hover {
    transform: rotateY(-5deg) rotateX(5deg) translateZ(10px);
}

/* --------------------------------------------------------------------------
   3. Button Hover  (single merged definition)
   -------------------------------------------------------------------------- */
.btn-hover {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

.btn-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -6px rgba(99, 102, 241, 0.4);
}

.btn-hover:hover::before {
    left: 100%;
}

.btn-hover:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px -4px rgba(99, 102, 241, 0.3);
}

/* --------------------------------------------------------------------------
   4. Credit Card Design  (single merged definition)
   -------------------------------------------------------------------------- */
.credit-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1.586 / 1;          /* standard card ratio */
    border-radius: 16px;
    padding: 1.5rem;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    box-shadow: 0 20px 60px -12px rgba(99, 102, 241, 0.5);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.credit-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.credit-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.credit-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 28px 70px -16px rgba(99, 102, 241, 0.6);
}

/* Responsive credit card */
@media (max-width: 480px) {
    .credit-card {
        max-width: 100%;
        padding: 1rem;
        border-radius: 12px;
    }
}

/* --------------------------------------------------------------------------
   5. Card Background Pattern
   -------------------------------------------------------------------------- */
.card-bg {
    position: relative;
    overflow: hidden;
}

.card-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
}

.card-pattern {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
}

/* --------------------------------------------------------------------------
   6. Keyframe Animations  (each defined exactly once)
   -------------------------------------------------------------------------- */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6),
                    0 0 40px rgba(99, 102, 241, 0.3);
    }
}

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

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-25%);
    }
}

@keyframes particle-float {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) scale(0);
        opacity: 0;
    }
}

@keyframes blob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(30px, -50px) rotate(120deg);
    }
    66% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* --------------------------------------------------------------------------
   7. Animation Utility Classes
   -------------------------------------------------------------------------- */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

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

.animate-slide-down {
    animation: slideDown 0.4s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out forwards;
}

.animate-rotate-in {
    animation: rotateIn 0.5s ease-out forwards;
}

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

/* --------------------------------------------------------------------------
   8. Shimmer Effect
   -------------------------------------------------------------------------- */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   9. Blob Styles  (single merged definition)
   -------------------------------------------------------------------------- */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: blob 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.blob:nth-child(1) {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.blob:nth-child(2) {
    width: 350px;
    height: 350px;
    background: rgba(168, 85, 247, 0.3);
    top: 50%;
    right: -5%;
    animation-delay: -4s;
    animation-duration: 14s;
}

.blob:nth-child(3) {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.2);
    bottom: -10%;
    left: 30%;
    animation-delay: -8s;
    animation-duration: 16s;
}

/* Dark mode blob adjustments */
.dark .blob:nth-child(1) {
    background: rgba(99, 102, 241, 0.15);
}

.dark .blob:nth-child(2) {
    background: rgba(168, 85, 247, 0.15);
}

.dark .blob:nth-child(3) {
    background: rgba(236, 72, 153, 0.1);
}

/* --------------------------------------------------------------------------
   10. Glitch Effect
   -------------------------------------------------------------------------- */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glitch::before {
    color: #ff006e;
    animation: glitch-1 2s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch::after {
    color: #00f5d4;
    animation: glitch-2 3s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
    0%   { transform: translate(0); }
    20%  { transform: translate(-3px, 3px); }
    40%  { transform: translate(-3px, -3px); }
    60%  { transform: translate(3px, 3px); }
    80%  { transform: translate(3px, -3px); }
    100% { transform: translate(0); }
}

@keyframes glitch-2 {
    0%   { transform: translate(0); }
    20%  { transform: translate(3px, -3px); }
    40%  { transform: translate(3px, 3px); }
    60%  { transform: translate(-3px, -3px); }
    80%  { transform: translate(-3px, 3px); }
    100% { transform: translate(0); }
}

/* --------------------------------------------------------------------------
   11. Morphing Gradient
   -------------------------------------------------------------------------- */
.morphing-gradient {
    background: linear-gradient(-45deg, #6366f1, #8b5cf6, #a855f7, #ec4899, #6366f1);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

/* --------------------------------------------------------------------------
   12. Scroll Indicator
   -------------------------------------------------------------------------- */
.scroll-indicator {
    position: relative;
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    animation: scroll-dot 1.8s ease-in-out infinite;
}

@keyframes scroll-dot {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(16px);
    }
}

/* --------------------------------------------------------------------------
   13. Particle Effect
   -------------------------------------------------------------------------- */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.6);
    animation: particle-float 8s ease-in-out infinite;
    pointer-events: none;
}

.particle:nth-child(odd) {
    background: rgba(168, 85, 247, 0.5);
    width: 4px;
    height: 4px;
    animation-duration: 10s;
}

.particle:nth-child(3n) {
    background: rgba(236, 72, 153, 0.4);
    width: 8px;
    height: 8px;
    animation-duration: 12s;
}

/* --------------------------------------------------------------------------
   14. Dark Mode Card Adjustments
   -------------------------------------------------------------------------- */
.dark .card-hover {
    border-color: rgba(99, 102, 241, 0.15);
}

.dark .card-hover::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.04),
        transparent
    );
}

.dark .card-bg::before {
    opacity: 0.02;
}

/* --------------------------------------------------------------------------
   15. Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .card-hover:hover {
        transform: translateY(-3px);
    }

    .card-3d:hover {
        transform: rotateY(-2deg) rotateX(2deg) translateZ(5px);
    }

    .blob {
        filter: blur(40px);
        opacity: 0.3;
    }

    .blob:nth-child(1) {
        width: 250px;
        height: 250px;
    }

    .blob:nth-child(2) {
        width: 200px;
        height: 200px;
    }

    .blob:nth-child(3) {
        width: 180px;
        height: 180px;
    }

    .credit-card {
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    .card-hover:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.2);
    }

    .btn-hover:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.3);
    }

    .animate-float {
        animation-duration: 8s;
    }

    .blob {
        filter: blur(30px);
        opacity: 0.2;
    }
}
