<?php
// index.php - Complete Redesigned Homepage (Compact Version)
require_once 'includes/config.php';
require_once 'includes/functions.php';

// Make sure session is started
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
?>

<?php include 'header.php'; ?>

<style>
    /* Custom Styles for Homepage */
    :root {
        --primary: #2c3e50;
        --secondary: #3498db;
        --success: #27ae60;
        --warning: #f39c12;
        --danger: #e74c3c;
        --light: #f8f9fa;
        --dark: #343a40;
    }
    
    /* ============================================
       COMPACT BANNER SLIDER STYLES
    ============================================ */
    .banner-slider {
        position: relative;
        width: 100%;
        height: 380px;
        overflow: hidden;
    }
    
    .banner-slider .slides {
        display: flex;
        width: 100%;
        height: 100%;
        transition: transform 0.5s ease-in-out;
    }
    
    .banner-slider .slide {
        min-width: 100%;
        height: 100%;
        position: relative;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
    
    .banner-slider .slide-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
        color: white;
        padding: 40px 10%;
        text-align: center;
    }
    
    .banner-slider .slide-content h2 {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 10px;
        animation: fadeInUp 0.6s ease;
    }
    
    .banner-slider .slide-content p {
        font-size: 0.95rem;
        opacity: 0.9;
        margin-bottom: 15px;
        animation: fadeInUp 0.6s ease 0.15s both;
    }
    
    .banner-slider .slide-content .btn {
        margin-top: 0;
        padding: 8px 25px;
        font-size: 0.9rem;
        animation: fadeInUp 0.6s ease 0.3s both;
    }
    
    /* Compact Slider Navigation */
    .slider-nav {
        position: absolute;
        top: 50%;
        width: 100%;
        display: flex;
        justify-content: space-between;
        transform: translateY(-50%);
        padding: 0 15px;
        z-index: 10;
    }
    
    .slider-nav button {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(0,0,0,0.5);
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .slider-nav button:hover {
        background: var(--secondary);
        transform: scale(1.1);
    }
    
    /* Compact Slider Dots */
    .slider-dots {
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 8px;
        z-index: 10;
    }
    
    .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(255,255,255,0.5);
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .dot.active {
        background: var(--secondary);
        transform: scale(1.2);
    }
    
    /* ============================================
       COMPACT MEETING PORTFOLIO SECTION
    ============================================ */
    .meeting-card {
        background: white;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 3px 15px rgba(0,0,0,0.08);
        transition: all 0.3s ease;
        margin-bottom: 20px;
    }
    
    .meeting-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    }
    
    .meeting-img {
        height: 180px;
        width: 100%;
        object-fit: cover;
    }
    
    .meeting-info {
        padding: 15px;
    }
    
    .meeting-date {
        color: var(--secondary);
        font-size: 0.75rem;
        margin-bottom: 5px;
    }
    
    .meeting-title {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    .meeting-desc {
        color: #666;
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }
    
    /* ============================================
       COMPACT TEAM MEMBER CARD
    ============================================ */
    .team-card {
        background: white;
        border-radius: 10px;
        text-align: center;
        padding: 20px 15px;
        transition: all 0.3s ease;
        box-shadow: 0 3px 15px rgba(0,0,0,0.08);
        margin-bottom: 20px;
    }
    
    .team-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    }
    
    .team-img {
        width: 110px;
        height: 110px;
        border-radius: 50%;
        object-fit: cover;
        margin: 0 auto 12px;
        border: 3px solid var(--secondary);
    }
    
    .team-name {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 3px;
        color: var(--primary);
    }
    
    .team-designation {
        color: var(--secondary);
        font-size: 0.75rem;
        font-weight: 500;
        margin-bottom: 8px;
    }
    
    .team-bio {
        color: #666;
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    .team-social {
        margin-top: 10px;
        display: flex;
        justify-content: center;
        gap: 8px;
    }
    
    .team-social a {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #f0f2f5;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--secondary);
        font-size: 0.8rem;
        transition: all 0.3s ease;
    }
    
    .team-social a:hover {
        background: var(--secondary);
        color: white;
        transform: translateY(-2px);
    }
    
    /* ============================================
       COMPACT SECTION HEADER
    ============================================ */
    .section-header {
        text-align: center;
        margin-bottom: 35px;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--primary);
        margin-bottom: 10px;
    }
    
    .section-header .section-line {
        width: 60px;
        height: 2px;
        background: var(--secondary);
        margin: 0 auto;
        border-radius: 2px;
    }
    
    .section-header p {
        color: #666;
        margin-top: 10px;
        font-size: 0.85rem;
    }
    
    /* ============================================
       COMPACT FEATURE SECTION
    ============================================ */
    .feature-card {
        background: white;
        border-radius: 10px;
        padding: 20px;
        text-align: center;
        transition: all 0.3s ease;
        box-shadow: 0 3px 15px rgba(0,0,0,0.08);
        height: 100%;
    }
    
    .feature-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        margin: 0 auto 12px;
        background: linear-gradient(135deg, var(--secondary), var(--primary));
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.2rem;
    }
    
    .feature-card h3 {
        font-size: 1rem;
        margin-bottom: 8px;
        color: var(--primary);
    }
    
    .feature-card p {
        font-size: 0.8rem;
        color: #666;
    }
    
    /* ============================================
       ANIMATIONS
    ============================================ */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* ============================================
       RESPONSIVE
    ============================================ */
    @media (max-width: 768px) {
        .banner-slider {
            height: 300px;
        }
        .banner-slider .slide-content h2 {
            font-size: 1.2rem;
        }
        .banner-slider .slide-content p {
            font-size: 0.8rem;
        }
        .banner-slider .slide-content {
            padding: 25px 15px;
        }
        .slider-nav button {
            width: 30px;
            height: 30px;
            font-size: 0.9rem;
        }
        .section-header h2 {
            font-size: 1.3rem;
        }
        .team-img {
            width: 90px;
            height: 90px;
        }
        .meeting-img {
            height: 150px;
        }
    }
    
    @media (max-width: 480px) {
        .banner-slider {
            height: 250px;
        }
        .banner-slider .slide-content h2 {
            font-size: 1rem;
        }
        .banner-slider .slide-content p {
            font-size: 0.7rem;
        }
        .banner-slider .slide-content .btn {
            padding: 5px 15px;
            font-size: 0.75rem;
        }
    }
    
    /* Utility Classes */
    .py-4 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .py-5 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .mt-3 {
        margin-top: 1rem;
    }
    
    .mb-3 {
        margin-bottom: 1rem;
    }
