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

// ================= DATA VISI MISI =================
$query = mysqli_query($koneksi, "SELECT * FROM visi_misi WHERE id='1'");
$data = mysqli_fetch_assoc($query);

$visi = $data['visi'] ?? "Menjadikan perpustakaan dan arsip bekal ilmu dan materi pemerintahan serta sebagai bukti pertanggungjawaban";

$misi = $data['misi'] ?? "Menumbuhkembangkan minat baca masyarakat dan aparatur pemerintah Solok Selatan|Menumbuhkembangkan kepedulian terhadap pengelolaan kearsipan serta tanggung jawab untuk pelestarian|Meningkatkan sumber daya aparatur pengelola Perpustakaan dan Arsip|Menjamin pelestarian bukti-bukti kepemilikan aset daerah";

$misi_array = explode("|", $misi);

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

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)
    )
");

$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) 
        VALUES ('$ip', '$tanggal')
    ");
}

$totalVisitor = mysqli_fetch_assoc(mysqli_query($koneksi, "
    SELECT COUNT(DISTINCT ip_address) as total FROM visitor_counter
"))['total'];
?>

<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Visi & Misi | 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 ========== */
        .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-box {
            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-box:hover {
            transform: scale(1.05);
            background: rgba(255,255,255,0.25);
        }

        .logo-box img {
            width: 35px;
            height: 35px;
            object-fit: contain;
        }

        .logo-box 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 {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .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);
        }

        .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;
        }

        .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: 80px 20px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') repeat-x bottom;
            background-size: cover;
            opacity: 0.15;
        }

        .hero::after {
            content: "👁️";
            position: absolute;
            right: -30px;
            top: -30px;
            font-size: 180px;
            opacity: 0.08;
            transform: rotate(15deg);
        }

        .hero-content {
            position: relative;
            z-index: 2;
        }

        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: rgba(255,255,255,0.15);
            backdrop-filter: blur(10px);
            padding: 6px 18px;
            border-radius: 40px;
            font-size: 0.8rem;
            margin-bottom: 20px;
            color: #ffd966;
        }

        .hero h1 {
            font-size: 2.8rem;
            font-weight: 800;
            color: white;
            margin-bottom: 15px;
        }

        .hero h1 i {
            color: #f5c542;
            margin-right: 10px;
        }

        .hero p {
            max-width: 700px;
            margin: 0 auto;
            font-size: 1rem;
            color: rgba(255,255,255,0.9);
            line-height: 1.6;
        }

        /* ========== BREADCRUMB ========== */
        .breadcrumb {
            background: white;
            padding: 12px 40px;
            border-bottom: 1px solid #e2e8f0;
        }

        .breadcrumb .container {
            max-width: 1280px;
            margin: 0 auto;
        }

        .breadcrumb a {
            color: #1a5f4b;
            text-decoration: none;
            font-size: 14px;
        }

        .breadcrumb a:hover {
            text-decoration: underline;
        }

        .breadcrumb span {
            color: #94a3b8;
            font-size: 14px;
        }

        /* ========== MAIN CONTENT ========== */
        .container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 60px 20px;
        }

        /* ========== VISI CARD ========== */
        .visi-card {
            background: white;
            border-radius: 24px;
            padding: 50px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
            margin-bottom: 50px;
            transition: all 0.3s;
            border: 1px solid rgba(0,0,0,0.03);
        }

        .visi-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }

        .visi-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #dcfce7, #bbf7d0);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 25px;
        }

        .visi-icon i {
            font-size: 36px;
            color: #1a5f4b;
        }

        .visi-card h2 {
            font-size: 2rem;
            font-weight: 700;
            color: #1a5f4b;
            margin-bottom: 20px;
        }

        .visi-card p {
            font-size: 1.2rem;
            line-height: 1.8;
            color: #475569;
            max-width: 800px;
            margin: 0 auto;
        }

        /* ========== MISI SECTION ========== */
        .section-header {
            text-align: center;
            margin-bottom: 45px;
        }

        .section-header h2 {
            font-size: 2rem;
            font-weight: 700;
            color: #0f3b2c;
            margin-bottom: 10px;
        }

        .section-header p {
            color: #64748b;
            font-size: 1rem;
        }

        .section-header .line {
            width: 80px;
            height: 3px;
            background: linear-gradient(90deg, #f5c542, #1a5f4b);
            margin: 15px auto 0;
            border-radius: 3px;
        }

        /* Misi List */
        .misi-list {
            display: flex;
            flex-direction: column;
            gap: 25px;
        }

        .misi-item {
            background: white;
            padding: 30px 35px;
            border-radius: 20px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
            transition: all 0.3s;
            border: 1px solid rgba(0,0,0,0.03);
            display: flex;
            align-items: flex-start;
            gap: 20px;
        }

        .misi-item:hover {
            transform: translateX(8px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        }

        .misi-number {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #1a5f4b, #0f3b2c);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1.2rem;
            flex-shrink: 0;
        }

        .misi-content p {
            color: #475569;
            line-height: 1.8;
            font-size: 1rem;
        }

        /* ========== STATISTIK ========== */
        .stats-wrapper {
            background: linear-gradient(135deg, #1a5f4b, #0f3b2c);
            border-radius: 24px;
            padding: 40px;
            margin-top: 50px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 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;
        }

        /* ========== NILAI BUDAYA KERJA ========== */
        .values-section {
            background: white;
            border-radius: 24px;
            padding: 40px;
            margin-top: 40px;
            border: 1px solid rgba(0,0,0,0.03);
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        }

        .values-title {
            text-align: center;
            margin-bottom: 35px;
        }

        .values-title h3 {
            font-size: 1.5rem;
            font-weight: 700;
            color: #0f3b2c;
        }

        .values-title p {
            color: #64748b;
            margin-top: 10px;
        }

        .values-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 20px;
        }

        .value-item {
            text-align: center;
            padding: 20px;
            background: #f8fafc;
            border-radius: 16px;
            transition: all 0.3s;
            border: 1px solid #e2e8f0;
        }

        .value-item:hover {
            transform: translateY(-5px);
            border-color: #1a5f4b;
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        }

        .value-icon {
            width: 55px;
            height: 55px;
            background: #dcfce7;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 15px;
        }

        .value-icon i {
            font-size: 24px;
            color: #1a5f4b;
        }

        .value-item h4 {
            font-weight: 700;
            color: #1e293b;
            font-size: 0.95rem;
            margin-bottom: 5px;
        }

        .value-item p {
            font-size: 0.75rem;
            color: #64748b;
        }

        /* ========== FOOTER PREMIUM ========== */
        .footer-premium {
            background: linear-gradient(135deg, #0a3d32, #0f3b2c);
            color: #ffffff;
            position: relative;
            overflow: hidden;
            padding-top: 60px;
            margin-top: 60px;
        }

        .footer-premium::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #f5c542, #eab308, #f5c542);
        }

        .footer-premium::after {
            content: '📚';
            position: absolute;
            bottom: 20px;
            right: 20px;
            font-size: 120px;
            opacity: 0.03;
            pointer-events: none;
        }

        .footer-container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 20px;
        }

        .footer-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 35px;
            margin-bottom: 50px;
        }

        .footer-col h3 {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 25px;
            position: relative;
            display: inline-block;
            padding-bottom: 10px;
            color: #f5c542;
        }

        .footer-col h3::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 40px;
            height: 2px;
            background: #f5c542;
            border-radius: 2px;
        }

        .footer-logo {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
        }

        .footer-logo .logo-icon {
            width: 50px;
            height: 50px;
            background: rgba(255,255,255,0.1);
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .footer-logo .logo-icon i {
            font-size: 28px;
            color: #f5c542;
        }

        .footer-logo .logo-text h3 {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 4px;
            color: white;
        }

        .footer-logo .logo-text p {
            font-size: 0.7rem;
            opacity: 0.7;
            color: rgba(255,255,255,0.7);
        }

        .footer-description {
            color: #cbd5e1;
            line-height: 1.6;
            margin-bottom: 20px;
            font-size: 0.85rem;
        }

        .footer-menu {
            list-style: none;
        }

        .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);
        }

        .social-links {
            display: flex;
            gap: 12px;
            margin-top: 20px;
        }

        .social-icon {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: white;
            transition: all 0.3s;
            font-size: 1rem;
            text-decoration: none;
        }

        .social-fb { background: #1877f2; }
        .social-ig { background: #e4405f; }
        .social-yt { background: #ff0000; }
        .social-tt { background: #010101; }

        .social-icon:hover {
            transform: translateY(-3px);
            filter: brightness(1.1);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }

        .footer-contact-item {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 15px;
            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;
        }

        .footer-bottom {
            border-top: 1px solid rgba(255,255,255,0.08);
            padding-top: 25px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }

        .footer-bottom p {
            color: rgba(255,255,255,0.6);
            font-size: 0.75rem;
        }

        .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;
        }

        .dev-credit {
            text-align: center;
            padding-top: 20px;
            margin-top: 20px;
            border-top: 1px solid rgba(255,255,255,0.05);
            color: #94a3b8;
            font-size: 0.75rem;
        }

        .dev-credit a {
            color: #f5c542;
            text-decoration: none;
            font-weight: 500;
        }

        /* ========== RESPONSIVE ========== */
        @media (max-width: 992px) {
            .footer-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 30px;
            }
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .values-grid {
                grid-template-columns: repeat(3, 1fr);
            }
            .hero h1 {
                font-size: 2rem;
            }
        }

        @media (max-width: 768px) {
            .header {
                padding: 12px 20px;
            }
            .logo-text h2 {
                font-size: 0.8rem;
            }
            .logo-box {
                width: 40px;
                height: 40px;
            }
            .icon-btn {
                width: 38px;
                height: 38px;
                font-size: 1rem;
            }
            .hero {
                padding: 50px 20px 70px;
            }
            .hero h1 {
                font-size: 1.6rem;
            }
            .hero p {
                font-size: 0.85rem;
            }
            .breadcrumb {
                padding: 10px 20px;
            }
            .container {
                padding: 40px 15px;
            }
            .visi-card {
                padding: 30px 25px;
            }
            .visi-card h2 {
                font-size: 1.5rem;
            }
            .visi-card p {
                font-size: 1rem;
            }
            .misi-item {
                padding: 25px;
                flex-direction: column;
                align-items: center;
                text-align: center;
            }
            .misi-content p {
                font-size: 0.9rem;
            }
            .stats-grid {
                grid-template-columns: 1fr 1fr;
                gap: 20px;
            }
            .values-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .footer-grid {
                grid-template-columns: 1fr 1fr;
                gap: 30px;
            }
        }

        @media (max-width: 576px) {
            .header-actions {
                gap: 8px;
            }
            .icon-btn {
                width: 35px;
                height: 35px;
                font-size: 0.9rem;
            }
            .hero-badge {
                font-size: 0.7rem;
            }
            .visi-card {
                padding: 25px 20px;
            }
            .misi-item {
                padding: 20px;
            }
            .misi-number {
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }
            .stats-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }
            .values-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }
            .value-item {
                padding: 15px;
            }
            .footer-grid {
                grid-template-columns: 1fr;
                gap: 25px;
                text-align: center;
            }
            .footer-logo {
                justify-content: center;
            }
            .footer-col h3::after {
                left: 50%;
                transform: translateX(-50%);
            }
            .footer-menu li a {
                justify-content: center;
            }
            .social-links {
                justify-content: center;
            }
            .footer-contact-item {
                justify-content: center;
            }
            .footer-bottom {
                flex-direction: column;
                text-align: center;
            }
            .dev-credit {
                font-size: 0.65rem;
            }
        }
    </style>
