/* Smooth Animations for Forum Pages */

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

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

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

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

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

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

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

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

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

/* Apply animations to common elements */
.post-card, .card, .content-card {
    animation: fadeInUp 0.5s ease-out both;
}

.post-card:nth-child(1), .card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2), .card:nth-child(2) { animation-delay: 0.15s; }
.post-card:nth-child(3), .card:nth-child(3) { animation-delay: 0.2s; }
.post-card:nth-child(4), .card:nth-child(4) { animation-delay: 0.25s; }
.post-card:nth-child(5), .card:nth-child(5) { animation-delay: 0.3s; }
.post-card:nth-child(6), .card:nth-child(6) { animation-delay: 0.35s; }

.post-card:hover, .card:hover {
    transform: translateY(-4px) scale(1.01);
    transition: all 0.3s ease;
}

/* Button animations */
button, .btn, .btn-primary, .btn-secondary, [type="submit"] {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

button:hover::before, .btn:hover::before, .btn-primary:hover::before, .btn-secondary:hover::before {
    left: 100%;
}

button:hover, .btn:hover, .btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px) scale(1.02);
}

button:active, .btn:active, .btn-primary:active, .btn-secondary:active {
    transform: translateY(0) scale(0.98);
}

/* Input animations */
input:focus, textarea:focus, select:focus {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -20px rgba(37, 99, 235, 0.5), 0 0 0 4px rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
}

input, textarea, select {
    transition: all 0.3s ease;
}

/* Header animations */
.header, header {
    animation: fadeIn 0.6s ease-out;
}

/* Composer/Form animations */
.composer, form.main-form, .form-container {
    animation: fadeInUp 0.6s ease-out;
}

/* Comments animations */
.comment, .reply {
    animation: fadeIn 0.5s ease-out both;
}

/* Sidebar animations */
.sidebar {
    animation: slideInRight 0.5s ease-out;
}

.sidebar-item:hover, .menu-item:hover {
    transform: translateX(5px);
    transition: transform 0.2s ease;
}

/* FAB animations */
.fab-button, .floating-button {
    transition: all 0.3s ease;
}

.fab-button:hover, .floating-button:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Notification badge pulse */
.notification-badge, .badge-count {
    animation: pulse 2s ease-in-out infinite;
}

/* Modal animations */
.modal, .modal-overlay {
    animation: fadeIn 0.3s ease-out;
}

.modal-content, .modal-container {
    animation: scaleIn 0.3s ease-out;
}

/* Image loading animation */
img {
    transition: opacity 0.3s ease;
}

img:not([src]) {
    opacity: 0;
}

/* Link hover effects */
a {
    transition: all 0.2s ease;
}

/* Page transitions */
.page-content, main, .main-content {
    animation: fadeIn 0.6s ease-out;
}

/* Profile animations */
.profile-header, .user-card {
    animation: fadeInUp 0.6s ease-out;
}

.stat-card {
    animation: fadeIn 0.5s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Search results animations */
.search-result {
    animation: fadeInUp 0.4s ease-out both;
}

.search-result:nth-child(odd) {
    animation-delay: 0.05s;
}

.search-result:nth-child(even) {
    animation-delay: 0.1s;
}

/* Loading animations */
.loading, .spinner {
    animation: rotate 1s linear infinite;
}

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

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

