<!DOCTYPE html>
<html lang="id">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Prestasi Siswa - SMK Muhammadiyah 1 Berbek</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">
    <link
        href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap"
        rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
    <link rel="shortcut icon" href="{{ asset('images/logo-single.png') }}" type="image/x-icon">

    <style>
        :root {
            --primary: #0066cc;
            --primary-dark: #004d99;
            --primary-light: #4d94ff;
            --secondary: #00a8ff;
            --success: #2ecc71;
            --warning: #f39c12;
            --dark: #1a1a2e;
            --darker: #0d0d1a;
            --light: #f8f9fa;
            --lighter: #ffffff;
            --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
            --gradient-dark: linear-gradient(135deg, var(--primary-dark), #0097e6);
            --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
            --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15);
            --border-radius: 16px;
            --border-radius-lg: 24px;
            --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'Inter', sans-serif;
            line-height: 1.7;
            color: #333;
            overflow-x: hidden;
            background-color: var(--lighter);
            transition: filter 0.3s ease;
        }

        body.true-tone-active {
            filter: sepia(0.3) hue-rotate(-15deg);
        }

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            font-family: 'Poppins', sans-serif;
            font-weight: 700;
            line-height: 1.3;
        }

        .section-padding {
            padding: 10px 0;
        }

        .section-title {
            font-size: 3rem;
            font-weight: 800;
            margin-bottom: 1.5rem;
            position: relative;
            background: var(--gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            display: inline-block;
        }

        .section-title::after {
            content: '';
            position: absolute;
            bottom: -15px;
            left: 0;
            width: 100px;
            height: 5px;
            background: var(--gradient);
            border-radius: 10px;
        }

        .section-title.center::after {
            left: 50%;
            transform: translateX(-50%);
        }

        .section-subtitle {
            font-size: 1.3rem;
            color: #6c757d;
            margin-bottom: 3rem;
            max-width: 700px;
            font-weight: 400;
        }

        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--gradient);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--primary-dark);
        }

        .navbar {
            background-color: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
            padding: 18px 0;
            transition: var(--transition);
        }

        .navbar-scrolled {
            background-color: rgba(255, 255, 255, 0.98);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            padding: 12px 0;
        }

        .navbar-brand {
            font-weight: 800;
            font-size: 1.8rem;
            display: flex;
            align-items: center;
        }

        .navbar-brand img {
            transition: var(--transition);
            border-radius: 8px;
        }

        .footer-logo img {
            border-radius: 10px;
        }

        @media (max-width: 575.98px) {
            .navbar-brand img {
                height: 70px !important;
            }

            .footer-logo img {
                height: 85px !important;
            }
        }

        .navbar-nav .nav-link {
            font-weight: 600;
            margin: 0 8px;
            position: relative;
            color: var(--dark);
            transition: var(--transition);
            padding: 8px 16px !important;
            border-radius: 16px;
        }

        .navbar-nav .nav-link::before {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 3px;
            background: var(--gradient);
            border-radius: 10px;
            transition: var(--transition);
        }

        .navbar-nav .nav-link:hover,
        .navbar-nav .nav-link.active {
            color: var(--primary);
            background: rgba(0, 102, 204, 0.05);
        }

        .navbar-nav .nav-link:hover::before,
        .navbar-nav .nav-link.active::before {
            width: 30px;
        }

        .true-tone-btn {
            background: transparent;
            border: none;
            color: var(--dark);
            font-size: 1.2rem;
            width: 45px;
            height: 45px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            margin-left: 10px;
            position: relative;
        }

        .true-tone-btn:hover {
            background: rgba(0, 102, 204, 0.05);
            color: var(--primary);
        }

        .true-tone-btn.active {
            color: var(--primary);
            background: rgba(0, 102, 204, 0.1);
        }

        .true-tone-btn .tooltip-text {
            visibility: hidden;
            width: auto;
            background-color: var(--dark);
            color: white;
            text-align: center;
            border-radius: 8px;
            padding: 5px 10px;
            position: absolute;
            z-index: 1;
            bottom: -40px;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
            transition: opacity 0.3s;
            font-size: 0.8rem;
            font-weight: 500;
            white-space: nowrap;
        }

        .true-tone-btn .tooltip-text::after {
            content: "";
            position: absolute;
            top: -5px;
            left: 50%;
            transform: translateX(-50%);
            border-width: 5px;
            border-style: solid;
            border-color: transparent transparent var(--dark) transparent;
        }

        .true-tone-btn:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }

        @media (max-width: 991.98px) {
            .true-tone-btn {
                margin-left: 0;
                margin-top: 10px;
                width: 40px;
                height: 40px;
            }
            
            .navbar-nav {
                align-items: center;
            }
        }

        .navbar-toggler {
            border: none;
            padding: 8px;
            border-radius: 10px;
            transition: var(--transition);
        }

        .navbar-toggler:focus {
            box-shadow: none;
        }

        .navbar-toggler-icon {
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        }

        /* Prestasi Card Styles */
        .prestasi-card {
            border: none;
            border-radius: var(--border-radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: var(--transition);
            height: 100%;
            background: white;
            position: relative;
            z-index: 1;
            cursor: pointer;
        }

        .prestasi-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 5px;
            background: var(--gradient);
            z-index: 2;
        }

        .prestasi-card:hover {
            transform: translateY(-15px);
            box-shadow: var(--shadow-lg);
        }

        .prestasi-image {
            height: 250px;
            width: 100%;
            object-fit: cover;
            transition: transform 0.7s ease;
        }

        .prestasi-card:hover .prestasi-image {
            transform: scale(1.05);
        }

        .prestasi-badge {
            position: absolute;
            top: 15px;
            right: 15px;
            background: var(--gradient);
            color: white;
            padding: 8px 15px;
            border-radius: 50px;
            font-size: 0.85rem;
            font-weight: 600;
            box-shadow: var(--shadow);
            z-index: 3;
        }

        .prestasi-content {
            padding: 25px;
        }

        .prestasi-title {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 10px;
            line-height: 1.4;
        }

        .prestasi-student {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--dark);
            margin-bottom: 8px;
        }

        .prestasi-meta {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .prestasi-meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
            color: #6c757d;
            font-size: 0.9rem;
        }

        .prestasi-meta-item i {
            color: var(--primary);
        }

        .prestasi-description {
            color: #6c757d;
            margin-bottom: 0;
            line-height: 1.6;
            max-height: 120px;
            overflow-y: auto;
            padding-right: 5px;
        }

        /* Styling for scrollbar (optional, for aesthetics) */
        .prestasi-description::-webkit-scrollbar {
            width: 4px;
        }
        .prestasi-description::-webkit-scrollbar-track {
            background: #f1f1f1;
        }
        .prestasi-description::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 4px;
        }

        /* IMPROVED Modal Popup Styles */
        .prestasi-modal .modal-content {
            border-radius: var(--border-radius-lg);
            border: none;
            overflow: hidden;
            box-shadow: var(--shadow-xl);
            background: var(--lighter);
            position: relative;
        }

        .prestasi-modal .modal-header {
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            padding: 25px 30px 20px;
            position: relative;
            background: var(--gradient);
            color: white;
        }

        .prestasi-modal .modal-title {
            font-size: 1.8rem;
            font-weight: 700;
            line-height: 1.3;
            margin: 0;
            padding-right: 40px;
        }

        .prestasi-modal .btn-close {
            position: absolute;
            top: 25px;
            right: 30px;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #ffff;
            opacity: 1;
            transition: var(--transition);
            padding: 0;
            border: none;
            color: var(--primary);
            font-size: 1.2rem;
        }

        .prestasi-modal .btn-close:hover {
            opacity: 1;
            transform: rotate(90deg);
        }

        .prestasi-modal .modal-body {
            padding: 30px;
        }

        .prestasi-modal .modal-image-container {
            position: relative;
            border-radius: var(--border-radius);
            overflow: hidden;
            margin-bottom: 25px;
            box-shadow: var(--shadow);
        }

        .prestasi-modal .modal-image {
            width: 100%;
            height: 300px;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .prestasi-modal .modal-image:hover {
            transform: scale(1.03);
        }

        .prestasi-modal .modal-badge {
            position: absolute;
            top: 15px;
            right: 15px;
            background: var(--gradient);
            color: white;
            padding: 8px 16px;
            border-radius: 50px;
            font-size: 0.9rem;
            font-weight: 700;
            box-shadow: var(--shadow);
            z-index: 3;
        }

        .prestasi-modal .detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-bottom: 25px;
        }

        .prestasi-modal .detail-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 20px;
            background: var(--light);
            border-radius: var(--border-radius);
            transition: var(--transition);
            border-left: 4px solid var(--primary);
        }

        .prestasi-modal .detail-item:hover {
            background: rgba(0, 102, 204, 0.05);
            transform: translateY(-5px);
            box-shadow: var(--shadow);
        }

        .prestasi-modal .detail-icon {
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--gradient);
            color: white;
            border-radius: 12px;
            font-size: 1.2rem;
            flex-shrink: 0;
            transition: var(--transition);
        }

        .prestasi-modal .detail-item:hover .detail-icon {
            transform: scale(1.1);
        }

        .prestasi-modal .detail-content h4 {
            font-size: 0.9rem;
            font-weight: 600;
            color: #6c757d;
            margin-bottom: 5px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .prestasi-modal .detail-content p {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--dark);
            margin: 0;
        }

        .prestasi-modal .achievement-highlight {
            background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), rgba(0, 168, 255, 0.05));
            border-radius: var(--border-radius);
            padding: 25px;
            margin-top: 20px;
            border: 1px solid rgba(0, 102, 204, 0.1);
            position: relative;
            overflow: hidden;
        }

        .prestasi-modal .achievement-highlight::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 5px;
            height: 100%;
            background: var(--gradient);
        }

        .prestasi-modal .achievement-highlight h4 {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 10px;
        }

        .prestasi-modal .achievement-highlight p {
            color: #555;
            margin: 0;
            line-height: 1.6;
        }

        .prestasi-modal .modal-footer {
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            padding: 20px 30px;
            display: flex;
            justify-content: flex-end;
            background: var(--light);
        }

        .prestasi-modal .btn-modal {
            background: var(--gradient);
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 50px;
            font-weight: 600;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .prestasi-modal .btn-modal:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow);
        }

        /* Responsive Modal Styles */
        @media (max-width: 991.98px) {
            .prestasi-modal .modal-header {
                padding: 20px 25px 15px;
            }

            .prestasi-modal .modal-body {
                padding: 25px;
            }

            .prestasi-modal .modal-title {
                font-size: 1.6rem;
            }

            .prestasi-modal .detail-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }
        }

        @media (max-width: 767.98px) {
            .prestasi-modal .modal-header {
                padding: 20px 20px 15px;
            }

            .prestasi-modal .modal-body {
                padding: 20px;
            }

            .prestasi-modal .modal-title {
                font-size: 1.4rem;
            }

            .prestasi-modal .btn-close {
                top: 20px;
                right: 20px;
                width: 32px;
                height: 32px;
            }

            .prestasi-modal .detail-item {
                padding: 15px;
            }

            .prestasi-modal .detail-icon {
                width: 40px;
                height: 40px;
                font-size: 1rem;
            }

            .prestasi-modal .detail-content h4 {
                font-size: 0.8rem;
            }

            .prestasi-modal .detail-content p {
                font-size: 1rem;
            }

            .prestasi-modal .modal-image {
                height: 250px;
            }
        }

        @media (max-width: 575.98px) {
            .prestasi-modal .modal-dialog {
                margin: 10px;
            }

            .prestasi-modal .modal-header {
                padding: 15px 15px 10px;
            }

            .prestasi-modal .modal-body {
                padding: 15px;
            }

            .prestasi-modal .modal-title {
                font-size: 1.3rem;
                padding-right: 30px;
            }

            .prestasi-modal .btn-close {
                top: 15px;
                right: 15px;
            }

            .prestasi-modal .detail-item {
                flex-direction: column;
                text-align: center;
                gap: 10px;
            }

            .prestasi-modal .modal-footer {
                padding: 15px;
            }

            .prestasi-modal .modal-image {
                height: 200px;
            }
        }

        /* Filter Styles */
        .filter-section {
            background: var(--light);
            padding: 60px 0 30px;
        }

        .filter-btn {
            background: white;
            border: 2px solid #e0e0e0;
            color: #6c757d;
            padding: 12px 25px;
            border-radius: 50px;
            font-weight: 600;
            transition: var(--transition);
            margin: 5px;
        }

        .filter-btn:hover,
        .filter-btn.active {
            background: var(--gradient);
            color: white;
            border-color: transparent;
            transform: translateY(-3px);
            box-shadow: var(--shadow);
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 80px 20px;
        }

        .empty-state-icon {
            font-size: 4rem;
            color: #dee2e6;
            margin-bottom: 20px;
        }

        .empty-state-text {
            color: #6c757d;
            font-size: 1.2rem;
        }

        /* Footer */
        .footer-section {
            background: var(--darker);
            color: white;
            padding: 100px 0 30px;
            position: relative;
        }

        .footer-logo {
            font-weight: 800;
            font-size: 1.8rem;
            margin-bottom: 25px;
            display: flex;
            align-items: center;
        }

        .footer-about {
            margin-bottom: 30px;
            opacity: 0.8;
            line-height: 1.8;
        }

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

        .social-links a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 45px;
            height: 45px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            color: white;
            transition: var(--transition);
            font-size: 1.2rem;
            text-decoration: none;
        }

        .social-links a:hover {
            background: var(--primary);
            transform: translateY(-5px);
        }

        .footer-heading {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 25px;
            position: relative;
        }

        .footer-heading::after {
            content: '';
            position: absolute;
            bottom: -12px;
            left: 0;
            width: 50px;
            height: 3px;
            background: var(--gradient);
            border-radius: 10px;
        }

        .footer-links li {
            margin-bottom: 15px;
        }

        .footer-links a {
            color: rgba(255, 255, 255, 0.7);
            text-decoration: none;
            transition: var(--transition);
            display: flex;
            align-items: center;
        }

        .footer-links a i {
            margin-right: 10px;
            font-size: 0.9rem;
            opacity: 0.7;
            transition: var(--transition);
        }

        .footer-links a:hover {
            color: white;
            padding-left: 8px;
        }

        .footer-links a:hover i {
            opacity: 1;
            transform: translateX(3px);
        }

        .footer-contact li {
            margin-bottom: 20px;
            display: flex;
            align-items: flex-start;
        }

        .footer-contact i {
            margin-right: 15px;
            color: var(--secondary);
            margin-top: 5px;
            font-size: 1.1rem;
        }

        .map-container {
            border-radius: var(--border-radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            height: 250px;
        }

        .footer-bottom {
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            padding-top: 25px;
            margin-top: 60px;
        }

        /* Back to Top Button */
        .back-to-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 55px;
            height: 55px;
            background: var(--gradient);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
            cursor: pointer;
        }

        .back-to-top.active {
            opacity: 1;
            visibility: visible;
        }

        .back-to-top:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-xl);
        }

        /* Loading Animation */
        .loading-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--gradient);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }

        .loading-screen.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .loader {
            width: 80px;
            height: 80px;
            border: 5px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s ease-in-out infinite;
            margin-bottom: 20px;
        }

        .loading-text {
            color: white;
            font-size: 1.2rem;
            font-weight: 500;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        @media (max-width: 1199.98px) {
            .section-title {
                font-size: 2.5rem;
            }
        }

        @media (max-width: 991.98px) {
            .section-padding {
                padding: 80px 0;
            }

            .section-title {
                font-size: 2.2rem;
            }

            .navbar-collapse {
                background: white;
                border-radius: 16px;
                padding: 20px;
                box-shadow: var(--shadow-lg);
                margin-top: 15px;
            }
        }

        @media (max-width: 767.98px) {
            .section-title {
                font-size: 2rem;
            }

            .section-subtitle {
                font-size: 1.1rem;
            }

            .prestasi-card {
                margin-bottom: 25px;
            }

            .footer-section {
                padding: 60px 0 20px;
            }

            .back-to-top {
                width: 50px;
                height: 50px;
                bottom: 20px;
                right: 20px;
            }
        }

        @media (max-width: 575.98px) {
            .section-title {
                font-size: 1.8rem;
            }

            .navbar-brand {
                font-size: 1.5rem;
            }

            .prestasi-meta {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }
        }
    </style>
</head>

<body>
    <div class="loading-screen">
        <div class="loader"></div>
        <div class="loading-text">SMK Muhammadiyah 1 Berbek</div>
    </div>

    <div class="back-to-top">
        <i class="fas fa-chevron-up"></i>
    </div>

    <header class="header-section">
        <nav class="navbar navbar-expand-lg navbar-light fixed-top">
            <div class="container">
                <a class="navbar-brand" href="{{ route('landing-page') }}">
                    <img src="{{ asset('images/logo-black.png') }}" alt="SMK Muhammadiyah 1 Berbek" height="68"
                        class="d-inline-block align-text-center">
                </a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
                    aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                    <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" href="{{ route('landing-page') }}">Beranda</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{ route('pengumuman') }}">Pengumuman</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{ route('profil') }}">Profil Sekolah</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link active" href="{{ route('prestasi') }}">Prestasi</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{ route('landing-page') }}#jurusan">Jurusan</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{ route('landing-page') }}#fasilitas">Fasilitas</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{ route('landing-page') }}#galeri">Galeri</a>
                        </li>
                        <li class="nav-item d-flex align-items-center">
                            <button class="true-tone-btn" id="trueToneToggle" aria-label="Aktifkan True Tone">
                                <i class="fas fa-adjust"></i>
                                <span class="tooltip-text">Aktifkan True Tone</span>
                            </button>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </header>

    <section class="hero-section" style="background: var(--gradient-dark); padding: 130px 0 40px;">
        <div class="container">
            <div class="row">
                <div class="col-12 text-center text-white mt-4">
                    <h1 class="hero-title animate__animated animate__fadeInUp">Prestasi Siswa</h1>
                    <p class="hero-subtitle animate__animated animate__fadeInUp animate__delay-1s">
                        Kumpulan prestasi membanggakan yang telah diraih oleh siswa-siswi SMK Muhammadiyah 1 Berbek
                    </p>
                </div>
            </div>
        </div>
    </section>

    <section class="filter-section">
        <div class="container">
            <div class="row">
                <div class="col-12 text-center">
                    <h3 class="mb-2">Filter Berdasarkan Jurusan</h3>
                    <div class="filter-buttons">
                        <button class="filter-btn active" data-filter="all">Semua</button>
                        @php
                            $jurusanList = $prestasi->map(function($item) {
                                return is_object($item->jurusan) ? $item->jurusan->nama_jurusan : $item->jurusan;
                            })->unique()->sort();
                        @endphp
                        @foreach ($jurusanList as $jurusanName)
                            <button class="filter-btn"
                                data-filter="{{ Str::slug($jurusanName) }}">{{ $jurusanName }}</button>
                        @endforeach
                    </div>
                </div>
            </div>
        </div>
    </section>

    <section class="section-padding">
        <div class="container">
            @if ($prestasi->count() > 0)
                <div class="row" id="prestasi-grid">
                    @foreach ($prestasi as $item)
                        <div class="col-lg-4 col-md-6 mb-4 prestasi-item"
                            data-jurusan="{{ is_object($item->jurusan) ? Str::slug($item->jurusan->nama_jurusan) : Str::slug($item->jurusan) }}" data-year="{{ $item->tahun_prestasi }}">
                            <div class="prestasi-card animate__animated animate__fadeInUp"
                                data-prestasi-id="{{ $item->id }}" data-prestasi-nama="{{ $item->nama_prestasi }}"
                                data-prestasi-siswa="{{ $item->nama_siswa }}"
                                data-prestasi-jurusan="{{ is_object($item->jurusan) ? $item->jurusan->nama_jurusan : $item->jurusan }}"
                                data-prestasi-peringkat="{{ $item->peringkat }}"
                                data-prestasi-tahun="{{ $item->tahun_prestasi }}"
                                data-prestasi-foto="{{ $item->foto_prestasi_url }}"
                                data-prestasi-deskripsi="{{ $item->deskripsi ?? 'Prestasi yang membanggakan dari siswa ' . (is_object($item->jurusan) ? $item->jurusan->nama_jurusan : $item->jurusan) . ' dalam bidang ' . strtolower($item->nama_prestasi) . '.' }}">
                                <div class="position-relative overflow-hidden">
                                    <img src="{{ $item->foto_prestasi_url }}" class="prestasi-image"
                                        alt="{{ $item->nama_prestasi }}"
                                        onerror="this.onerror=null;this.src='{{ asset('images/default-img.png') }}';">
                                    <div class="prestasi-badge">
                                        {{ $item->peringkat }}
                                    </div>
                                </div>
                                <div class="prestasi-content">
                                    <h4 class="prestasi-title">{{ $item->nama_prestasi }}</h4>
                                    <h5 class="prestasi-student">{{ $item->nama_siswa }}</h5>
                                    <div class="prestasi-meta">
                                        <div class="prestasi-meta-item">
                                            <i class="fas fa-graduation-cap"></i>
                                            <span>{{ is_object($item->jurusan) ? $item->jurusan->nama_jurusan : $item->jurusan }}</span>
                                        </div>
                                        <div class="prestasi-meta-item">
                                            <i class="fas fa-calendar-alt"></i>
                                            <span>{{ $item->tahun_prestasi }}</span>
                                        </div>
                                    </div>
                                    <p class="prestasi-description">
                                        {{ $item->deskripsi ?? 'Prestasi yang membanggakan dari siswa ' . (is_object($item->jurusan) ? $item->jurusan->nama_jurusan : $item->jurusan) . ' dalam bidang ' . strtolower($item->nama_prestasi) . '.' }}
                                    </p>
                                </div>
                            </div>
                        </div>
                    @endforeach
                </div>
            @else
                <div class="empty-state">
                    <div class="empty-state-icon">
                        <i class="fas fa-trophy"></i>
                    </div>
                    <h3 class="text-muted">Belum Ada Prestasi</h3>
                    <p class="empty-state-text">Data prestasi siswa akan segera ditampilkan di sini.</p>
                </div>
            @endif
        </div>
    </section>

    <div class="modal fade prestasi-modal" id="prestasiModal" tabindex="-1" aria-labelledby="prestasiModalLabel"
        aria-hidden="true">
        <div class="modal-dialog modal-lg modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <h2 class="modal-title" id="prestasiModalLabel">Detail Prestasi</h2>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
                        <i class="fas fa-times"></i>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="modal-image-container">
                        <img id="modalImage" src="" alt="Foto Prestasi" class="modal-image">
                        <div class="modal-badge" id="modalBadge">Juara 1</div>
                    </div>

                    <div class="detail-grid">
                        <div class="detail-item">
                            <div class="detail-icon">
                                <i class="fas fa-user-graduate"></i>
                            </div>
                            <div class="detail-content">
                                <h4>Nama Siswa</h4>
                                <p id="modalNamaSiswa">-</p>
                            </div>
                        </div>
                        <div class="detail-item">
                            <div class="detail-icon">
                                <i class="fas fa-graduation-cap"></i>
                            </div>
                            <div class="detail-content">
                                <h4>Jurusan</h4>
                                <p id="modalJurusan">-</p>
                            </div>
                        </div>
                        <div class="detail-item">
                            <div class="detail-icon">
                                <i class="fas fa-trophy"></i>
                            </div>
                            <div class="detail-content">
                                <h4>Peringkat</h4>
                                <p id="modalPeringkat">-</p>
                            </div>
                        </div>
                        <div class="detail-item">
                            <div class="detail-icon">
                                <i class="fas fa-calendar-alt"></i>
                            </div>
                            <div class="detail-content">
                                <h4>Tahun Prestasi</h4>
                                <p id="modalTahun">-</p>
                            </div>
                        </div>
                    </div>

                    <div class="achievement-highlight">
                        <h4>Deskripsi Prestasi</h4>
                        <p id="modalDeskripsi">-</p>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-modal" data-bs-dismiss="modal">
                        <i class="fas fa-times me-2"></i>Tutup
                    </button>
                </div>
            </div>
        </div>
    </div>

    <footer class="footer-section">
        <div class="container">
            <div class="row">
                <div class="col-lg-4 mb-5">
                    <div class="footer-logo">
                        <img src="{{ asset('images/logo-white.png') }}" alt="SMK Muhammadiyah 1 Berbek"
                            height="100" class="d-inline-block align-text-top me-3">
                    </div>
                    <p class="footer-about">Sekolah Menengah Kejuruan yang berkomitmen untuk menghasilkan lulusan yang
                        kompeten, berakhlak mulia, dan siap menghadapi tantangan dunia kerja.</p>
                    <div class="social-links">
                        <a href="#"><i class="fab fa-facebook-f"></i></a>
                        <a href="#"><i class="fab fa-instagram"></i></a>
                        <a href="#"><i class="fab fa-youtube"></i></a>
                        <a href="#"><i class="fab fa-tiktok"></i></a>
                    </div>
                </div>
                <div class="col-lg-2 col-md-6 mb-5">
                    <h5 class="footer-heading">Tautan Cepat</h5>
                    <ul class="list-unstyled footer-links">
                        <li><a href="{{ route('landing-page') }}"><i class="fas fa-chevron-right"></i> Beranda</a>
                        </li>
                        <li><a href="{{ route('profil') }}"><i class="fas fa-chevron-right"></i> Profil Sekolah</a>
                        </li>
                        <li><a href="{{ route('prestasi') }}"><i class="fas fa-chevron-right"></i> Prestasi</a></li>
                        <li><a href="{{ route('pengumuman') }}"><i class="fas fa-chevron-right"></i> Pengumuman</a>
                        </li>
                        <li><a href="{{ route('landing-page') }}#jurusan"><i class="fas fa-chevron-right"></i>Program
                                Jurusan</a></li>
                        <li><a href="{{ route('landing-page') }}#fasilitas"><i
                                    class="fas fa-chevron-right"></i>Fasilitas</a></li>
                    </ul>
                </div>
                <div class="col-lg-3 col-md-6 mb-5">
                    <h5 class="footer-heading">Kontak Kami</h5>
                    <ul class="list-unstyled footer-contact">
                        <li>
                            <i class="fas fa-map-marker-alt"></i>
                            <span>JL. DERMOJOYO 26 SENGKUT, Sengkut, Berbek, Kabupaten Nganjuk Jawa Timur 64473</span>
                        </li>
                        <li>
                            <i class="fas fa-phone"></i>
                            <span>(0358) 323580</span>
                        </li>
                        <li>
                            <i class="fas fa-envelope"></i>
                            <span>smkm1berbek@yahoo.com</span>
                        </li>
                        <li>
                            <i class="fas fa-clock"></i>
                            <span>Senin - Jumat: 07.00 - 16.00 WIB</span>
                        </li>
                    </ul>
                </div>
                <div class="col-lg-3 mb-5">
                    <h5 class="footer-heading">Peta Lokasi</h5>
                    <div class="map-container">
                        <iframe
                            src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d4850.088416523539!2d111.8658284114012!3d-7.660318592324255!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2e784cc883add2ff%3A0x10bd624bf559e6d8!2sSMK%20MUHAMADIYAH%201%20BERBEK!5e1!3m2!1sid!2sid!4v1764033282768!5m2!1sid!2sid"
                            width="100%" height="100%" style="border:0;" allowfullscreen="" loading="lazy"
                            referrerpolicy="no-referrer-when-downgrade"></iframe>
                    </div>
                </div>
            </div>
            <div class="footer-bottom">
                <div class="row">
                    <div class="col-md-12 text-md-center text-center">
                        <p class="mb-0">&copy; {{ date('Y') }} SMK Muhammadiyah 1 Berbek. All rights
                            reserved.</p>
                    </div>
                </div>
            </div>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        window.addEventListener('load', function() {
            const loadingScreen = document.querySelector('.loading-screen');
            setTimeout(() => {
                loadingScreen.classList.add('hidden');
            }, 1500);
        });

        window.addEventListener('scroll', function() {
            const navbar = document.querySelector('.navbar');
            if (window.scrollY > 50) {
                navbar.classList.add('navbar-scrolled');
            } else {
                navbar.classList.remove('navbar-scrolled');
            }

            const backToTop = document.querySelector('.back-to-top');
            if (window.scrollY > 300) {
                backToTop.classList.add('active');
            } else {
                backToTop.classList.remove('active');
            }
        });

        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function(e) {
                e.preventDefault();

                const targetId = this.getAttribute('href');
                if (targetId === '#') return;

                const targetElement = document.querySelector(targetId);
                if (targetElement) {
                    window.scrollTo({
                        top: targetElement.offsetTop - 70,
                        behavior: 'smooth'
                    });

                    const navbarToggler = document.querySelector('.navbar-toggler');
                    const navbarCollapse = document.querySelector('.navbar-collapse');
                    if (navbarCollapse.classList.contains('show')) {
                        navbarToggler.click();
                    }
                }
            });
        });

        document.querySelector('.back-to-top').addEventListener('click', function() {
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });

        // Filter functionality
        document.querySelectorAll('.filter-btn').forEach(button => {
            button.addEventListener('click', function() {
                // Remove active class from all buttons
                document.querySelectorAll('.filter-btn').forEach(btn => {
                    btn.classList.remove('active');
                });

                // Add active class to clicked button
                this.classList.add('active');

                const filterValue = this.getAttribute('data-filter');
                const prestasiItems = document.querySelectorAll('.prestasi-item');

                prestasiItems.forEach(item => {
                    if (filterValue === 'all' || item.getAttribute('data-jurusan') ===
                        filterValue) {
                        item.style.display = 'block';
                        setTimeout(() => {
                            item.style.opacity = '1';
                            item.style.transform = 'translateY(0)';
                        }, 50);
                    } else {
                        item.style.opacity = '0';
                        item.style.transform = 'translateY(20px)';
                        setTimeout(() => {
                            item.style.display = 'none';
                        }, 300);
                    }
                });
            });
        });

        // IMPROVED Modal functionality
        document.querySelectorAll('.prestasi-card').forEach(card => {
            card.addEventListener('click', function() {
                const modal = new bootstrap.Modal(document.getElementById('prestasiModal'));

                // Get data from card
                const namaPrestasi = this.getAttribute('data-prestasi-nama');
                const namaSiswa = this.getAttribute('data-prestasi-siswa');
                const jurusan = this.getAttribute('data-prestasi-jurusan');
                const peringkat = this.getAttribute('data-prestasi-peringkat');
                const tahun = this.getAttribute('data-prestasi-tahun');
                const foto = this.getAttribute('data-prestasi-foto');
                const deskripsi = this.getAttribute('data-prestasi-deskripsi');

                // Set modal content
                document.getElementById('prestasiModalLabel').textContent = namaPrestasi;
                document.getElementById('modalNamaSiswa').textContent = namaSiswa;
                document.getElementById('modalJurusan').textContent = jurusan;
                document.getElementById('modalPeringkat').textContent = peringkat;
                document.getElementById('modalTahun').textContent = tahun;
                document.getElementById('modalImage').src = foto;
                document.getElementById('modalImage').alt = namaPrestasi;
                document.getElementById('modalBadge').textContent = peringkat;
                document.getElementById('modalDeskripsi').textContent = deskripsi;

                // Show modal
                modal.show();

                // Add animation to modal elements
                setTimeout(() => {
                    const modalItems = document.querySelectorAll('.prestasi-modal .detail-item');
                    modalItems.forEach((item, index) => {
                        setTimeout(() => {
                            item.style.opacity = '0';
                            item.style.transform = 'translateY(20px)';
                            item.style.transition =
                                'opacity 0.5s ease, transform 0.5s ease';

                            setTimeout(() => {
                                item.style.opacity = '1';
                                item.style.transform = 'translateY(0)';
                            }, 50);
                        }, index * 100);
                    });
                }, 300);
            });
        });

        // Animate on scroll
        const animateOnScroll = function() {
            const elements = document.querySelectorAll('.prestasi-card');

            elements.forEach(element => {
                const elementPosition = element.getBoundingClientRect().top;
                const screenPosition = window.innerHeight / 1.2;

                if (elementPosition < screenPosition) {
                    element.style.opacity = '1';
                    element.style.transform = 'translateY(0)';
                }
            });
        };

        document.querySelectorAll('.prestasi-card').forEach(el => {
            el.style.opacity = '0';
            el.style.transform = 'translateY(30px)';
            el.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
        });

        window.addEventListener('scroll', animateOnScroll);
        window.addEventListener('load', animateOnScroll);

        // Fungsi True Tone Filter
        const trueToneToggle = document.getElementById('trueToneToggle');
        const tooltipText = trueToneToggle.querySelector('.tooltip-text');
        const isTrueToneActive = localStorage.getItem('trueToneActive') === 'true';
        
        if (isTrueToneActive) {
            document.body.classList.add('true-tone-active');
            trueToneToggle.classList.add('active');
            trueToneToggle.innerHTML = '<i class="fas fa-adjust"></i><span class="tooltip-text">Nonaktifkan True Tone</span>';
        }

        trueToneToggle.addEventListener('click', function() {
            const isActive = document.body.classList.toggle('true-tone-active');
            this.classList.toggle('active');
            
            if (isActive) {
                this.innerHTML = '<i class="fas fa-adjust"></i><span class="tooltip-text">Nonaktifkan True Tone</span>';
                localStorage.setItem('trueToneActive', 'true');
            } else {
                this.innerHTML = '<i class="fas fa-adjust"></i><span class="tooltip-text">Aktifkan True Tone</span>';
                localStorage.setItem('trueToneActive', 'false');
            }
        });

        trueToneToggle.addEventListener('mouseenter', function() {
            const isActive = document.body.classList.contains('true-tone-active');
            tooltipText.textContent = isActive ? 'Nonaktifkan True Tone' : 'Aktifkan True Tone';
        });
    </script>
</body>

</html>