</head>
<body>

<!-- ========== HEADER PREMIUM ========== -->
<div class="header">
    <div class="logo-area">
        <div class="logo-box">
            <?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="logo-text">
            <h2>DINAS KEARSIPAN<br>KABUPATEN SOLOK SELATAN</h2>
            <p>Dinas Perpustakaan dan Arsip Daerah</p>
        </div>
    </div>
    
    <div class="header-actions">
        <a href="dashboard.php" class="icon-btn">
            <i class="fas fa-home"></i>
            <span class="tooltip">Halaman Utama</span>
        </a>
        <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">
        <div class="hero-badge">
            <i class="fas fa-star"></i> Landasan Utama
        </div>
        <h1>
            <i class=""></i> 
            Visi & Misi
        </h1>
        <p>Landasan utama dalam mewujudkan pelayanan perpustakaan dan kearsipan yang unggul, modern, dan berbudaya di Kabupaten Solok Selatan</p>
    </div>
</section>

<!-- ========== BREADCRUMB ========== -->
<div class="breadcrumb">
    <div class="container">
        <a href="dashboard.php">Beranda</a> / <span>Visi & Misi</span>
    </div>
</div>

<!-- ========== MAIN CONTENT ========== -->
<div class="container">
    
    <!-- ===== VISI ===== -->
    <div class="visi-card" data-aos="fade-up">
        <div class="visi-icon">
            <i class="fas fa-eye"></i>
        </div>
        <h2>Visi</h2>
        <p><?php echo htmlspecialchars($visi); ?></p>
    </div>

    <!-- ===== MISI ===== -->
    <div class="section-header" data-aos="fade-up">
        <h2>Misi</h2>
        <p>Pilar utama dalam mencapai visi yang telah ditetapkan</p>
        <div class="line"></div>
    </div>

    <div class="misi-list">
        <?php 
        $misi_icons = ['fa-flag', 'fa-bullseye', 'fa-rocket', 'fa-star'];
        foreach($misi_array as $index => $item): 
            if(trim($item) == "") continue;
            $icon = $misi_icons[$index % count($misi_icons)];
        ?>
        <div class="misi-item" data-aos="fade-up" data-aos-delay="<?php echo 100 + ($index * 50); ?>">
            <div class="misi-number">
                <?php echo $index + 1; ?>
            </div>
            <div class="misi-content">
                <p><?php echo htmlspecialchars(trim($item)); ?></p>
            </div>
        </div>
        <?php endforeach; ?>
    </div>

    <!-- ===== NILAI BUDAYA KERJA ===== -->
    <div class="values-section" data-aos="fade-up">
        <div class="values-title">
            <h3><i class="fas fa-heart" style="color: #f5c542; margin-right: 10px;"></i> Nilai Budaya Kerja</h3>
            <p>Landasan dalam memberikan pelayanan terbaik kepada masyarakat</p>
        </div>
        <div class="values-grid">
            <div class="value-item">
                <div class="value-icon"><i class="fas fa-handshake"></i></div>
                <h4>Integritas</h4>
                <p>Bertindak jujur dan bertanggung jawab</p>
            </div>
            <div class="value-item">
                <div class="value-icon"><i class="fas fa-rocket"></i></div>
                <h4>Inovatif</h4>
                <p>Terbuka terhadap perubahan positif</p>
            </div>
            <div class="value-item">
                <div class="value-icon"><i class="fas fa-users"></i></div>
                <h4>Kolaboratif</h4>
                <p>Bekerja sama untuk hasil terbaik</p>
            </div>
            <div class="value-item">
                <div class="value-icon"><i class="fas fa-chart-line"></i></div>
                <h4>Akuntabel</h4>
                <p>Transparan dan terukur</p>
            </div>
            <div class="value-item">
                <div class="value-icon"><i class="fas fa-leaf"></i></div>
                <h4>Berkelanjutan</h4>
                <p>Berorientasi masa depan</p>
            </div>
        </div>
    </div>

