<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AJ&K Education Department - Admin Dashboard</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #0056b3;
            --secondary: #6c757d;
            --success: #28a745;
            --info: #17a2b8;
            --warning: #ffc107;
            --danger: #dc3545;
            --light: #f8f9fa;
            --dark: #343a40;
            --education-blue: #1a3e72;
            --education-light: #e9f0f7;
        }
        
        body {
            background-color: #f5f5f5;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        .navbar-brand img {
            height: 40px;
        }
        
        .sidebar {
            background-color: var(--education-blue);
            color: white;
            min-height: calc(100vh - 56px);
            box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        }
        
        .sidebar .nav-link {
            color: rgba(255,255,255,0.8);
            border-left: 3px solid transparent;
            padding: 10px 15px;
            margin-bottom: 2px;
        }
        
        .sidebar .nav-link:hover, .sidebar .nav-link.active {
            color: white;
            background-color: rgba(255,255,255,0.1);
            border-left: 3px solid var(--warning);
        }
        
        .sidebar .nav-link i {
            margin-right: 10px;
            width: 20px;
            text-align: center;
        }
        
        .dashboard-card {
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            transition: transform 0.3s;
            border: none;
            margin-bottom: 20px;
        }
        
        .dashboard-card:hover {
            transform: translateY(-5px);
        }
        
        .card-icon {
            font-size: 2rem;
            margin-bottom: 15px;
        }
        
        .welcome-card {
            background: linear-gradient(135deg, var(--education-blue), #2a5ca0);
            color: white;
        }
        
        .profile-img {
            width: 100px;
            height: 100px;
            object-fit: cover;
            border: 3px solid white;
        }
        
        .report-btn {
            padding: 20px;
            margin: 10px 0;
            border-radius: 8px;
            text-align: center;
            transition: all 0.3s;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            border: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
        }
        
        .report-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 15px rgba(0,0,0,0.1);
        }
        
        .report-btn i {
            font-size: 2rem;
            margin-bottom: 10px;
        }
        
        .report-btn .badge {
            position: absolute;
            top: 10px;
            right: 10px;
        }
        
        .stats-card {
            border-left: 4px solid;
        }
        
        /* Message Cards Styles - UPDATED */
        .message-card {
            border-left: 4px solid;
            transition: all 0.3s ease;
            height: auto;
            cursor: pointer;
            overflow: hidden;
            margin-bottom: 15px;
        }
        
        .message-card.collapsed {
            height: 90px;
        }
        
        .message-card.expanded {
            height: auto;
        }
        
        .message-card.urgent {
            border-left-color: var(--danger);
        }
        
        .message-card.info {
            border-left-color: var(--info);
        }
        
        .message-card.warning {
            border-left-color: var(--warning);
        }
        
        .message-card.success {
            border-left-color: var(--success);
        }
        
        .message-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 10px;
        }
        
        .message-sender {
            font-weight: 600;
            color: var(--dark);
            margin-bottom: 5px;
        }
        
        .message-role {
            font-size: 0.8rem;
            color: var(--secondary);
        }
        
        .message-time {
            font-size: 0.8rem;
            color: var(--secondary);
            white-space: nowrap;
        }
        
        .message-content {
            color: var(--dark);
            overflow: hidden;
            margin-bottom: 15px;
            transition: all 0.3s ease;
        }
        
        .message-card.collapsed .message-content {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        
        .message-tags {
            margin-top: auto;
        }
        
        .message-tag {
            font-size: 0.75rem;
            padding: 3px 8px;
            border-radius: 12px;
            margin-right: 5px;
        }
        
        .expand-indicator {
            text-align: center;
            font-size: 0.8rem;
            color: var(--secondary);
            margin-top: 5px;
        }
        
        .view-all-messages {
            display: block;
            text-align: center;
            margin-top: 20px;
            padding: 10px;
            background-color: var(--education-light);
            border-radius: 5px;
            color: var(--education-blue);
            font-weight: 600;
            transition: all 0.3s;
        }
        
        .view-all-messages:hover {
            background-color: var(--education-blue);
            color: white;
            text-decoration: none;
        }
        
        @media (max-width: 768px) {
            .sidebar {
                min-height: auto;
            }
        }
    </style>
</head>
<body>
    <!-- Navigation Bar -->
    <nav class="navbar navbar-expand-lg navbar-dark" style="background-color: var(--education-blue);">
        <div class="container-fluid">
            <a class="navbar-brand" href="#">
                <div style="width: 50px; height: 50px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center;">
                    <span style="color: var(--education-blue); font-weight: bold;">AJK</span>
                </div>
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link position-relative" href="#">
                            <i class="fas fa-envelope"></i>
                            <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
                                12+
                                <span class="visually-hidden">unread messages</span>
                            </span>
                        </a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
                            <i class="fas fa-user-circle"></i> Admin User
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="#"><i class="fas fa-user"></i> My Profile</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fas fa-key"></i> Change Password</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item text-danger" href="#"><i class="fas fa-sign-out-alt"></i> Logout</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container-fluid">
        <div class="row">
            <!-- Sidebar -->
            <div class="col-md-3 col-lg-2 d-md-block sidebar p-0">
                <div class="position-sticky pt-3">
                    <div class="text-center p-3">
                        <div style="width: 100px; height: 100px; background: #e9f0f7; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; border: 3px solid white;">
                            <i class="fas fa-user-shield" style="font-size: 2.5rem; color: var(--education-blue);"></i>
                        </div>
                        <h6 class="mt-2">Admin User</h6>
                        <small class="text-muted">System Administrator</small>
                    </div>
                    
                    <ul class="nav flex-column">
                        <li class="nav-item">
                            <a class="nav-link active" href="#">
                                <i class="fas fa-tachometer-alt"></i> Dashboard
                            </a>
                        </li>
                        
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-users"></i> Student Management
                            </a>
                        </li>
                        
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-school"></i> School Management
                            </a>
                        </li>
                        
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-user-tie"></i> Staff Management
                            </a>
                        </li>
                        
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-money-bill-wave"></i> Finance
                            </a>
                        </li>
                        
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-chart-bar"></i> Reports
                            </a>
                        </li>
                        
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-file-alt"></i> Documents
                            </a>
                        </li>
                        
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-bullhorn"></i> Announcements
                            </a>
                        </li>
                        
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-cog"></i> System Settings
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
            
            <!-- Main Content -->
            <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4 py-4">
                <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
                    <h1 class="h2">Admin Dashboard</h1>
                    <div class="btn-toolbar mb-2 mb-md-0">
                        <div class="btn-group me-2">
                            <button type="button" class="btn btn-sm btn-outline-secondary">
                                <i class="fas fa-download"></i> Export Data
                            </button>
                        </div>
                        <button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle">
                            <i class="fas fa-calendar-alt"></i> This week
                        </button>
                    </div>
                </div>
                
                <!-- Statistics Overview -->
                <div class="row mb-4">
                    <div class="col-md-3">
                        <div class="card stats-card" style="border-left-color: var(--primary);">
                            <div class="card-body">
                                <div class="row align-items-center">
                                    <div class="col">
                                        <h6 class="card-title text-muted">Total Schools</h6>
                                        <h4 class="mb-0">1,247</h4>
                                    </div>
                                    <div class="col-auto">
                                        <i class="fas fa-school fa-2x text-primary"></i>
                                    </div>
                                </div>
                                <p class="mt-3 mb-0 text-muted text-sm">
                                    <span class="text-success me-2"><i class="fa fa-arrow-up"></i> 3.48%</span>
                                    <span class="text-nowrap">Since last month</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-3">
                        <div class="card stats-card" style="border-left-color: var(--success);">
                            <div class="card-body">
                                <div class="row align-items-center">
                                    <div class="col">
                                        <h6 class="card-title text-muted">Total Students</h6>
                                        <h4 class="mb-0">356,892</h4>
                                    </div>
                                    <div class="col-auto">
                                        <i class="fas fa-user-graduate fa-2x text-success"></i>
                                    </div>
                                </div>
                                <p class="mt-3 mb-0 text-muted text-sm">
                                    <span class="text-success me-2"><i class="fa fa-arrow-up"></i> 5.2%</span>
                                    <span class="text-nowrap">Since last month</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-3">
                        <div class="card stats-card" style="border-left-color: var(--warning);">
                            <div class="card-body">
                                <div class="row align-items-center">
                                    <div class="col">
                                        <h6 class="card-title text-muted">Teaching Staff</h6>
                                        <h4 class="mb-0">12,583</h4>
                                    </div>
                                    <div class="col-auto">
                                        <i class="fas fa-chalkboard-teacher fa-2x text-warning"></i>
                                    </div>
                                </div>
                                <p class="mt-3 mb-0 text-muted text-sm">
                                    <span class="text-success me-2"><i class="fa fa-arrow-up"></i> 2.1%</span>
                                    <span class="text-nowrap">Since last month</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-3">
                        <div class="card stats-card" style="border-left-color: var(--info);">
                            <div class="card-body">
                                <div class="row align-items-center">
                                    <div class="col">
                                        <h6 class="card-title text-muted">Non-Teaching Staff</h6>
                                        <h4 class="mb-0">3,742</h4>
                                    </div>
                                    <div class="col-auto">
                                        <i class="fas fa-user-tie fa-2x text-info"></i>
                                    </div>
                                </div>
                                <p class="mt-3 mb-0 text-muted text-sm">
                                    <span class="text-success me-2"><i class="fa fa-arrow-up"></i> 1.7%</span>
                                    <span class="text-nowrap">Since last month</span>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Messages from School Heads & Staff -->
                <h4 class="mb-3">Messages from School Heads & Staff</h4>
                <div class="row mb-4">
                    <div class="col-md-4 mb-3">
                        <div class="card message-card urgent collapsed" data-bs-toggle="collapse" data-bs-target="#message1">
                            <div class="card-body">
                                <div class="message-header">
                                    <div>
                                        <div class="message-sender">Principal</div>
                                        <div class="message-role">Boys Higher Secondary School</div>
                                    </div>
                                    <div class="message-time">2 hours ago</div>
                                </div>
                                <div class="message-content collapse" id="message1">
                                    Urgent need for additional mathematics teachers. Current staff overwhelmed with increased student enrollment this semester.
                                </div>
                                <div class="message-tags collapse" id="message1-tags">
                                    <span class="badge bg-danger message-tag">Urgent</span>
                                    <span class="badge bg-primary message-tag">Staffing</span>
                                </div>
                                <div class="expand-indicator">
                                    <i class="fas fa-chevron-down"></i> Click to expand
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-4 mb-3">
                        <div class="card message-card warning collapsed" data-bs-toggle="collapse" data-bs-target="#message2">
                            <div class="card-body">
                                <div class="message-header">
                                    <div>
                                        <div class="message-sender">Vice Principal</div>
                                        <div class="message-role">Boys Secondary School</div>
                                    </div>
                                    <div class="message-time">Yesterday</div>
                                </div>
                                <div class="message-content collapse" id="message2">
                                    Science lab equipment needs immediate upgrade. Current equipment is outdated and some pieces are not functioning properly.
                                </div>
                                <div class="message-tags collapse" id="message2-tags">
                                    <span class="badge bg-warning message-tag">Facilities</span>
                                    <span class="badge bg-info message-tag">Science</span>
                                </div>
                                <div class="expand-indicator">
                                    <i class="fas fa-chevron-down"></i> Click to expand
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-4 mb-3">
                        <div class="card message-card info collapsed" data-bs-toggle="collapse" data-bs-target="#message3">
                            <div class="card-body">
                                <div class="message-header">
                                    <div>
                                        <div class="message-sender">ABC</div>
                                        <div class="message-role">Head of English Department</div>
                                    </div>
                                    <div class="message-time">2 days ago</div>
                                </div>
                                <div class="message-content collapse" id="message3">
                                    Requesting approval for the inter-school debate competition scheduled for next month. Budget proposal attached.
                                </div>
                                <div class="message-tags collapse" id="message3-tags">
                                    <span class="badge bg-info message-tag">Event</span>
                                    <span class="badge bg-success message-tag">Approval</span>
                                </div>
                                <div class="expand-indicator">
                                    <i class="fas fa-chevron-down"></i> Click to expand
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-4 mb-3">
                        <div class="card message-card success collapsed" data-bs-toggle="collapse" data-bs-target="#message4">
                            <div class="card-body">
                                <div class="message-header">
                                    <div>
                                        <div class="message-sender">ABC</div>
                                        <div class="message-role">Elementary School Teacher</div>
                                    </div>
                                    <div class="message-time">3 days ago</div>
                                </div>
                                <div class="message-content collapse" id="message4">
                                    The new reading program has shown excellent results. Student reading levels have improved by 27% since implementation.
                                </div>
                                <div class="message-tags collapse" id="message4-tags">
                                    <span class="badge bg-success message-tag">Success</span>
                                    <span class="badge bg-primary message-tag">Program</span>
                                </div>
                                <div class="expand-indicator">
                                    <i class="fas fa-chevron-down"></i> Click to expand
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-4 mb-3">
                        <div class="card message-card info collapsed" data-bs-toggle="collapse" data-bs-target="#message5">
                            <div class="card-body">
                                <div class="message-header">
                                    <div>
                                        <div class="message-sender">ABC</div>
                                        <div class="message-role">IT Coordinator</div>
                                    </div>
                                    <div class="message-time">4 days ago</div>
                                </div>
                                <div class="message-content collapse" id="message5">
                                    Requesting server upgrade to handle increased online learning traffic. Current infrastructure struggling during peak usage.
                                </div>
                                <div class="message-tags collapse" id="message5-tags">
                                    <span class="badge bg-info message-tag">Technology</span>
                                    <span class="badge bg-warning message-tag">Upgrade</span>
                                </div>
                                <div class="expand-indicator">
                                    <i class="fas fa-chevron-down"></i> Click to expand
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-4 mb-3">
                        <div class="card message-card warning collapsed" data-bs-toggle="collapse" data-bs-target="#message6">
                            <div class="card-body">
                                <div class="message-header">
                                    <div>
                                        <div class="message-sender">Sports Department</div>
                                        <div class="message-role">District Sports Office</div>
                                    </div>
                                    <div class="message-time">5 days ago</div>
                                </div>
                                <div class="message-content collapse" id="message6">
                                    Need replacement sports equipment for annual tournaments. Many items are worn out and need replacement for safety reasons.
                                </div>
                                <div class="message-tags collapse" id="message6-tags">
                                    <span class="badge bg-warning message-tag">Sports</span>
                                    <span class="badge bg-danger message-tag">Safety</span>
                                </div>
                                <div class="expand-indicator">
                                    <i class="fas fa-chevron-down"></i> Click to expand
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-12">
                        <a href="#" class="view-all-messages">
                            <i class="fas fa-envelope-open-text me-2"></i>View All Messages
                        </a>
                    </div>
                </div>
                
                <!-- Report Buttons Section -->
                <h4 class="mb-3">Reports Dashboard</h4>
                
                <!-- School Reports -->
                <div class="card mb-4">
                    <div class="card-header bg-primary text-white">
                        <h5 class="mb-0"><i class="fas fa-school me-2"></i>School Reports</h5>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-primary w-100 report-btn position-relative">
                                    <i class="fas fa-list"></i>
                                    <h6>School Directory</h6>
                                    <small>Complete list of all schools</small>
                                    <span class="badge bg-light text-dark">1,247</span>
                                </button>
                            </div>
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-info w-100 report-btn">
                                    <i class="fas fa-chart-line"></i>
                                    <h6>Performance Reports</h6>
                                    <small>School performance metrics</small>
                                </button>
                            </div>
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-success w-100 report-btn">
                                    <i class="fas fa-building"></i>
                                    <h6>Infrastructure Status</h6>
                                    <small>Buildings and facilities report</small>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Staff Reports -->
                <div class="card mb-4">
                    <div class="card-header bg-success text-white">
                        <h5 class="mb-0"><i class="fas fa-user-tie me-2"></i>Staff Reports</h5>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-success w-100 report-btn position-relative">
                                    <i class="fas fa-list-alt"></i>
                                    <h6>Staff Directory</h6>
                                    <small>Complete staff listing</small>
                                    <span class="badge bg-light text-dark">16,325</span>
                                </button>
                            </div>
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-info w-100 report-btn">
                                    <i class="fas fa-user-check"></i>
                                    <h6>Attendance Records</h6>
                                    <small>Staff attendance reports</small>
                                </button>
                            </div>
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-primary w-100 report-btn">
                                    <i class="fas fa-graduation-cap"></i>
                                    <h6>Qualifications Report</h6>
                                    <small>Staff education and training</small>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Student Reports -->
                <div class="card mb-4">
                    <div class="card-header bg-info text-white">
                        <h5 class="mb-0"><i class="fas fa-user-graduate me-2"></i>Student Reports</h5>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-info w-100 report-btn position-relative">
                                    <i class="fas fa-list-ol"></i>
                                    <h6>Enrollment Statistics</h6>
                                    <small>Student enrollment data</small>
                                    <span class="badge bg-light text-dark">356,892</span>
                                </button>
                            </div>
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-primary w-100 report-btn">
                                    <i class="fas fa-chart-bar"></i>
                                    <h6>Academic Performance</h6>
                                    <small>Grades and exam results</small>
                                </button>
                            </div>
                            <div class="col-md-4 mb-3">
                                <button class="btn btn-success w-100 report-btn">
                                    <i class="fas fa-user-friends"></i>
                                    <h6>Demographic Reports</h6>
                                    <small>Age, gender, ethnicity data</small>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Recent Activities -->
                <div class="mt-5">
                    <h4>Recent Activities</h4>
                    <div class="card">
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-hover">
                                    <thead>
                                        <tr>
                                            <th>Date</th>
                                            <th>User</th>
                                            <th>Activity</th>
                                            <th>Action</th>
                                            <th>Status</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td>2023-11-15 09:32</td>
                                            <td>Admin User</td>
                                            <td>Generated Student Enrollment Report</td>
                                            <td>Report</td>
                                            <td><span class="badge bg-success">Completed</span></td>
                                        </tr>
                                        <tr>
                                            <td>2023-11-15 08:15</td>
                                            <td>Principal Ahmed</td>
                                            <td>Updated staff attendance records</td>
                                            <td>Update</td>
                                            <td><span class="badge bg-success">Completed</span></td>
                                        </tr>
                                        <tr>
                                            <td>2023-11-14 16:45</td>
                                            <td>Data Entry Operator</td>
                                            <td>Added new student records</td>
                                            <td>Create</td>
                                            <td><span class="badge bg-success">Completed</span></td>
                                        </tr>
                                        <tr>
                                            <td>2023-11-14 14:20</td>
                                            <td>Admin User</td>
                                            <td>Exported School Infrastructure Report</td>
                                            <td>Report</td>
                                            <td><span class="badge bg-success">Completed</span></td>
                                        </tr>
                                        <tr>
                                            <td>2023-11-14 11:05</td>
                                            <td>HR Manager</td>
                                            <td>Updated teaching staff qualifications</td>
                                            <td>Update</td>
                                            <td><span class="badge bg-success">Completed</span></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>

    <!-- Footer -->
    <footer class="footer mt-auto py-3 bg-light">
        <div class="container">
            <div class="row">
                <div class="col-md-6">
                    <span class="text-muted">AJ&K Education Department &copy; 2023</span>
                </div>
                <div class="col-md-6 text-md-end">
                    <span class="text-muted">Version 2.1.0 | Admin Dashboard</span>
                </div>
            </div>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Initialize all message cards as collapsed
            const messageCards = document.querySelectorAll('.message-card');
            
            messageCards.forEach((card, index) => {
                // Add slight delay for staggered animation
                card.style.opacity = 0;
                card.style.transform = 'translateY(20px)';
                
                setTimeout(() => {
                    card.style.transition = 'opacity 0.5s, transform 0.5s';
                    card.style.opacity = 1;
                    card.style.transform = 'translateY(0)';
                }, 100 + (index * 100));
                
                // Add click event to toggle message content
                card.addEventListener('click', function(e) {
                    // Don't trigger if clicking on a link inside the card
                    if (e.target.tagName === 'A') return;
                    
                    const targetId = this.getAttribute('data-bs-target');
                    const content = document.querySelector(targetId);
                    const tags = document.querySelector(targetId + '-tags');
                    
                    // Toggle collapse using Bootstrap's built-in functionality
                    const bsCollapse = new bootstrap.Collapse(content, {
                        toggle: true
                    });
                    
                    if (tags) {
                        const bsTagsCollapse = new bootstrap.Collapse(tags, {
                            toggle: true
                        });
                    }
                    
                    // Toggle card class for styling
                    this.classList.toggle('collapsed');
                    this.classList.toggle('expanded');
                    
                    // Change the indicator icon
                    const indicator = this.querySelector('.expand-indicator i');
                    if (indicator.classList.contains('fa-chevron-down')) {
                        indicator.classList.remove('fa-chevron-down');
                        indicator.classList.add('fa-chevron-up');
                        this.querySelector('.expand-indicator').textContent = ' Click to collapse';
                        this.querySelector('.expand-indicator').prepend(indicator);
                    } else {
                        indicator.classList.remove('fa-chevron-up');
                        indicator.classList.add('fa-chevron-down');
                        this.querySelector('.expand-indicator').textContent = ' Click to expand';
                        this.querySelector('.expand-indicator').prepend(indicator);
                    }
                });
            });
            
            // View all messages link
            document.querySelector('.view-all-messages').addEventListener('click', function(e) {
                e.preventDefault();
                alert('This would navigate to a full messages inbox.');
            });
        });
    </script>
</body>
</html>