<?php
require_once 'includes/config.php';
require_once 'includes/header.php';
$pageTitle = 'MeeVakeel - Connect with Expert Lawyers Online in India';
$metaDescription = 'Consult verified lawyers online across India. Property, Criminal, Family, Divorce, Corporate law advice from expert advocates. Affordable & Confidential.';
$metaKeywords = 'online lawyer, legal consultation, property lawyer, criminal lawyer, Hyderabad advocate, Telangana lawyer, Andhra Pradesh lawyer';
require_once 'includes/config.php';
require_once 'includes/header.php';

$db = getDB();
// Fetch featured lawyers
$featuredLawyers = $db->query("
    SELECT l.*, s.name as state_name, c.name as city_name,
    GROUP_CONCAT(lc.name SEPARATOR ', ') as practice_areas
    FROM lawyers l
    LEFT JOIN states s ON l.state_id = s.id
    LEFT JOIN cities c ON l.city_id = c.id
    LEFT JOIN lawyer_expertise le ON l.id = le.lawyer_id
    LEFT JOIN legal_categories lc ON le.category_id = lc.id
    WHERE l.is_featured = 1 AND l.status = 1 AND l.verification_status = 'approved'
    GROUP BY l.id LIMIT 6
")->fetchAll();

// Fetch categories
$categories = $db->query("SELECT * FROM legal_categories WHERE status=1 ORDER BY sort_order")->fetchAll();

// Fetch testimonials (reviews)
$testimonials = $db->query("
    SELECT r.*, u.name as client_name, l.name as lawyer_name
    FROM reviews r
    JOIN users u ON r.user_id = u.id
    JOIN lawyers l ON r.lawyer_id = l.id
    WHERE r.is_approved = 1
    ORDER BY r.created_at DESC LIMIT 6
")->fetchAll();

// Fetch FAQs
$faqs = $db->query("SELECT * FROM faqs WHERE status=1 ORDER BY sort_order LIMIT 8")->fetchAll();

// Stats
$stats = [
    'lawyers' => $db->query("SELECT COUNT(*) FROM lawyers WHERE verification_status='approved' AND status=1")->fetchColumn() ?: '500+',
    'consultations' => $db->query("SELECT COUNT(*) FROM appointments WHERE status='completed'")->fetchColumn() ?: '10000+',
    'cities' => $db->query("SELECT COUNT(DISTINCT city_id) FROM lawyers WHERE status=1")->fetchColumn() ?: '50+',
    'satisfaction' => '98%'
];
?>

<!-- Page Loader -->
<div id="pageLoader"
    style="position:fixed;inset:0;background:var(--primary);z-index:9999;display:flex;align-items:center;justify-content:center;transition:opacity 0.4s;">
    <div style="text-align:center;color:white;">
        <div style="font-family:var(--font-heading);font-size:2rem;font-weight:800;color:var(--gold);">MeeVakeel</div>
        <div class="spinner-border text-warning mt-3" style="width:1.5rem;height:1.5rem;"></div>
    </div>
</div>

<!-- ==================== HERO SECTION ==================== -->
<section class="hero-section">
    <div class="hero-bg-pattern"></div>
    <div class="container">
        <div class="row align-items-center g-5">
            <div class="col-lg-7 col-12 hero-content order-lg-1 order-2 mt-lg-0 mt-2">
                <div class="hero-badge fade-up">
                    <i class="fas fa-certificate"></i>
                    Verified Advocates Across India
                </div>
                <h1 class="hero-title fade-up delay-1">
                    Connect with <span class="accent">Expert Lawyers</span><br>Online, Anytime
                </h1>
                <p class="hero-subtitle fade-up delay-2">
                    Get instant legal advice from verified advocates across India.
                    Property, Criminal, Family, Corporate law — we have experts for every need.
                </p>

                <!-- Search Box -->
                <div class="hero-search-box fade-up delay-3">
                    <select class="search-field" id="heroCategory"
                        style="border:none;background:transparent;color:#2d3748;outline:none;">
                        <option value="">All Legal Categories</option>
                        <?php foreach($categories as $cat): ?>
                        <option value="<?= $cat['slug'] ?>"><?= $cat['name'] ?></option>
                        <?php endforeach; ?>
                    </select>
                    <div class="search-divider d-none d-sm-block"></div>
                    <select class="search-field" id="heroCity"
                        style="border:none;background:transparent;color:#2d3748;outline:none;">

                        <option value="">Select City</option>

                        <optgroup label="📍 Telangana">
                            <option value="hyderabad">Hyderabad</option>
                            <option value="warangal">Warangal</option>
                            <option value="karimnagar">Karimnagar</option>
                            <option value="nizamabad">Nizamabad</option>
                            <option value="khammam">Khammam</option>
                            <option value="nalgonda">Nalgonda</option>
                            <option value="mahabubnagar">Mahabubnagar</option>
                            <option value="siddipet">Siddipet</option>
                            <option value="suryapet">Suryapet</option>
                            <option value="adilabad">Adilabad</option>
                        </optgroup>

                        <optgroup label="📍 Andhra Pradesh">
                            <option value="visakhapatnam">Visakhapatnam</option>
                            <option value="vijayawada">Vijayawada</option>
                            <option value="guntur">Guntur</option>
                            <option value="tirupati">Tirupati</option>
                            <option value="nellore">Nellore</option>
                            <option value="kurnool">Kurnool</option>
                            <option value="rajahmundry">Rajahmundry</option>
                            <option value="kakinada">Kakinada</option>
                            <option value="anantapur">Anantapur</option>
                            <option value="kadapa">Kadapa</option>
                        </optgroup>

                    </select>
                    <button class="btn-search" id="heroSearchBtn">
                        <i class="fas fa-search me-2"></i>Find Lawyer
                    </button>
                </div>

                <div class="hero-stats fade-up delay-4">
                    <div class="hero-stat">
                        <!-- <span class="stat-number counter-number"
                            data-target="<?= is_numeric($stats['lawyers']) ? $stats['lawyers'] : 500 ?>"
                            data-suffix="+"><?= $stats['lawyers'] ?></span> -->
                        <span class="stat-number">10+</span>
                        <span class="stat-label">Verified Lawyers</span>
                    </div>
                    <div class="hero-stat">
                        <!-- <span class="stat-number counter-number"
                            data-target="<?= is_numeric($stats['consultations']) ? $stats['consultations'] : 10000 ?>"
                            data-suffix="+"><?= $stats['consultations'] ?></span> -->
                        <span class="stat-number">100+</span>
                        <span class="stat-label">Consultations Done</span>
                    </div>
                    <div class="hero-stat">
                        <!-- <span class="stat-number"><?= $stats['cities'] ?></span> -->
                        <span class="stat-number">20+</span>
                        <span class="stat-label">Cities Covered</span>
                    </div>
                    <div class="hero-stat">
                        <span class="stat-number"><?= $stats['satisfaction'] ?></span>
                        <span class="stat-label">Satisfaction Rate</span>
                    </div>
                </div>

                <div class="mt-4 d-flex gap-3 flex-wrap fade-up">
                    <a href="login.php" class="btn btn-gold btn-lg px-4">
                        <i class="fas fa-comments me-2"></i>Talk to Lawyer
                    </a>
                    <a href="register-lawyer.php" class="btn btn-outline-gold btn-lg px-4">
                        <i class="fas fa-user-tie me-2"></i>Register as Lawyer
                    </a>
                </div>
            </div>

            <div class="col-lg-5 col-12 hero-image-col d-flex order-lg-2 order-1">
                <!-- SVG Illustration -->
                <div class="hero-illustration">
                    <svg viewBox="0 0 440 420" xmlns="http://www.w3.org/2000/svg">
                        <defs>
                            <radialGradient id="circleGrad" cx="50%" cy="50%" r="50%">
                                <stop offset="0%" style="stop-color:rgba(212,175,55,0.15)" />
                                <stop offset="100%" style="stop-color:rgba(212,175,55,0)" />
                            </radialGradient>
                        </defs>
                        <!-- Background circles -->
                        <circle cx="220" cy="210" r="180" fill="url(#circleGrad)" />
                        <circle cx="220" cy="210" r="140" fill="none" stroke="rgba(212,175,55,0.12)" stroke-width="1"
                            stroke-dasharray="6,6" />
                        <!-- Scale of Justice -->
                        <g transform="translate(110,60)">
                            <!-- Pole -->
                            <rect x="107" y="40" width="6" height="220" rx="3" fill="#D4AF37" />
                            <!-- Top bar -->
                            <rect x="40" y="38" width="140" height="6" rx="3" fill="#D4AF37" />
                            <!-- Left pan chain -->
                            <line x1="70" y1="44" x2="55" y2="140" stroke="#D4AF37" stroke-width="2" />
                            <line x1="80" y1="44" x2="95" y2="140" stroke="#D4AF37" stroke-width="2" />
                            <!-- Right pan chain -->
                            <line x1="145" y1="44" x2="130" y2="140" stroke="#D4AF37" stroke-width="2" />
                            <line x1="155" y1="44" x2="170" y2="140" stroke="#D4AF37" stroke-width="2" />
                            <!-- Left pan -->
                            <ellipse cx="75" cy="148" rx="42" ry="10" fill="#D4AF37" opacity="0.9" />
                            <path d="M33,142 Q75,130 117,142" fill="rgba(212,175,55,0.3)" stroke="#D4AF37"
                                stroke-width="1.5" />
                            <!-- Right pan -->
                            <ellipse cx="150" cy="148" rx="42" ry="10" fill="#D4AF37" opacity="0.9" />
                            <path d="M108,142 Q150,130 192,142" fill="rgba(212,175,55,0.3)" stroke="#D4AF37"
                                stroke-width="1.5" />
                            <!-- Base -->
                            <rect x="80" y="260" width="60" height="8" rx="4" fill="#D4AF37" />
                            <rect x="100" y="256" width="20" height="12" rx="3" fill="#b8960c" />
                        </g>
                        <!-- Decorative dots -->
                        <circle cx="80" cy="100" r="5" fill="rgba(212,175,55,0.4)" />
                        <circle cx="360" cy="320" r="7" fill="rgba(212,175,55,0.3)" />
                        <circle cx="380" cy="130" r="4" fill="rgba(212,175,55,0.5)" />
                        <circle cx="50" cy="300" r="6" fill="rgba(212,175,55,0.3)" />
                        <!-- Law book -->
                        <rect x="60" y="310" width="80" height="60" rx="6" fill="#0d2d56" stroke="rgba(212,175,55,0.4)"
                            stroke-width="1" />
                        <rect x="60" y="310" width="10" height="60" rx="6" fill="#D4AF37" />
                        <text x="80" y="345" fill="rgba(212,175,55,0.7)" font-size="8" font-family="serif">LAW</text>
                        <!-- Gavel -->
                        <rect x="290" y="290" width="90" height="30" rx="8" fill="#D4AF37"
                            transform="rotate(-30, 335, 305)" />
                        <rect x="340" y="280" width="15" height="70" rx="5" fill="#b8960c"
                            transform="rotate(-30, 347, 315)" />
                    </svg>
                    <!-- Floating Cards -->
                    <div class="instant-help-card">

                        <h5>
                            <i class="fas fa-bolt text-warning me-2"></i>
                            Get Instant Help
                        </h5>

                        <input type="text" class="form-control mb-2" placeholder="Your Name">

                        <input type="tel" class="form-control mb-3" placeholder="Mobile Number">

                        <button class="btn btn-gold w-100">
                            <i class="fas fa-phone-alt me-2"></i>
                            Talk to Advocate
                        </button>

                    </div>
                    <div class="hero-float-card card-2">
                        <div class="card-icon"><i class="fas fa-lock"></i></div>
                        <div>
                            <div style="font-size:0.82rem;font-weight:700;color:#0A2342;">Secure &</div>
                            <div style="font-size:0.72rem;color:#718096;">Confidential</div>
                        </div>
                    </div>
                    <div class="hero-float-card card-3">
                        <a href="lawers.php">
                            <div class="card-icon"><i class="fas fa-user-tie"></i></div>
                            <div>
                                <div style="font-size:0.82rem;font-weight:700;color:#0A2342;">Connect with</div>
                                <div style="font-size:0.72rem;color:#718096;">a Lawyer</div>
                            </div>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- ==================== TRUST BADGES ==================== -->
<div style="background:var(--white);border-bottom:1px solid var(--border);padding:18px 0;">
    <div class="container">
        <div class="row align-items-center justify-content-center g-3 text-center">
            <div class="col-6 col-md-2">
                <div style="font-size:0.78rem;color:var(--text-light);font-weight:600;">
                    <i class="fas fa-certificate text-warning me-1"></i>Bar Council Verified
                </div>
            </div>
            <div class="col-6 col-md-2">
                <div style="font-size:0.78rem;color:var(--text-light);font-weight:600;">
                    <i class="fas fa-lock text-success me-1"></i>SSL Secured
                </div>
            </div>
            <div class="col-6 col-md-2">
                <div style="font-size:0.78rem;color:var(--text-light);font-weight:600;">
                    <i class="fas fa-star text-warning me-1"></i>4.9/5 Rated Platform
                </div>
            </div>
            <div class="col-6 col-md-2">
                <div style="font-size:0.78rem;color:var(--text-light);font-weight:600;">
                    <i class="fas fa-rupee-sign text-success me-1"></i>Razorpay Payments
                </div>
            </div>
            <div class="col-6 col-md-2">
                <div style="font-size:0.78rem;color:var(--text-light);font-weight:600;">
                    <i class="fas fa-headset text-primary me-1"></i>24/7 Support
                </div>
            </div>
        </div>
    </div>
</div>

<!-- ==================== LEGAL CATEGORIES ==================== -->
<section class="section section-light">

    <div class="container">

        <div class="text-center mb-5">

            <span class="section-badge">Legal Services</span>

            <h2 class="section-title fade-up">
                Find the Right <span style="color:var(--gold);">Legal Expert</span>
            </h2>

            <div class="divider-gold"></div>

            <p class="section-subtitle">
                Browse by practice area and connect with specialized lawyers
            </p>

        </div>

        <div class="row">

            <!-- Targeted Services -->

            <div class="col-lg-6">

                <h4 class="mb-4">
                    <i class="fas fa-bullseye text-gold me-2"></i>
                    Targeted Services
                </h4>

                <div class="category-grid">

                    <?php foreach($categories as $i => $cat): ?>

                    <?php if($cat['sort_order'] >= 1 && $cat['sort_order'] <= 20): ?>

                    <a href="lawyers.php?category=<?= $cat['id'] ?>"
                        class="category-card fade-up delay-<?= ($i % 4)+1 ?>">

                        <div class="category-icon">
                            <i class="<?= $cat['icon'] ?>"></i>
                        </div>

                        <h6><?= $cat['name'] ?></h6>

                    </a>

                    <?php endif; ?>

                    <?php endforeach; ?>

                </div>

            </div>

            <!-- Advocate Services -->

            <div class="col-lg-6">

                <h4 class="mb-4">
                    <i class="fas fa-user-tie text-gold me-2"></i>
                    Advocate Services
                </h4>

                <div class="category-grid">

                    <?php foreach($categories as $i => $cat): ?>

                    <?php if($cat['sort_order'] >= 21): ?>

                    <a href="lawyers.php?category=<?= $cat['id'] ?>"
                        class="category-card fade-up delay-<?= ($i % 4)+1 ?>">

                        <div class="category-icon">
                            <i class="<?= $cat['icon'] ?>"></i>
                        </div>

                        <h6><?= $cat['name'] ?></h6>

                    </a>

                    <?php endif; ?>

                    <?php endforeach; ?>

                </div>

            </div>

        </div>

    </div>

</section>

<!-- ==================== HOW IT WORKS ==================== -->
<section class="section pb-4">
    <div class="container">
        <div class="text-center mb-5">
            <span class="section-badge">Simple Process</span>
            <h2 class="section-title fade-up">How <span style="color:var(--gold);">MeeVakeel</span> Works</h2>
            <div class="divider-gold"></div>
            <p class="section-subtitle">Get expert legal advice in 3 simple steps</p>
        </div>
        <div class="row g-4 position-relative">
            <div class="col-md-4">
                <div class="step-card fade-up">
                    <div class="step-number">1</div>
                    <div class="step-icon mt-4">
                        <i class="fas fa-search"></i>
                    </div>
                    <h5>Choose Legal Category</h5>
                    <p>Browse our wide range of legal categories and select the area of law you need help with.</p>
                </div>
            </div>
            <div class="col-md-4">
                <div class="step-card fade-up delay-2">
                    <div class="step-number">2</div>
                    <div class="step-icon mt-4">
                        <i class="fas fa-user-tie"></i>
                    </div>
                    <h5>Connect with Lawyer</h5>
                    <p>Browse verified lawyer profiles, check reviews, experience, and fees. Book your consultation
                        slot.</p>
                </div>
            </div>
            <div class="col-md-4">
                <div class="step-card fade-up delay-3">
                    <div class="step-number">3</div>
                    <div class="step-icon mt-4">
                        <i class="fas fa-check-circle"></i>
                    </div>
                    <h5>Get Legal Solution</h5>
                    <p>Consult via chat, audio or video call and receive personalized legal advice and guidance.</p>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- ==================== WHY CHOOSE US ==================== -->
<section class="section section-light pb-4 pt-5">
    <div class="container">
        <div class="row align-items-center g-5">
            <div class="col-lg-6">
                <span class="section-badge">Why Choose Us</span>
                <h2 class="section-title mt-2 fade-up">India's Most Trusted <span style="color:var(--gold);">Legal
                        Platform</span></h2>
                <div class="divider-gold" style="margin:16px 0;"></div>
                <p class="text-muted mb-4">We connect you with the best lawyers in India through a secure, transparent
                    and affordable platform.</p>
                <div class="feature-item fade-up">
                    <div class="feature-icon-wrap"><i class="fas fa-certificate"></i></div>
                    <div class="feature-content">
                        <h5>100% Verified Lawyers</h5>
                        <p>Every lawyer on our platform is verified with their Bar Council enrollment cards and
                            credentials checked by our team.</p>
                    </div>
                </div>
                <div class="feature-item fade-up delay-1">
                    <div class="feature-icon-wrap"><i class="fas fa-lock"></i></div>
                    <div class="feature-content">
                        <h5>Secure & Confidential</h5>
                        <p>Your consultations and documents are protected with end-to-end encryption and strict privacy
                            policies.</p>
                    </div>
                </div>
                <div class="feature-item fade-up delay-2">
                    <div class="feature-icon-wrap"><i class="fas fa-rupee-sign"></i></div>
                    <div class="feature-content">
                        <h5>Affordable Consultation Fees</h5>
                        <p>Junior lawyers offer free initial consultations. Senior lawyers set transparent fees shown
                            upfront.</p>
                    </div>
                </div>
                <div class="feature-item fade-up delay-3">
                    <div class="feature-icon-wrap"><i class="fas fa-video"></i></div>
                    <div class="feature-content">
                        <h5>Online & Phone Consultation</h5>
                        <p>Consult lawyers via chat, audio call, or video call — from the comfort of your home.</p>
                    </div>
                </div>
                <div class="feature-item fade-up delay-4">
                    <div class="feature-icon-wrap"><i class="fas fa-bolt"></i></div>
                    <div class="feature-content">
                        <h5>Fast Legal Assistance</h5>
                        <p>Get same-day appointments with available lawyers. Emergency legal help when you need it most.
                        </p>
                    </div>
                </div>
            </div>
            <div class="col-lg-6 fade-up">
                <!-- Stats Grid -->
                <div class="row g-3">
                    <div class="col-6">
                        <div
                            style="background:var(--primary);border-radius:var(--radius-lg);padding:36px 24px;text-align:center;color:white;">
                            <div
                                style="font-size:2.8rem;font-weight:800;color:var(--gold);font-family:var(--font-heading);">
                                <span class="counter-number" data-target="500" data-suffix="+">500+</span>
                            </div>
                            <div style="font-size:0.9rem;color:rgba(255,255,255,0.7);margin-top:8px;">Expert Lawyers
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div
                            style="background:linear-gradient(135deg,var(--gold),var(--gold-dark));border-radius:var(--radius-lg);padding:36px 24px;text-align:center;">
                            <div
                                style="font-size:2.8rem;font-weight:800;color:var(--primary);font-family:var(--font-heading);">
                                <span class="counter-number" data-target="18" data-suffix="+">18+</span>
                            </div>
                            <div style="font-size:0.9rem;color:var(--primary-dark);margin-top:8px;">Practice Areas</div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div
                            style="background:linear-gradient(135deg,var(--gold),var(--gold-dark));border-radius:var(--radius-lg);padding:36px 24px;text-align:center;">
                            <div
                                style="font-size:2.8rem;font-weight:800;color:var(--primary);font-family:var(--font-heading);">
                                <span>100%</span>
                            </div>
                            <div style="font-size:0.9rem;color:var(--primary-dark);margin-top:8px;">Verified Lawyers
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div
                            style="background:var(--primary);border-radius:var(--radius-lg);padding:36px 24px;text-align:center;color:white;">
                            <div
                                style="font-size:2.8rem;font-weight:800;color:var(--gold);font-family:var(--font-heading);">
                                98%</div>
                            <div style="font-size:0.9rem;color:rgba(255,255,255,0.7);margin-top:8px;">Satisfaction Rate
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Featured Lawyers -->
<!-- <section class="section">
    <div class="container">

        <div class="text-center mb-5">
            <span class="section-badge">Meet Our Lawyers</span>
            <h2 class="section-title fade-up">
                Featured <span style="color:var(--gold);">Lawyers</span>
            </h2>

            <div class="divider-gold"></div>

            <p class="section-subtitle">
                Connect with our top-rated verified lawyers
            </p>
        </div>

        <?php if (empty($featuredLawyers)): ?>

        <div class="text-center py-5">

            <h3 style="color:var(--primary);">
                No Lawyers Available
            </h3>

            <p style="color:var(--text-light);">
                Lawyers will appear here once added.
            </p>

        </div>

        <?php else: ?>

        <div class="row g-4">

            <?php foreach($featuredLawyers as $i => $l): ?>

            <div class="col-lg-4 col-md-6 fade-up delay-<?= ($i % 4) + 1 ?>">

                <div class="lawyer-card">

                    <div class="lawyer-card-header">

                        <span class="verified-badge">
                            <i class="fas fa-check-circle"></i> Verified
                        </span>

                        <?php if($l['profile_photo']): ?>

                        <img src="<?= SITE_URL ?>/assets/uploads/profiles/<?= $l['profile_photo'] ?>"
                            alt="<?= htmlspecialchars($l['name']) ?>" class="lawyer-avatar">
                        <?php else: ?>

                        <div class="lawyer-avatar-placeholder">
                            <?= strtoupper(substr($l['name'], 0, 2)) ?>
                        </div>

                        <?php endif; ?>

                        <?php if(!empty($l['enrollment_number'])): ?>

                        <div class="lawyer-enrollment">

                            <i class="fas fa-id-card"></i>

                            Enrolment No:
                            <?= htmlspecialchars($l['enrollment_number']) ?>

                        </div>

                        <?php endif; ?>

                        <span class="lawyer-exp-badge">
                            <?= getExperienceLabel($l['experience_years']) ?> Experience
                        </span>

                    </div>

                    <div class="lawyer-card-body">

                        <div class="lawyer-practice">
                            <?= htmlspecialchars(substr($l['practice_areas'] ?? '', 0, 40)) ?>...
                        </div>

                        <div class="lawyer-info-row">

                            <span class="lawyer-info-item">
                                <i class="fas fa-map-marker-alt"></i>

                                <?= htmlspecialchars(
        $l['city_name']
        ?: ($l['state_name'] ?: 'India')
    ) ?>

                            </span>

                            <span class="lawyer-info-item">
                                <i class="fas fa-language"></i>

                                <?= ucwords(str_replace(',', ', ', htmlspecialchars($l['languages'] ?? ''))) ?>

                            </span>

                        </div>

                        <div class="d-flex justify-content-between align-items-center">

                            <div>

                                <?= getLawyerRatingStars($l['rating']) ?>

                                <span class="rating-text">
                                    <?= $l['rating'] ?>
                                    (<?= $l['total_reviews'] ?> reviews)
                                </span>

                            </div>

                            <div class="lawyer-experience">

                                <i class="fas fa-briefcase text-gold"></i>

                                <?= getExperienceLabel($l['experience_years']) ?>

                            </div>

                        </div>

                    </div>

                    <div class="lawyer-card-footer">

                        <a href="<?= SITE_URL ?>/lawyer-details.php?id=<?= $l['id'] ?>" class="btn-book">

                            <i class="fas fa-user-tie me-2"></i>

                            View Advocate Profile

                        </a>

                    </div>

                </div>

            </div>

            <?php endforeach; ?>

        </div>

        <?php endif; ?>

        <div class="text-center mt-5">

            <a href="<?= SITE_URL ?>/lawyers.php" class="btn btn-primary-dark btn-lg px-5">

                View All Lawyers
                <i class="fas fa-arrow-right ms-2"></i>

            </a>

        </div>

    </div>
</section> -->

<!-- ==================== STUDENT INTERNSHIP ==================== -->

<section class="section">

    <div class="container">

        <div class="text-center mb-5">
            <span class="section-badge">
                Student Arena - Be a renowned lawyer
            </span>

            <h2 class="section-title2">
                Build Your Legal Career with Practical Experience
            </h2>
            <div class="divider-gold"></div>
            <p class="section-subtitle mt-2">

                MeeVakeel provides internship opportunities for law students,
                MBA students, and aspiring legal professionals through online,
                offline, and court exposure programs.

            </p>
        </div>

        <div class="row align-items-center">

            <div class="col-lg-6 pe-lg-5">

                <img src="assets/images/image-student.jpg" class="img-fluid rounded" alt="Student Internship">

            </div>

            <div class="col-lg-6">
                <h2 class="section-title2">
                    Learn. Practice. Succeed.
                </h2>
                <div class="row mt-4 g-3">

                    <div class="col-md-6">
                        <div class="highlight-box">
                            <i class="fas fa-laptop-house"></i>
                            <div>
                                <h6>Online Internship</h6>
                                <small>Learn from anywhere in India.</small>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="highlight-box">
                            <i class="fas fa-university"></i>
                            <div>
                                <h6>Court Exposure</h6>
                                <small>Practical court visit experience.</small>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="highlight-box">
                            <i class="fas fa-award"></i>
                            <div>
                                <h6>Internship Certificate</h6>
                                <small>Certificate after successful completion.</small>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="highlight-box">
                            <i class="fas fa-file-signature"></i>
                            <div>
                                <h6>Letter of Recommendation</h6>
                                <small>Issued for outstanding performance.</small>
                            </div>
                        </div>
                    </div>

                </div>

                <a href="pages/student-internship.php" class="btn btn-gold mt-4">

                    Explore Internship Program <i class="fas fa-arrow-right ms-2"></i>

                </a>

            </div>

        </div>

    </div>

</section>


<!-- ==================== LAWYER CTA BANNER ==================== -->
<section class="lawyer-cta-section">
    <div class="container">
        <div class="row align-items-center g-5">
            <div class="col-lg-7">
                <span
                    style="background:rgba(10,35,66,0.12);color:var(--primary);padding:6px 18px;border-radius:50px;font-size:0.78rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;">Freelance
                    Opportunity</span>
                <h2 class="mt-3 mb-3" style="font-size:2rem;">Are You a Lawyer? <br>Join MeeVakeel Free!</h2>
                <p style="font-size:1rem;color:rgba(10,35,66,0.8);margin-bottom:28px;">
                    Connect with clients seeking legal help. Build your practice online and earn from anywhere in India.
                    Registration is 100% free for all verified advocates.
                </p>
                <div class="row g-3">
                    <div class="col-sm-6">
                        <div class="benefit-item"><i class="fas fa-check-circle"></i> Get direct verified client calls
                        </div>
                        <div class="benefit-item"><i class="fas fa-check-circle"></i> Work from anywhere in India</div>
                        <div class="benefit-item"><i class="fas fa-check-circle"></i> Stage-wise transparent billing
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="benefit-item"><i class="fas fa-check-circle"></i> 100% Free Registration</div>
                        <div class="benefit-item"><i class="fas fa-check-circle"></i> Boost your legal practice</div>
                        <div class="benefit-item"><i class="fas fa-check-circle"></i> Dashboard & earnings tracker</div>
                    </div>
                </div>
                <div class="eligibility-note mt-3"
                    style="background:rgba(10,35,66,0.08);border-left:4px solid var(--primary);padding:12px 16px;border-radius:6px;font-size:0.85rem;color:var(--primary);">
                    <strong>Eligibility:</strong> Lawyers with minimum 2+ years of legal practice experience are
                    eligible to register.
                </div>
                <div class="mt-4">
                    <a href="register-lawyer.php"
                        style="background:var(--primary);color:white;border:none;padding:14px 36px;border-radius:50px;font-weight:700;font-size:1rem;display:inline-flex;align-items:center;gap:8px;text-decoration:none;transition:all 0.3s;">
                        <i class="fas fa-user-tie"></i> Register as Lawyer — It's Free
                    </a>
                </div>
            </div>
            <div class="col-lg-5">
                <img src="assets/images/register.png" class="img-fluid rounded" alt="Student Internship">
            </div>
        </div>
    </div>
</section>



<!-- ==================== TESTIMONIALS ==================== -->
<section class="section section-light">
    <div class="container">
        <div class="text-center mb-5">
            <span class="section-badge">Client Stories</span>
            <h2 class="section-title fade-up">What Our <span style="color:var(--gold);">Clients Say</span></h2>
            <div class="divider-gold"></div>
            <p class="section-subtitle">Real experiences from real clients across India</p>
        </div>
        <div class="row g-4">
            <?php
            $defaultTestimonials = [
                ['name'=>'Suresh Babu', 'city'=>'Hyderabad', 'text'=>'I had a property dispute that had been going on for years. The property lawyer I consulted through MeeVakeel gave me excellent guidance and the matter was resolved within months. Highly recommend!', 'rating'=>5, 'type'=>'Property Dispute'],
                ['name'=>'Anitha Rao', 'city'=>'Vijayawada', 'text'=>'The divorce process was very stressful. Adv. Priya on MeeVakeel was extremely supportive and professional. She guided me through every step. The platform is very easy to use.', 'rating'=>5, 'type'=>'Divorce Case'],
                ['name'=>'Vikram Singh', 'city'=>'Hyderabad', 'text'=>'Got consultation for my startup legal documentation. The lawyer was knowledgeable, the fees were very transparent and affordable. Will definitely use again for future needs.', 'rating'=>4, 'type'=>'Startup Law'],
                ['name'=>'Padma Lakshmi', 'city'=>'Vizag', 'text'=>'My employer cheated me out of my dues. Found an excellent labour lawyer on MeeVakeel who helped me file a case. Got my settlement within 3 months. Thank you MeeVakeel!', 'rating'=>5, 'type'=>'Labour Dispute'],
                ['name'=>'Raju Naidu', 'city'=>'Warangal', 'text'=>'Was falsely accused in a criminal case. The criminal lawyer I consulted was brilliant. He knew the local court system very well and got me bail within 24 hours.', 'rating'=>5, 'type'=>'Criminal Case'],
                ['name'=>'Meena Kumari', 'city'=>'Guntur', 'text'=>'Got help for a consumer complaint against a builder. The lawyer was prompt, professional and fought hard for my rights. Platform is trustworthy and secure.', 'rating'=>4, 'type'=>'Consumer Case'],
            ];
            $displayTestimonials = !empty($testimonials) ? $testimonials : $defaultTestimonials;
            foreach($displayTestimonials as $i => $t):
                $name = $t['client_name'] ?? $t['name'];
                $city = $t['city'] ?? '';
                $text = $t['review'] ?? $t['text'];
                $rating = $t['rating'] ?? 5;
                $type = $t['type'] ?? '';
                $initial = strtoupper($name[0]);
            ?>
            <div class="col-lg-4 col-md-6 fade-up delay-<?= ($i % 3) + 1 ?>">
                <div class="testimonial-card">
                    <div class="testimonial-quote">"</div>
                    <p class="testimonial-text"><?= htmlspecialchars($text) ?></p>
                    <div class="stars mb-2">
                        <?php for($s=0;$s<5;$s++) echo '<i class="'.($s < $rating ? 'fas' : 'far').' fa-star"></i>'; ?>
                    </div>
                    <?php if($type): ?><span
                        style="font-size:0.75rem;background:rgba(212,175,55,0.1);color:var(--gold-dark);padding:3px 10px;border-radius:50px;font-weight:600;"><?= $type ?></span><?php endif; ?>
                    <div class="testimonial-author mt-3">
                        <div class="author-avatar"><?= $initial ?></div>
                        <div>
                            <div class="author-name"><?= htmlspecialchars($name) ?></div>
                            <?php if($city): ?><div class="author-role"><i
                                    class="fas fa-map-marker-alt me-1"></i><?= $city ?></div><?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<!-- ==================== FAQ SECTION ==================== -->
<section class="section">
    <div class="container">
        <div class="row g-5 align-items-start">
            <div class="col-lg-5">
                <span class="section-badge">FAQ</span>
                <h2 class="section-title mt-2">Frequently Asked <span style="color:var(--gold);">Questions</span></h2>
                <div class="divider-gold" style="margin:16px 0;"></div>
                <p class="text-muted">Have more questions? Our team is here to help.</p>
                <div class="mt-4">
                    <a href="pages/faq.php" class="btn btn-primary-dark me-3">View All FAQs</a>
                    <a href="pages/contact.php" class="btn btn-outline-gold">Contact Us</a>
                </div>
                <div class="mt-4 p-3"
                    style="background:var(--off-white);border-radius:var(--radius);border-left:4px solid var(--gold);">
                    <p class="mb-1" style="font-weight:600;font-size:0.9rem;color:var(--primary);">Need immediate help?
                    </p>
                    <p class="mb-0" style="font-size:0.85rem;color:var(--text-light);">
                        <a href="https://wa.me/9876543210" target="_blank"
                            style="color:var(--success);font-weight:600;">
                            <i class="fab fa-whatsapp me-1"></i>Chat on WhatsApp
                        </a>
                    </p>
                </div>
            </div>
            <div class="col-lg-7">
                <div class="accordion faq-accordion" id="faqAccordion">
                    <?php foreach($faqs as $i => $faq): ?>
                    <div class="accordion-item">
                        <h2 class="accordion-header">
                            <button class="accordion-button <?= $i > 0 ? 'collapsed' : '' ?>" type="button"
                                data-bs-toggle="collapse" data-bs-target="#faq<?= $i ?>">
                                <?= htmlspecialchars($faq['question']) ?>
                            </button>
                        </h2>
                        <div id="faq<?= $i ?>" class="accordion-collapse collapse <?= $i === 0 ? 'show' : '' ?>"
                            data-bs-parent="#faqAccordion">
                            <div class="accordion-body"><?= htmlspecialchars($faq['answer']) ?></div>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- ==================== BOTTOM CTA ==================== -->
<section class="section-light" style="padding:60px 0;">
    <div class="container">
        <div class="cta-banner">
            <div class="position-relative z-1">
                <h2>Ready to Get Legal Help?</h2>
                <p>Connect with a verified lawyer today. Fast, affordable, and completely secure.</p>
                <div class="d-flex gap-3 justify-content-center flex-wrap">
                    <a href="login.php" class="btn btn-gold btn-lg px-5">
                        <i class="fas fa-comments me-2"></i>Talk to a Lawyer
                    </a>
                    <a href="lawyers.php" class="btn btn-outline-gold btn-lg px-5">
                        <i class="fas fa-search me-2"></i>Browse All Lawyers
                    </a>
                </div>
            </div>
        </div>
    </div>
</section>

<?php require_once 'includes/footer.php'; ?>