</div>

<!-- ========== FOOTER PREMIUM ========== -->
<footer class="footer-premium">
    <div class="footer-container">
        <div class="footer-grid">
            <div class="footer-col" data-aos="fade-up">
                <div class="footer-logo">
                    <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">
                        <h3>Dinas Kearsipan Solok Selatan</h3>
                        <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>

            <div class="footer-col" data-aos="fade-up" data-aos-delay="100">
                <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</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>

            <div class="footer-col" data-aos="fade-up" data-aos-delay="200">
                <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>

            <div class="footer-col" data-aos="fade-up" data-aos-delay="300">
                <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>

        <div class="footer-bottom">
            <div>
                <p>&copy; <?php echo date('Y'); ?> Dinas Perpustakaan dan Arsip Daerah Kabupaten Solok Selatan</p>
                <p style="margin-top: 5px;">All Rights Reserved | <a>Kebijakan Privasi</a> | <a>Sitemap</a></p>
            </div>
            <div>
                <p>Sistem Informasi Perpustakaan dan Arsip Daerah</p>
                <div class="visitor-badge">
                    <i class="fas fa-eye"></i> <?php echo number_format($totalVisitor); ?> Pengunjung
                </div>
            </div>
        </div>
        
        <div class="dev-credit">
            Developed by <a href="https://www.pnp.ac.id/download/psdku-solok-selatan/" target="_blank">PSDKU Solok Selatan</a>
        </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,
        easing: 'ease-in-out'
    });
</script>

<?php if(isset($_SESSION['admin'])): ?>
<!-- Tombol Edit (Khusus Admin) -->
<div style="position: fixed; bottom: 20px; right: 20px; z-index: 1000;">
    <a href="admin/edit_visi_misi.php" style="background: #1a5f4b; color: white; padding: 12px 20px; border-radius: 40px; text-decoration: none; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);">
        <i class="fas fa-edit"></i> Edit Visi & Misi
    </a>
</div>
<?php endif; ?>

</body>
</html>