</style>

<!-- ============================================ -->
<!-- 1. COMPACT TOP BANNER SLIDER SECTION -->
<!-- ============================================ -->
<div class="banner-slider" id="mainSlider">
    <div class="slides" id="sliderSlides">
        <div class="slide" style="background-image: linear-gradient(135deg, rgba(44,62,80,0.6), rgba(52,152,219,0.6)), url('https://bmyouth.org/bmya/uploads/meeting.png');">
            <div class="slide-content">
                <h2>Welcome to BMYA</h2>
                <p>Bishnupriya Manipuri Youth Association - Empowering the Future</p>
                <?php if (!isLoggedIn()): ?>
                    <a href="register.php" class="btn btn-light">Join Us Today</a>
                <?php else: ?>
                    <a href="dashboard.php" class="btn btn-light">Go to Dashboard</a>
                <?php endif; ?>
            </div>
        </div>
        <div class="slide" style="background-image: linear-gradient(135deg, rgba(44,62,80,0.6), rgba(52,152,219,0.6)), url('https://bmyouth.org/bmya/uploads/meeting.png');">
            <div class="slide-content">
                <h2>Annual General Meeting 2025</h2>
                <p>Join us for the biggest event of the year</p>
                <a href="events.php" class="btn btn-light">Learn More</a>
            </div>
        </div>
        <div class="slide" style="background-image: linear-gradient(135deg, rgba(44,62,80,0.6), rgba(52,152,219,0.6)), url('https://bmyouth.org/bmya/uploads/meeting.png');">
            <div class="slide-content">
                <h2>Cultural Festival</h2>
                <p>Celebrating our rich heritage and traditions</p>
                <a href="events.php" class="btn btn-light">View Events</a>
            </div>
        </div>
    </div>
    
    <div class="slider-nav">
        <button id="prevSlide"><i class="fas fa-chevron-left"></i></button>
        <button id="nextSlide"><i class="fas fa-chevron-right"></i></button>
    </div>
    <div class="slider-dots" id="sliderDots"></div>
