/**
 * Animations CSS for BNP Upazila Theme
 * GSAP & Custom Animations
 * 
 * @package BNP_Upazila
 * @since 1.0.0
 */

/* ==========================================================================
   Hero Section Animations
   ========================================================================== */

.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bnp-green) 0%, #004d2f 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Particle Animation */
.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    animation: float-particle 15s infinite ease-in-out;
}

@keyframes float-particle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(100px, -100vh) scale(0.5);
        opacity: 0;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 1000px;
    padding: 0 20px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeInScale 1s 0.3s forwards;
}

.hero-slogan {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 1s 0.6s forwards;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1s 0.9s forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================================================
   Scroll Animations
   ========================================================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(50px);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.8);
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
}

.stagger-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Card Hover Effects
   ========================================================================== */

.card-hover-effect {
    position: relative;
    overflow: hidden;
}

.card-hover-effect::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, rgba(0, 107, 63, 0.3));
    transition: var(--transition-smooth);
}

.card-hover-effect:hover::before {
    top: 0;
}

.card-hover-effect:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Card Shine Effect */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--transition-smooth);
}

.card-shine:hover::after {
    left: 100%;
}

/* ==========================================================================
   Leadership Section Animations
   ========================================================================== */

.leadership-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
}

.leadership-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.leadership-image {
    position: relative;
    overflow: hidden;
}

.leadership-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.leadership-card:hover .leadership-image img {
    transform: scale(1.1);
}

.leadership-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 30px 20px;
    color: white;
    transform: translateY(100%);
    transition: var(--transition-smooth);
}

.leadership-card:hover .leadership-overlay {
    transform: translateY(0);
}

/* ==========================================================================
   Number Counter Animation
   ========================================================================== */

.counter-section {
    background: var(--bnp-green);
    color: white;
    padding: 60px 0;
}

.counter-item {
    text-align: center;
    padding: 30px;
}

.counter-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

.counter-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ==========================================================================
   Timeline Animation
   ========================================================================== */

.timeline {
    position: relative;
    padding: 50px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bnp-green);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 50px;
    opacity: 0;
}

.timeline-item.revealed {
    opacity: 1;
    animation: timelineSlide 0.8s forwards;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-content {
    width: 45%;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 10%;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 10%;
}

.timeline-icon {
    position: absolute;
    left: 50%;
    top: 0;
    width: 50px;
    height: 50px;
    background: var(--bnp-gold);
    border-radius: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bnp-dark);
    font-size: 1.5rem;
    box-shadow: 0 0 0 5px white;
}

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

/* ==========================================================================
   Gallery Masonry Effect
   ========================================================================== */

.gallery-masonry {
    column-count: 3;
    column-gap: 20px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    display: block;
    transition: var(--transition-smooth);
}

.gallery-item:hover img {
    filter: brightness(0.7);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 107, 63, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: white;
    font-size: 2rem;
}

/* ==========================================================================
   Loading Animations
   ========================================================================== */

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 107, 63, 0.1);
    border-top-color: var(--bnp-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--bnp-green);
    border-radius: 50%;
    margin: 0 5px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ==========================================================================
   Progress Bar Animation
   ========================================================================== */

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #eee;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--bnp-green), var(--bnp-gold));
    border-radius: 15px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================================================
   Responsive Animations
   ========================================================================== */

@media (max-width: 992px) {
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        flex-direction: column !important;
    }
    
    .timeline-content {
        width: calc(100% - 80px) !important;
        margin-left: 80px !important;
        margin-right: 0 !important;
    }
    
    .timeline-icon {
        left: 30px;
    }
    
    .gallery-masonry {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-slogan {
        font-size: 1.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .counter-number {
        font-size: 2rem;
    }
    
    .gallery-masonry {
        column-count: 1;
    }
}

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