/* Custom Animations and Utilities */

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

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

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.6s ease-out;
}

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

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1E293B;
}

::-webkit-scrollbar-thumb {
    background: #3B82F6;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563EB;
}

/* Service Card Hover Effect */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
}

/* Project Card Hover Effect */
.project-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-card-overlay {
    opacity: 1;
}

/* Blog Card Styles */
.blog-card {
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

/* Button Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.btn-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Code Block Styling */
pre {
    background: #1E293B;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

/* Form Input Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading Spinner */
.spinner {
    border: 3px solid #334155;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    background: #1E293B;
    border: 1px solid #334155;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid #10B981;
}

.toast.error {
    border-left: 4px solid #EF4444;
}

.toast.warning {
    border-left: 4px solid #F59E0B;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(to right, #3B82F6, #60A5FA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Image Lazy Loading Effect */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Tech Badge */
.tech-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.1);
    color: #60A5FA;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    background: rgba(16, 185, 129, 0.1);
    color: #34D399;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.published {
    background: rgba(16, 185, 129, 0.1);
    color: #34D399;
}

.status-badge.draft {
    background: rgba(251, 191, 36, 0.1);
    color: #FCD34D;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}
