<?php
session_start();
include 'koneksi.php';

// ========== HIT COUNTER PENGUNJUNG OTOMATIS ==========
$ip = $_SERVER['REMOTE_ADDR'];
$tanggal = date('Y-m-d');

// Buat tabel visitor_counter jika belum ada
mysqli_query($koneksi, "
    CREATE TABLE IF NOT EXISTS visitor_counter (
        id INT AUTO_INCREMENT PRIMARY KEY,
        ip_address VARCHAR(100),
        tanggal DATE,
        user_agent VARCHAR(255),
        last_visit TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    )
");

// Cek apakah IP sudah tercatat hari ini
$cek = mysqli_query($koneksi, "
    SELECT * FROM visitor_counter 
    WHERE ip_address = '$ip' AND tanggal = '$tanggal'
");

if(mysqli_num_rows($cek) == 0){
    mysqli_query($koneksi, "
        INSERT INTO visitor_counter (ip_address, tanggal, user_agent) 
        VALUES ('$ip', '$tanggal', '{$_SERVER['HTTP_USER_AGENT']}')
    ");
} else {
    // Update last_visit jika sudah ada
    mysqli_query($koneksi, "
        UPDATE visitor_counter 
        SET last_visit = NOW() 
        WHERE ip_address = '$ip' AND tanggal = '$tanggal'
    ");
}

// Hitung total pengunjung unik (semua waktu)
$totalVisitor = 0;
$query_total_visitor = mysqli_query($koneksi, "SELECT COUNT(DISTINCT ip_address) as total FROM visitor_counter");
if($query_total_visitor && mysqli_num_rows($query_total_visitor) > 0){
    $row = mysqli_fetch_assoc($query_total_visitor);
    $totalVisitor = $row['total'];
}

// Hitung pengunjung hari ini
$hariIni = 0;
$query_hari = mysqli_query($koneksi, "SELECT COUNT(DISTINCT ip_address) as total FROM visitor_counter WHERE tanggal = '$tanggal'");
if($query_hari && mysqli_num_rows($query_hari) > 0){
    $row = mysqli_fetch_assoc($query_hari);
    $hariIni = $row['total'];
}

// Hitung pengunjung online (15 menit terakhir)
$batas_online = date('Y-m-d H:i:s', strtotime('-15 minutes'));
$online = 0;
$query_online = mysqli_query($koneksi, "SELECT COUNT(DISTINCT ip_address) as total FROM visitor_counter WHERE last_visit > '$batas_online'");
if($query_online && mysqli_num_rows($query_online) > 0){
    $row = mysqli_fetch_assoc($query_online);
    $online = $row['total'];
}

// ========== QUERY ARSIP DINAMIS ==========
$query_total = mysqli_query($koneksi, "SELECT COUNT(*) as total FROM arsip_dinamis");
$totalArsip = 0;

// Cek apakah query berhasil
if($query_total && mysqli_num_rows($query_total) > 0){
    $row = mysqli_fetch_assoc($query_total);
    $totalArsip = $row['total'];
} else {
    // Jika tabel belum ada, buat tabel terlebih dahulu
    mysqli_query($koneksi, "
        CREATE TABLE IF NOT EXISTS arsip_dinamis (
            id INT AUTO_INCREMENT PRIMARY KEY,
            judul VARCHAR(200),
            nomor VARCHAR(100),
            tahun YEAR,
            created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
        )
    ");
}
?>

<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
    <title>Layanan Arsip Dinamis | DPAD Solok Selatan</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css">
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
    
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Inter', sans-serif;
            background: #f5f7fb;
            color: #1e293b;
        }
        
        /* Header Premium dengan Icon */
        .header {
            background: linear-gradient(135deg, #0a3d32, #1a5f4b);
            padding: 15px 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }
        
        .logo-area {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .logo-icon {
            width: 50px;
            height: 50px;
            background: rgba(255,255,255,0.15);
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: 0.3s;
        }
        
        .logo-icon:hover {
            transform: scale(1.05);
            background: rgba(255,255,255,0.25);
        }
        
        .logo-icon i {
            font-size: 26px;
            color: #f5c542;
        }
        
        .logo-text h2 {
            color: white;
            font-size: 1rem;
            font-weight: 700;
            line-height: 1.3;
        }
        
        .logo-text p {
            color: rgba(255,255,255,0.7);
            font-size: 0.65rem;
            margin-top: 3px;
        }
        
        /* Header Actions - Icon Buttons */
        .header-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        /* Icon Button dengan Tooltip */
        .icon-btn {
            position: relative;
            background: rgba(255,255,255,0.12);
            backdrop-filter: blur(10px);
            color: white;
            width: 42px;
            height: 42px;
            border-radius: 50%;
            text-decoration: none;
            font-size: 1.2rem;
            transition: all 0.3s;
            border: 1px solid rgba(255,255,255,0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
        
        .icon-btn:hover {
            background: white;
            color: #1a5f4b;
            transform: translateY(-3px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        
        /* Tooltip Text */
        .icon-btn .tooltip {
            position: absolute;
            bottom: -40px;
            left: 50%;
            transform: translateX(-50%);
            background: #1e293b;
            color: white;
            padding: 6px 12px;
            border-radius: 8px;
            font-size: 0.7rem;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s;
            z-index: 100;
            pointer-events: none;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        }
        
        .icon-btn .tooltip::before {
            content: '';
            position: absolute;
            top: -5px;
            left: 50%;
            transform: translateX(-50%);
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            border-bottom: 5px solid #1e293b;
        }
        
        .icon-btn:hover .tooltip {
            opacity: 1;
            visibility: visible;
            bottom: -35px;
        }
        
        /* Hero Section */
        .hero {
            background: linear-gradient(135deg, #1a5f4b 0%, #0f3b2c 100%);
            padding: 60px 20px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .hero h1 {
            font-size: 2.5rem;
            font-weight: 800;
            color: white;
            margin-bottom: 15px;
        }
        
        .hero p {
            max-width: 700px;
            margin: 0 auto;
            font-size: 1rem;
            color: rgba(255,255,255,0.9);
            line-height: 1.6;
        }
        
        /* Container */
        .container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 60px 20px;
        }
        
        /* Card Style */
        .card {
            background: white;
            border-radius: 24px;
            padding: 35px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
            transition: 0.3s;
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        
        .card h2 {
            font-size: 1.5rem;
            color: #0f3b2c;
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 2px solid #f5c542;
            display: inline-block;
        }
        
        .card h3 {
            font-size: 1.2rem;
            color: #1a5f4b;
            margin: 20px 0 12px;
        }
        
        .card p {
            color: #475569;
            line-height: 1.7;
            margin-bottom: 15px;
        }
        
        /* Grid untuk 2 kolom */
        .grid-2 {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 30px;
            margin: 30px 0;
        }
        
        /* Feature Box */
        .feature-box {
            background: #f8fafc;
            border-radius: 16px;
            padding: 25px;
            transition: 0.3s;
            border: 1px solid #e2e8f0;
        }
        
        .feature-box:hover {
            transform: translateY(-5px);
            border-color: #f5c542;
            background: white;
        }
        
        .feature-box h4 {
            font-size: 1.1rem;
            margin-bottom: 10px;
            color: #0f3b2c;
        }
        
        .feature-box p {
            font-size: 0.9rem;
            color: #64748b;
            line-height: 1.6;
        }
        
        .feature-box .contoh {
            margin-top: 10px;
            font-size: 0.8rem;
            color: #1a5f4b;
            font-style: italic;
        }
        
        /* List Style */
        .list-style {
            list-style: none;
            padding-left: 0;
        }
        
        .list-style li {
            padding: 10px 0;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .list-style li strong {
            color: #0f3b2c;
            min-width: 180px;
        }
        
        .list-style li span {
            color: #475569;
        }
        
        /* Step Container */
        .step-container {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin: 20px 0;
        }
        
        .step-box {
            text-align: center;
            padding: 20px;
            background: #f8fafc;
            border-radius: 16px;
        }
        
        .step-number {
            width: 40px;
            height: 40px;
            background: #1a5f4b;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 12px;
            font-weight: 700;
            font-size: 1.2rem;
        }
        
        .step-box h4 {
            margin-bottom: 8px;
            color: #0f3b2c;
        }
        
        .step-box p {
            font-size: 0.85rem;
            color: #64748b;
        }
        
        /* Tabel Informasi */
        .info-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }
        
        .info-table tr {
            border-bottom: 1px solid #e2e8f0;
        }
        
        .info-table th {
            background: #f1f5f9;
            padding: 14px 18px;
            text-align: left;
            font-weight: 600;
            color: #0f3b2c;
            width: 30%;
        }
        
        .info-table td {
            padding: 14px 18px;
            color: #475569;
        }
        
        /* Statistik */
        .stats-wrapper {
            background: linear-gradient(135deg, #1a5f4b, #0f3b2c);
            border-radius: 24px;
            padding: 40px;
            margin-top: 40px;
        }
        
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 30px;
            text-align: center;
        }
        
        .stats-item h3 {
            font-size: 2rem;
            font-weight: 800;
            color: #f5c542;
            margin-bottom: 5px;
        }
        
        .stats-item p {
            color: rgba(255,255,255,0.8);
            font-size: 0.85rem;
        }
        
        /* Button Kembali Footer */
        .back-button-wrapper {
            text-align: center;
            margin-top: 30px;
        }
        
        .btn-back-footer {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: #1a5f4b;
            color: white;
            padding: 12px 28px;
            border-radius: 40px;
            text-decoration: none;
            font-weight: 500;
            transition: 0.3s;
        }
        
        .btn-back-footer:hover {
            background: #0f3b2c;
            transform: translateX(-5px);
        }
        
        /* ======================================== */
        /* FOOTER PREMIUM - DENGAN LOGO YANG DIPERBAIKI */
        /* ======================================== */
        .footer {
            background: linear-gradient(135deg, #0a3d32, #0f3b2c);
            color: #ffffff;
            position: relative;
            overflow: hidden;
            padding: 60px 20px 30px;
            margin-top: 60px;
        }
        
        .footer::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #f5c542, #eab308, #f5c542);
        }
        
        .footer-container {
            max-width: 1280px;
            margin: 0 auto;
        }
        
        .footer-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 35px;
            margin-bottom: 50px;
        }
        
        /* ========== LOGO FOOTER YANG DIPERBAIKI ========== */
        .footer-logo {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .footer-logo-icon {
            width: 55px;
            height: 55px;
            background: linear-gradient(135deg, rgba(245, 197, 66, 0.2), rgba(245, 197, 66, 0.05));
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            border: 2px solid rgba(245, 197, 66, 0.3);
            overflow: hidden;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(245, 197, 66, 0.1);
        }
        
        .footer-logo-icon:hover {
            transform: scale(1.05) rotate(-3deg);
            border-color: #f5c542;
            box-shadow: 0 8px 25px rgba(245, 197, 66, 0.25);
        }
        
        .footer-logo-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 8px;
            border-radius: 12px;
        }
        
        .footer-logo-icon i {
            font-size: 28px;
            color: #f5c542;
            text-shadow: 0 0 20px rgba(245, 197, 66, 0.3);
        }
        
        .footer-logo-text {
            display: flex;
            flex-direction: column;
        }
        
        .footer-logo-text h2 {
            color: white;
            font-size: 1.1rem;
            font-weight: 700;
            line-height: 1.2;
            letter-spacing: 0.5px;
        }
        
        .footer-logo-text h2:first-child {
            color: #f5c542;
        }
        
        .footer-logo-text p {
            color: rgba(255, 255, 255, 0.6);
            font-size: 0.7rem;
            margin-top: 3px;
            letter-spacing: 0.3px;
        }
        
        .footer-description {
            color: #cbd5e1;
            line-height: 1.7;
            margin-bottom: 20px;
            font-size: 0.85rem;
        }
        
        /* Social Media */
        .footer-social {
            display: flex;
            gap: 12px;
            margin-top: 20px;
            flex-wrap: wrap;
        }
        
        .social-icon {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: white;
            transition: all 0.3s;
            text-decoration: none;
            font-size: 0.9rem;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .social-fb { background: #1877f2; }
        .social-ig { background: linear-gradient(45deg, #f09433, #d62976, #962fbf); }
        .social-yt { background: #ff0000; }
        .social-tt { background: #010101; }
        
        .social-icon:hover {
            transform: translateY(-4px) scale(1.05);
            filter: brightness(1.15);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
            border-color: rgba(255, 255, 255, 0.3);
        }
        
        /* Kolom Menu */
        .footer-col h3 {
            color: #f5c542;
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 25px;
            position: relative;
            display: inline-block;
            padding-bottom: 10px;
        }
        
        .footer-col h3::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 40px;
            height: 2px;
            background: #f5c542;
            border-radius: 2px;
        }
        
        .footer-col h3 i {
            margin-right: 8px;
        }
        
        .footer-menu {
            list-style: none;
            padding: 0;
        }
        
        .footer-menu li {
            margin-bottom: 12px;
        }
        
        .footer-menu li a {
            color: #cbd5e1;
            text-decoration: none;
            transition: all 0.3s;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            font-size: 0.85rem;
        }
        
        .footer-menu li a i {
            width: 20px;
            font-size: 0.8rem;
            color: #f5c542;
        }
        
        .footer-menu li a:hover {
            color: #f5c542;
            transform: translateX(8px);
        }
        
        /* Kolom Kontak */
        .footer-contact-item {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 18px;
            color: #cbd5e1;
            font-size: 0.85rem;
        }
        
        .footer-contact-item i {
            width: 35px;
            height: 35px;
            background: rgba(245, 197, 66, 0.12);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #f5c542;
            font-size: 0.9rem;
            flex-shrink: 0;
        }
        
        /* Bottom Footer */
        .footer-bottom {
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 25px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .footer-copyright p {
            font-size: 0.75rem;
            color: #94a3b8;
            margin-bottom: 5px;
        }
        
        .footer-copyright a {
            color: #94a3b8;
            text-decoration: none;
            transition: 0.3s;
        }
        
        .footer-copyright a:hover {
            color: #f5c542;
        }
        
        .footer-credit {
            text-align: right;
        }
        
        .footer-credit p {
            font-size: 0.7rem;
            color: #64748b;
            margin-bottom: 5px;
        }
        
        .visitor-stats {
            display: flex;
            gap: 15px;
            justify-content: flex-end;
            margin-top: 8px;
            flex-wrap: wrap;
        }
        
        .visitor-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(255, 255, 255, 0.08);
            padding: 5px 12px;
            border-radius: 30px;
            font-size: 0.7rem;
            color: #f5c542;
        }
        
        .footer-dev {
            text-align: center;
            margin-top: 25px;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            font-size: 0.7rem;
            color: #64748b;
        }
        
        .footer-dev a {
            color: #f5c542;
            text-decoration: none;
        }
        
        /* ========== RESPONSIVE ========== */
        @media (max-width: 1200px) {
            .container {
                padding: 50px 20px;
            }
            .card {
                padding: 30px;
            }
        }
        
        @media (max-width: 992px) {
            .step-container {
                grid-template-columns: repeat(2, 1fr);
            }
            .footer-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 35px;
            }
            .hero h1 {
                font-size: 2rem;
            }
        }
        
        @media (max-width: 768px) {
            .header {
                padding: 12px 20px;
                flex-wrap: wrap;
            }
            .logo-text h2 {
                font-size: 0.8rem;
            }
            .logo-icon {
                width: 40px;
                height: 40px;
            }
            .icon-btn {
                width: 38px;
                height: 38px;
                font-size: 1rem;
            }
            .hero {
                padding: 40px 20px;
            }
            .hero h1 {
                font-size: 1.6rem;
            }
            .hero p {
                font-size: 0.9rem;
            }
            .grid-2 {
                grid-template-columns: 1fr;
                gap: 20px;
            }
            .step-container {
                grid-template-columns: 1fr;
            }
            .stats-grid {
                grid-template-columns: 1fr;
                gap: 20px;
            }
            .card {
                padding: 25px;
            }
            .card h2 {
                font-size: 1.3rem;
            }
            .info-table th, .info-table td {
                padding: 10px 12px;
                font-size: 0.85rem;
                display: block;
                width: 100%;
            }
            .info-table tr {
                display: block;
                margin-bottom: 15px;
                border: 1px solid #e2e8f0;
            }
            .list-style li {
                flex-direction: column;
                gap: 5px;
            }
            .list-style li strong {
                min-width: auto;
            }
            
            /* Footer Responsive */
            .footer {
                padding: 45px 20px 25px;
            }
            .footer-grid {
                grid-template-columns: 1fr;
                gap: 35px;
                text-align: center;
            }
            .footer-logo {
                justify-content: center;
            }
            .footer-logo-text {
                text-align: left;
            }
            .footer-logo-text h2 {
                font-size: 0.95rem;
            }
            .footer-logo-icon {
                width: 48px;
                height: 48px;
            }
            .footer-logo-icon i {
                font-size: 24px;
            }
            .footer-col h3::after {
                left: 50%;
                transform: translateX(-50%);
            }
            .footer-menu li a {
                justify-content: center;
            }
            .footer-social {
                justify-content: center;
            }
            .footer-contact-item {
                justify-content: center;
            }
            .footer-description {
                text-align: center;
            }
            .footer-bottom {
                flex-direction: column;
                text-align: center;
            }
            .footer-credit {
                text-align: center;
            }
            .visitor-stats {
                justify-content: center;
            }
        }
        
        @media (max-width: 480px) {
            .header-actions {
                gap: 8px;
            }
            .icon-btn {
                width: 35px;
                height: 35px;
                font-size: 0.9rem;
            }
            .hero h1 {
                font-size: 1.4rem;
            }
            .card {
                padding: 20px;
            }
            .footer-logo-icon {
                width: 42px;
                height: 42px;
            }
            .footer-logo-icon i {
                font-size: 20px;
            }
            .footer-contact-item {
                font-size: 0.75rem;
            }
            .visitor-badge {
                font-size: 0.65rem;
            }
            .footer-logo-text h2 {
                font-size: 0.85rem;
            }
            .footer-logo-text p {
                font-size: 0.6rem;
            }
        }
    </style>
</head>
<body>

<!-- HEADER PREMIUM DENGAN ICON DAN TOOLTIP -->
<div class="header">
    <div class="logo-area">
        <div class="logo-icon">
            <?php if(file_exists("img/logo.png")): ?>
                <img src="img/logo.png" style="width:35px; height:35px; object-fit:contain;">
            <?php else: ?>
                <i class="fas fa-archive"></i>
            <?php endif; ?>
        </div>
        <div class="logo-text">
            <h2>DINAS KEARSIPAN<br>KABUPATEN SOLOK SELATAN</h2>
            <p>Dinas Perpustakaan dan Arsip Daerah</p>
        </div>
    </div>
    
    <div class="header-actions">
        <!-- Icon Home dengan Tooltip -->
        <a href="dashboard.php" class="icon-btn">
            <i class="fas fa-home"></i>
            <span class="tooltip">Halaman Utama</span>
        </a>
        
        <!-- Icon Arsip dengan Tooltip -->
        <a href="layanan_arsip.php" class="icon-btn">
            <i class="fas fa-archive"></i>
            <span class="tooltip">Layanan Arsip</span>
        </a>
        
        <!-- Icon Kembali dengan Tooltip -->
        <a href="javascript:history.back()" class="icon-btn">
            <i class="fas fa-arrow-left"></i>
            <span class="tooltip">Kembali</span>
        </a>
    </div>
</div>

<!-- HERO SECTION -->
<section class="hero">
    <div class="hero-content" data-aos="fade-up">
        <h1>Layanan Arsip Dinamis</h1>
        <p>Pengelolaan arsip yang masih sering digunakan dalam kegiatan administrasi sehari-hari</p>
    </div>
</section>

<div class="container">
    
    <!-- PENGERTIAN ARSIP DINAMIS -->
    <div class="card" data-aos="fade-up">
        <h2>Apa itu Arsip Dinamis?</h2>
        <p><strong>Arsip Dinamis</strong> adalah arsip yang masih digunakan secara langsung dalam kegiatan administrasi perkantoran sehari-hari. Arsip ini bersifat dinamis karena informasi yang terkandung di dalamnya masih diperlukan untuk menunjang pelaksanaan tugas dan fungsi organisasi.</p>
        <p>Menurut Undang-Undang Nomor 43 Tahun 2009 tentang Kearsipan, arsip dinamis dibagi menjadi dua jenis, yaitu arsip aktif dan arsip inaktif.</p>
    </div>

    <!-- JENIS-JENIS ARSIP DINAMIS -->
    <div class="card" data-aos="fade-up">
        <h2>Jenis Arsip Dinamis</h2>
        <div class="grid-2">
            <div class="feature-box">
                <h4>Arsip Aktif</h4>
                <p>Arsip yang masih sering digunakan dan diperlukan secara langsung dalam proses kegiatan perkantoran. Biasanya disimpan di unit pengolah untuk memudahkan akses cepat.</p>
                <div class="contoh">Contoh: Surat masuk, surat keluar, nota dinas</div>
            </div>
            <div class="feature-box">
                <h4>Arsip Inaktif</h4>
                <p>Arsip yang frekuensi penggunaannya sudah menurun dan tidak lagi digunakan secara langsung, tetapi masih diperlukan untuk referensi di masa depan.</p>
                <div class="contoh">Contoh: Laporan tahunan, dokumen proyek yang sudah selesai</div>
            </div>
        </div>
    </div>

    <!-- KARAKTERISTIK ARSIP DINAMIS -->
    <div class="card" data-aos="fade-up">
        <h2>Karakteristik Arsip Dinamis</h2>
        <div class="grid-2">
            <div>
                <ul class="list-style">
                    <li><strong>Masih digunakan aktif</strong><span>Diperlukan untuk operasional sehari-hari</span></li>
                    <li><strong>Periode retensi tertentu</strong><span>Memiliki jadwal retensi arsip (JRA)</span></li>
                    <li><strong>Disimpan di unit pengolah</strong><span>Dekat dengan pengguna untuk akses mudah</span></li>
                </ul>
            </div>
            <div>
                <ul class="list-style">
                    <li><strong>Memiliki nilai guna</strong><span>Baik nilai guna primer maupun sekunder</span></li>
                    <li><strong>Memerlukan pengelolaan</strong><span>Butuh sistem klasifikasi yang baik</span></li>
                    <li><strong>Mudah dipindahkan</strong><span>Dapat dipindah ke unit kearsipan</span></li>
                </ul>
            </div>
        </div>
    </div>

    <!-- SIKLUS PENGELOLAAN -->
    <div class="card" data-aos="fade-up">
        <h2>Siklus Pengelolaan Arsip Dinamis</h2>
        <div class="step-container">
            <div class="step-box">
                <div class="step-number">1</div>
                <h4>Penciptaan</h4>
                <p>Arsip dibuat melalui kegiatan surat-menyurat atau pembuatan dokumen</p>
            </div>
            <div class="step-box">
                <div class="step-number">2</div>
                <h4>Penggunaan</h4>
                <p>Arsip digunakan untuk mendukung kegiatan operasional</p>
            </div>
            <div class="step-box">
                <div class="step-number">3</div>
                <h4>Pemeliharaan</h4>
                <p>Arsip dipelihara agar tetap terjaga keutuhannya</p>
            </div>
            <div class="step-box">
                <div class="step-number">4</div>
                <h4>Penyusutan</h4>
                <p>Arsip yang sudah tidak digunakan akan disusutkan</p>
            </div>
        </div>
    </div>

    <!-- LAYANAN YANG DIBERIKAN -->
    <div class="card" data-aos="fade-up">
        <h2>Layanan Arsip Dinamis di DPAD</h2>
        <table class="info-table">
            <tr>
                <th>Layanan</th>
                <td>Penyimpanan, pemeliharaan, dan pelayanan arsip dinamis instansi pemerintah</td>
            </tr>
            <tr>
                <th>Jenis Arsip</th>
                <td>Surat menyurat, dokumen kepegawaian, laporan, dan dokumen administrasi lainnya</td>
            </tr>
            <tr>
                <th>Waktu Layanan</th>
                <td>Senin - Jumat, 08:00 - 16:00 WIB</td>
            </tr>
            <tr>
                <th>Persyaratan</th>
                <td>Surat pengantar dari instansi, KTP, dan mengisi formulir peminjaman arsip</td>
            </tr>
            <tr>
                <th>Biaya</th>
                <td>GRATIS (tidak dipungut biaya)</td>
            </tr>
        </table>
    </div>

    <!-- DASAR HUKUM -->
    <div class="card" data-aos="fade-up">
        <h2>Dasar Hukum</h2>
        <ul class="list-style">
            <li><strong>UU No. 43 Tahun 2009</strong><span>Tentang Kearsipan</span></li>
            <li><strong>PP No. 28 Tahun 2012</strong><span>Tentang Pelaksanaan UU Kearsipan</span></li>
            <li><strong>Perka ANRI No. 6 Tahun 2014</strong><span>Tentang Jadwal Retensi Arsip Dinamis</span></li>
            <li><strong>Peraturan Daerah Solok Selatan</strong><span>Tentang Pengelolaan Arsip Daerah</span></li>
        </ul>
    </div>

    <!-- STATISTIK -->
    <div class="stats-wrapper" data-aos="fade-up">
        <div class="stats-grid">
            <div class="stats-item">
                <h3><?php echo number_format($totalArsip > 0 ? $totalArsip : 12500); ?></h3>
                <p>Arsip Dinamis Terkelola</p>
            </div>
            <div class="stats-item">
                <h3>50+</h3>
                <p>Instansi Pengguna</p>
            </div>
            <div class="stats-item">
                <h3>100%</h3>
                <p>Tingkat Akurasi Arsip</p>
            </div>
        </div>
    </div>
</div>

<!-- ======================================== -->
<!-- FOOTER PREMIUM - DENGAN LOGO YANG DIPERBAIKI -->
<!-- ======================================== -->
<footer class="footer">
    <div class="footer-container">
        <div class="footer-grid">
            
            <!-- Kolom 1: Logo & Deskripsi -->
            <div class="footer-col">
                <div class="footer-logo">
                    <div class="footer-logo-icon">
                        <?php if(file_exists("img/logo.png")): ?>
                            <img src="img/logo.png" alt="Logo DPAD">
                        <?php else: ?>
                            <i class="fas fa-archive"></i>
                        <?php endif; ?>
                    </div>
                    <div class="footer-logo-text">
                        <h2>Dinas Kearsipan</h2>
                        <h2>Solok Selatan</h2>
                        <p>Dinas Perpustakaan & Arsip Daerah</p>
                    </div>
                </div>
                <p class="footer-description">
                    Melestarikan sejarah, menjaga arsip, dan membangun peradaban literasi untuk masyarakat Solok Selatan yang cerdas dan berbudaya.
                </p>
                <div class="social-links">
                    <a href="https://www.facebook.com/profile.php?id=61573699960407" class="social-icon social-fb"><i class="fab fa-facebook-f"></i></a>
                    <a href="https://www.instagram.com/arsip_solsel/" class="social-icon social-ig" target="_blank"><i class="fab fa-instagram"></i></a>
                    <a href="https://www.youtube.com/@pustakadpksolsel" class="social-icon social-yt"><i class="fab fa-youtube"></i></a>
                    <a href="https://www.tiktok.com/@solselnews" class="social-icon social-tt"><i class="fab fa-tiktok"></i></a>
                </div>
            </div>

            <!-- Kolom 2: Menu Cepat -->
            <div class="footer-col">
                <h3><i class="fas fa-link"></i> Menu Cepat</h3>
                <ul class="footer-menu">
                    <li><a href="dashboard.php"><i class="fas fa-home"></i> Beranda</a></li>
                    <li><a href="profil_istansi.php"><i class="fas fa-building"></i> Profil Instansi</a></li>
                    <li><a href="visi.php"><i class="fas fa-eye"></i> Visi & Misi</a></li>
                    <li><a href="struktur.php"><i class="fas fa-diagram-project"></i> Struktur Organisasi</a></li>
                    <li><a href="berita.php"><i class="fas fa-newspaper"></i> Berita</a></li>
                </ul>
            </div>

            <!-- Kolom 3: Layanan -->
            <div class="footer-col">
                <h3><i class="fas fa-star"></i> Layanan</h3>
                <ul class="footer-menu">
                    <li><a href="https://perpustakaan.solselkab.go.id/read/166/bidang-kearsipan"><i class="fas fa-book"></i> Perpustakaan</a></li>
                    <li><a href="layanan_arsip.php"><i class="fas fa-archive"></i> Kearsipan</a></li>
                    <li><a href="layanan_kunjungan.php"><i class="fas fa-users"></i> Kunjungan Edukasi</a></li>
                    <li><a href="layanan_konsultasi.php"><i class="fas fa-comments"></i> Konsultasi Arsip</a></li>
                    <li><a href="pengaduan.php"><i class="fas fa-headset"></i> Pengaduan Masyarakat</a></li>
                </ul>
            </div>

            <!-- Kolom 4: Lokasi & Kontak -->
            <div class="footer-col">
                <h3><i class="fas fa-map-marker-alt"></i> Lokasi & Kontak</h3>
                <div class="footer-contact-item"><i class="fas fa-map-marker-alt"></i><span>Jl. Lubuk Gadang - Simpang Tigo Rimbo Tangah, Sangir, Solok Selatan</span></div>
                <div class="footer-contact-item"><i class="fas fa-envelope"></i><span>pustaka.arsipsolsel@gmail.com</span></div>
                <div class="footer-contact-item"><i class="fas fa-clock"></i><span>Senin - Jumat, 08:00 - 16:00 WIB</span></div>
            </div>
        </div>

        <!-- Footer Bottom -->
        <div class="footer-bottom">
            <div class="footer-copyright">
                <p>&copy; <?php echo date('Y'); ?> Dinas Perpustakaan dan Arsip Daerah Kabupaten Solok Selatan</p>
                <p>All Rights Reserved | <a href="privacy.php">Kebijakan Privasi</a> | <a href="sitemap.php">Sitemap</a></p>
            </div>
            <div class="footer-credit">
                <p>Sistem Informasi Perpustakaan dan Arsip Daerah</p>
                <div class="visitor-stats">
                    <div class="visitor-badge"><i class="fas fa-globe"></i> <?php echo number_format($totalVisitor); ?> Total</div>
                    <div class="visitor-badge"><i class="fas fa-calendar-day"></i> <?php echo number_format($hariIni); ?> Hari ini</div>
                    <div class="visitor-badge"><i class="fas fa-circle" style="color: #4ade80; font-size: 0.6rem;"></i> <?php echo $online; ?> Online</div>
                </div>
            </div>
        </div>
        
        <!-- Footer Dev -->
        <div class="footer-dev">
            <p>Developed by <a href="https://www.pnp.ac.id/download/psdku-solok-selatan/">PSDKU Solok Selatan</a></p>
        </div>
    </div>
</footer>

<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script>
    AOS.init({
        duration: 800,
        once: true,
        offset: 50
    });
</script>
</body>
</html>