</div>

<!-- ============================================ -->
<!-- 2. FEATURES SECTION (Compact) -->
<!-- ============================================ -->
<section class="py-4">
    <div class="container">
        <div class="row">
            <div class="col-md-4 mb-3">
                <div class="feature-card">
                    <div class="feature-icon"><i class="fas fa-users"></i></div>
                    <h3>Community Network</h3>
                    <p>Connect with fellow Bishnupriya Manipuri youth across the globe.</p>
                </div>
            </div>
            <div class="col-md-4 mb-3">
                <div class="feature-card">
                    <div class="feature-icon"><i class="fas fa-id-card"></i></div>
                    <h3>Digital ID Card</h3>
                    <p>Get your official membership ID card instantly after registration.</p>
                </div>
            </div>
            <div class="col-md-4 mb-3">
                <div class="feature-card">
                    <div class="feature-icon"><i class="fas fa-calendar-alt"></i></div>
                    <h3>Events & Activities</h3>
                    <p>Participate in cultural events, workshops, and community activities.</p>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- ============================================ -->
<!-- 3. COMPANY MEETING PORTFOLIO SECTION (Compact) -->
<!-- ============================================ -->
<section class="py-4 bg-light">
    <div class="container">
        <div class="section-header">
            <h2>Portfolio</h2>
            <div class="section-line"></div>
            <p>Explore our recent meetings and events gallery</p>
        </div>
        
        <div class="row">
            <!-- Meeting Card 1 -->
            <div class="col-lg-4 col-md-6">
                <div class="meeting-card">
                    <img src="assets/images/meeting1.jpg" alt="Annual Meeting" class="meeting-img" onerror="this.src='https://bmyouth.org/bmya/uploads/AnnualGeneral.png'">
                    <div class="meeting-info">
                        <div class="meeting-date"><i class="fas fa-calendar-alt me-2"></i> January 15, 2025</div>
                        <h3 class="meeting-title">Annual General Meeting 2025</h3>
                        <p class="meeting-desc">Annual meeting discussing achievements and future plans.</p>
                        <a href="#" class="btn btn-sm btn-outline-primary">Read More</a>
                    </div>
                </div>
            </div>
            
            <!-- Meeting Card 2 -->
            <div class="col-lg-4 col-md-6">
                <div class="meeting-card">
                    <img src="assets/images/meeting2.jpg" alt="Executive Meeting" class="meeting-img" onerror="this.src='https://bmyouth.org/bmya/uploads/bmyaas.png'">
                    <div class="meeting-info">
                        <div class="meeting-date"><i class="fas fa-calendar-alt me-2"></i> February 20, 2025</div>
                        <h3 class="meeting-title">Executive Committee Meeting</h3>
                        <p class="meeting-desc">Strategic planning session for upcoming year.</p>
                        <a href="#" class="btn btn-sm btn-outline-primary">Read More</a>
                    </div>
                </div>
            </div>
            
            <!-- Meeting Card 3 -->
            <div class="col-lg-4 col-md-6">
                <div class="meeting-card">
                    <img src="assets/images/meeting3.jpg" alt="Cultural Event" class="meeting-img" onerror="this.src='https://bmyouth.org/bmya/uploads/festival.png'">
                    <div class="meeting-info">
                        <div class="meeting-date"><i class="fas fa-calendar-alt me-2"></i> March 10, 2025</div>
                        <h3 class="meeting-title">Cultural Festival 2025</h3>
                        <p class="meeting-desc">Celebration of our rich cultural heritage.</p>
                        <a href="#" class="btn btn-sm btn-outline-primary">Read More</a>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="text-center mt-3">
            <a href="events.php" class="btn btn-primary">View All Events</a>
        </div>
    </div>
