/* Homepage Animations and Effects */

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animated Background */
.animated-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-hover:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
    border-color: rgba(102, 126, 234, 0.2);
}

.card-hover img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover img {
    transform: scale(1.1);
}

/* Category Pills */
.category-pill {
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.category-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* Stat Numbers Animation */
.stat-number {
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

/* Floating Icons */
.floating-icon {
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

/* Stagger Animation for Items */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }
.stagger-item:nth-child(9) { animation-delay: 0.9s; }
.stagger-item:nth-child(10) { animation-delay: 1s; }
.stagger-item:nth-child(11) { animation-delay: 1.1s; }
.stagger-item:nth-child(12) { animation-delay: 1.2s; }

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* Search Box Enhancement */
.search-box {
    position: relative;
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease;
}

.search-box:focus-within {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3) !important;
}

.search-box input:focus {
    outline: none;
    box-shadow: none;
}

/* Masonry Grid */
.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

@media (max-width: 992px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .masonry-grid {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* Badge Animation */
.badge-animated {
    animation: pulse 2s ease-in-out infinite;
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Shimmer Loading Effect */
.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Button Enhancements */
.btn {
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Badge Enhancements */
.badge {
    transition: all 0.3s ease;
    font-weight: 600;
}

/* Card Body Enhancements */
.card-body {
    position: relative;
    z-index: 1;
}

/* Hover Glow Effect */
.hover-glow {
    position: relative;
    overflow: hidden;
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hover-glow:hover::before {
    width: 300px;
    height: 300px;
}

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-hover:hover {
        transform: translateY(-6px) scale(1.01);
    }
    
    .display-5 {
        font-size: 2rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus States */
:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background: #667eea;
    color: white;
}

::-moz-selection {
    background: #667eea;
    color: white;
}
