/**
 * Mosadiotsile Charitable Society - Animation Styles
 * Adds subtle animations and transitions to enhance user experience
 */

/* Base animation setup */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* FAQ transitions */
.faq-answer {
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
}

/* Contact form field animations */
.contact-form input,
.contact-form select,
.contact-form textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: var(--charity-primary);
    box-shadow: 0 0 0 3px rgba(142, 78, 64, 0.1);
    outline: none;
    background-color: rgba(255, 255, 255, 0.9);
}

.contact-form label {
    transition: color 0.3s ease;
}

.contact-form input:focus + label,
.contact-form select:focus + label,
.contact-form textarea:focus + label,
.contact-form .has-value + label {
    color: var(--charity-primary);
}

/* Button hover animations */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: height 0.3s ease;
    z-index: -1;
}

.btn:hover::after {
    height: 100%;
}

.btn-primary::before,
.btn-tertiary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before,
.btn-tertiary:hover::before {
    width: 300px;
    height: 300px;
}

/* Hero section animations */
#charity-hero {
    position: relative;
    overflow: hidden;
}

#charity-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(142, 78, 64, 0.3), rgba(142, 78, 64, 0));
    animation: gradientShift 10s infinite alternate;
}

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

/* Card hover effects */
.impact-card:hover,
.involvement-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.impact-icon,
.involvement-icon {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.impact-card:hover .impact-icon,
.involvement-card:hover .involvement-icon {
    transform: scale(1.1);
    background-color: rgba(142, 78, 64, 0.2);
}

/* Section entry animations */
.section-header {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards 0.2s;
}

.divider {
    transform: scaleX(0);
    animation: growDivider 1s forwards 0.5s;
}

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

@keyframes growDivider {
    to {
        transform: scaleX(1);
    }
}

/* Logo and image animations */
.charity-about-image img {
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.charity-about-image:hover img {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Media query for reduced animations on small screens */
@media (max-width: 768px) {
    .animate-on-scroll {
        opacity: 1;
        transform: translateY(0);
    }

    #charity-hero::before {
        animation: none;
    }

    .section-header,
    .divider {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Prefers reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: translateY(0);
    }
}