</section>

<!-- ============================================ -->
<!-- 4. ORGANIZATION BODY MEMBERS SECTION (Compact) -->
<!-- ============================================ -->
<section class="py-4">
    <div class="container">
        <div class="section-header">
            <h2>Our Leadership Team</h2>
            <div class="section-line"></div>
            <p>Meet the dedicated individuals guiding our organization</p>
        </div>
        
        <div class="row">
            <!-- Team Member 1 -->
            <div class="col-lg-3 col-md-6">
                <div class="team-card">
                    <img src="https://bmyouth.org/bmya/uploads/arpon.png" alt="Arpon Sinha" class="team-img" onerror="this.src='assets/images/default-avatar.png'">
                    <h3 class="team-name">Arpon Sinha</h3>
                    <div class="team-designation">President</div>
                    <p class="team-bio">Leading the organization with vision and dedication.</p>
                    <div class="team-social">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-linkedin-in"></i></a>
                        <a href="mailto:president@bmyouth.org"><i class="fas fa-envelope"></i></a>
                    </div>
                </div>
            </div>
            
            <!-- Team Member 2 -->
            <div class="col-lg-3 col-md-6">
                <div class="team-card">
                    <img src="https://bmyouth.org/bmya/uploads/Shukla1.jpg" alt="Shukla Singha" class="team-img" onerror="this.src='assets/images/default-avatar.png'">
                    <h3 class="team-name">Shukla Singha</h3>
                    <div class="team-designation">General Secretary</div>
                    <p class="team-bio">Managing day-to-day operations and activities.</p>
                    <div class="team-social">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-linkedin-in"></i></a>
                        <a href="mailto:secretary@bmyouth.org"><i class="fas fa-envelope"></i></a>
                    </div>
                </div>
            </div>
            
            <!-- Team Member 3 -->
            <div class="col-lg-3 col-md-6">
                <div class="team-card">
                    <img src="https://bmyouth.org/bmya/uploads/Hitendra.jpg" alt="Hirendra Sinha" class="team-img" onerror="this.src='assets/images/default-avatar.png'">
                    <h3 class="team-name">Hirendra Sinha</h3>
                    <div class="team-designation">Vice President</div>
                    <p class="team-bio">Supporting strategic initiatives and programs.</p>
                    <div class="team-social">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-linkedin-in"></i></a>
                        <a href="mailto:vicepresident@bmyouth.org"><i class="fas fa-envelope"></i></a>
                    </div>
                </div>
            </div>
            
            <!-- Team Member 4 -->
            <div class="col-lg-3 col-md-6">
                <div class="team-card">
                    <img src="https://bmyouth.org/bmya/uploads/nirmal.png" alt="Nirmal Sinha" class="team-img" onerror="this.src='assets/images/default-avatar.png'">
                    <h3 class="team-name">Nirmal Sinha</h3>
                    <div class="team-designation">Treasurer</div>
                    <p class="team-bio">Managing financial operations with transparency.</p>
                    <div class="team-social">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-linkedin-in"></i></a>
                        <a href="mailto:treasurer@bmyouth.org"><i class="fas fa-envelope"></i></a>
                    </div>
                </div>
            </div>
            
            <!-- Team Member 5 -->
            <div class="col-lg-3 col-md-6">
                <div class="team-card">
                    <img src="https://bmyouth.org/bmya/uploads/1779966190_6a1820ee6d019.jpg" alt="Anup Sinha" class="team-img" onerror="this.src='assets/images/default-avatar.png'">
                    <h3 class="team-name">Anup Sinha</h3>
                    <div class="team-designation">Central In-Charge</div>
                    <p class="team-bio">Coordinating member activities across regions.</p>
                    <div class="team-social">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-linkedin-in"></i></a>
                        <a href="mailto:pravari@bmyouth.org"><i class="fas fa-envelope"></i></a>
                    </div>
                </div>
            </div>
            
            <!-- Team Member 6 -->
            <div class="col-lg-3 col-md-6">
                <div class="team-card">
                    <img src="https://bmyouth.org/bmya/uploads/randhir.png" alt="Member" class="team-img">
                    <h3 class="team-name">Ranadhir Singha</h3>
                    <div class="team-designation">Cultural Secretary</div>
                    <p class="team-bio">Organizing cultural events and heritage programs.</p>
                    <div class="team-social">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-linkedin-in"></i></a>
                        <a href="mailto:cultural@bmyouth.org"><i class="fas fa-envelope"></i></a>
                    </div>
                </div>
            </div>
            
            <!-- Team Member 7 -->
            <div class="col-lg-3 col-md-6">
                <div class="team-card">
                    <img src="https://bmyouth.org/bmya/uploads/nirmalkanta.png" alt="Member" class="team-img">
                    <h3 class="team-name">Nirmal Kanta Sinha</h3>
                    <div class="team-designation">Senior Advisor</div>
                    <p class="team-bio">Organizing advisor activities.</p>
                    <div class="team-social">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-linkedin-in"></i></a>
                        <a href="mailto:sports@bmyouth.org"><i class="fas fa-envelope"></i></a>
                    </div>
                </div>
            </div>
            
            <!-- Team Member 8 -->
            <div class="col-lg-3 col-md-6">
                <div class="team-card">
                    <img src="https://bmyouth.org/bmya/uploads/userpic.jfif" alt="Member" class="team-img">
                    <h3 class="team-name">Vacant</h3>
                    <div class="team-designation">Women's Wing Head</div>
                    <p class="team-bio">Leading women empowerment initiatives.</p>
                    <div class="team-social">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-linkedin-in"></i></a>
                        <a href="mailto:womenswing@bmyouth.org"><i class="fas fa-envelope"></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<script>
