/* Code Card Styling */
.code-card {
    position: relative;
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    backdrop-filter: blur(10px);
}

.code-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.1), rgba(209, 213, 219, 0.1));
    border-radius: 1rem;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.code-card:hover::after {
    opacity: 1;
}

/* Code Text Styling */
.code-text {
    position: relative;
    letter-spacing: 0.05em;
    word-break: break-all;
}

.code-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    border-radius: 0.75rem;
    pointer-events: none;
}

/* Copy Button Styling */
.copy-btn {
    position: relative;
    overflow: hidden;
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.copy-btn:hover::before {
    width: 300px;
    height: 300px;
}

.copy-btn.copied {
    background: linear-gradient(to-r, #10b981, #059669) !important;
    animation: pulse-success 0.6s ease;
}

.copy-btn.copied .copy-text::after {
    content: 'Copied!';
}

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

/* Active Badge Animation */
@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

.code-card:hover .w-2.h-2 {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Stagger Animation for Cards */
.code-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.code-card:nth-child(1) { animation-delay: 0.05s; }
.code-card:nth-child(2) { animation-delay: 0.1s; }
.code-card:nth-child(3) { animation-delay: 0.15s; }
.code-card:nth-child(4) { animation-delay: 0.2s; }
.code-card:nth-child(5) { animation-delay: 0.25s; }
.code-card:nth-child(6) { animation-delay: 0.3s; }
.code-card:nth-child(n+7) { animation-delay: 0.35s; }

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

/* Responsive Adjustments - Mobile First Approach */
@media (max-width: 768px) {
    .code-card {
        animation-delay: 0s !important;
    }
    
    /* Ensure mobile cards display properly in 2-column grid */
    .code-card {
        min-height: auto;
    }
}

/* Selection Highlight */
.code-text span::selection {
    background-color: rgba(156, 163, 175, 0.3);
    color: inherit;
}

.code-text span::-moz-selection {
    background-color: rgba(156, 163, 175, 0.3);
    color: inherit;
}