// ============================================
// COMPACT BANNER SLIDER FUNCTIONALITY
// ============================================
document.addEventListener('DOMContentLoaded', function() {
    const slides = document.querySelectorAll('#sliderSlides .slide');
    const prevBtn = document.getElementById('prevSlide');
    const nextBtn = document.getElementById('nextSlide');
    const dotsContainer = document.getElementById('sliderDots');
    let currentSlide = 0;
    let autoSlideInterval;
    const slideCount = slides.length;
    
    if (slideCount === 0) return;
    
    function createDots() {
        if (!dotsContainer) return;
        dotsContainer.innerHTML = '';
        for (let i = 0; i < slideCount; i++) {
            const dot = document.createElement('div');
            dot.classList.add('dot');
            if (i === currentSlide) dot.classList.add('active');
            dot.addEventListener('click', () => goToSlide(i));
            dotsContainer.appendChild(dot);
        }
    }
    
    function updateDots() {
        const dots = document.querySelectorAll('.dot');
        dots.forEach((dot, index) => {
            dot.classList.toggle('active', index === currentSlide);
        });
    }
    
    function goToSlide(index) {
        if (index < 0) index = slideCount - 1;
        if (index >= slideCount) index = 0;
        currentSlide = index;
        const sliderSlides = document.getElementById('sliderSlides');
        sliderSlides.style.transform = `translateX(-${currentSlide * 100}%)`;
        updateDots();
        resetAutoSlide();
    }
    
    function nextSlide() {
        goToSlide(currentSlide + 1);
    }
    
    function prevSlide() {
        goToSlide(currentSlide - 1);
    }
    
    function resetAutoSlide() {
        clearInterval(autoSlideInterval);
        autoSlideInterval = setInterval(nextSlide, 5000);
    }
    
    if (prevBtn) prevBtn.addEventListener('click', prevSlide);
    if (nextBtn) nextBtn.addEventListener('click', nextSlide);
    
    createDots();
    resetAutoSlide();
    
    const sliderContainer = document.querySelector('.banner-slider');
    if (sliderContainer) {
        sliderContainer.addEventListener('mouseenter', () => clearInterval(autoSlideInterval));
        sliderContainer.addEventListener('mouseleave', () => autoSlideInterval = setInterval(nextSlide, 5000));
    }
});
</script>

<?php include 'footer.php'; ?>