<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MyIstriList - Fluorits </title>
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap" rel="stylesheet">
    <link rel="icon" href="https://i.ibb.co/RzCDyYH/image.jpg" type="image/x-icon">
    <style>
        /* Base styles remain the same until .profile-grid */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background-color: #0f172a;
            color: #fff;
            font-family: 'Outfit', sans-serif;
            min-height: 100vh;
            position: relative;
            overflow-x: hidden;
        }

        .stars {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
        }

        .star {
            position: absolute;
            background: #fff;
            border-radius: 50%;
            animation: twinkle linear infinite;
        }

        @keyframes twinkle {
            0%, 100% { opacity: 1; }
            50% { opacity: 0; }
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 1rem;
            position: relative;
            z-index: 1;
        }

        h1 {
            text-align: center;
            font-size: clamp(2rem, 5vw, 3.5rem);
            margin-bottom: 2rem;
            font-weight: 600;
            background: linear-gradient(to right, #a855f7, #ec4899);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: 2px;
        }

        /* Updated Profile Grid */
        .profile-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 1.25rem;
            margin-bottom: 3rem;
            justify-items: center;
        }

        /* Updated Profile Card */
        .profile-card {
            position: relative;
            width: 250px;
            height: 250px;
            border-radius: 0.75rem;
            overflow: hidden;
            transition: all 0.3s ease;
            cursor: pointer;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: stretch;
        }

        .profile-image-container {
            flex: 1;
            position: relative;
            overflow: hidden;
        }

        .profile-image {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-size: cover;
            background-position: center;
            transition: transform 0.3s ease;
        }

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

        /* Updated Content Styles */
        .profile-content {
            position: absolute;
            right: 0;
            top: 0;
            height: 100%;
            width: 60px;
            background: rgba(15, 23, 42, 0.85);
            backdrop-filter: blur(8px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 1rem 0.5rem;
            transform: translateX(100%);
            transition: transform 0.3s ease;
        }

        .profile-card:hover .profile-content {
            transform: translateX(0);
        }

        .vertical-text {
            writing-mode: vertical-rl;
            text-orientation: mixed;
            transform: rotate(180deg);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.75rem;
            height: 100%;
        }

        .profile-name {
            font-size: 1.1rem;
            font-weight: 600;
            color: transparent;
            -webkit-text-stroke: 1px #fff;
            text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
            white-space: nowrap;
            opacity: 0;
            transition: opacity 0.3s ease, transform 0.3s ease;
            transform: translateY(20px);
        }

        .profile-role {
            font-size: 0.75rem;
            color: #fff;
            opacity: 0;
            white-space: nowrap;
            transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
            transform: translateY(20px);
        }

        .profile-card:hover .profile-name,
        .profile-card:hover .profile-role {
            opacity: 1;
            transform: translateY(0);
        }

        /* Updated Gradient Overlays */
        .profile-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: calc(100% - 60px);
            height: 100%;
            background: linear-gradient(
                to right,
                rgba(15, 23, 42, 0),
                rgba(15, 23, 42, 0.5)
            );
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 1;
        }

        .profile-content::before {
            content: '';
            position: absolute;
            top: 0;
            left: -15px;
            width: 15px;
            height: 100%;
            background: linear-gradient(
                to left,
                rgba(15, 23, 42, 0.85),
                transparent
            );
        }

        .profile-image::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                45deg,
                rgba(168, 85, 247, 0.1),
                rgba(236, 72, 153, 0.1)
            );
        }

        .profile-card:hover::before {
            opacity: 1;
        }

        .profile-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 30px rgba(168, 85, 247, 0.3);
        }

        /* Footer styles */
        footer {
            background: rgba(30, 41, 59, 0.5);
            backdrop-filter: blur(8px);
            border-top: 1px solid rgba(148, 163, 184, 0.1);
            padding: 1.5rem 0;
            position: relative;
            z-index: 1;
        }

        .footer-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 1rem;
        }

        .footer-left h2 {
            font-size: 1.25rem;
            margin-bottom: 0.5rem;
            -webkit-text-stroke: 1px #fff;
            color: transparent;
        }

        .footer-left p {
            color: #94a3b8;
            font-size: 0.875rem;
        }

        .footer-buttons {
            display: flex;
            gap: 0.75rem;
        }

        .btn {
            padding: 0.625rem 1.25rem;
            border-radius: 9999px;
            font-weight: 600;
            transition: all 0.3s ease;
            cursor: pointer;
            font-family: 'Outfit', sans-serif;
            font-size: 0.875rem;
        }

        .btn-primary {
            background: linear-gradient(135deg, #a855f7, #ec4899);
            color: white;
            border: none;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
        }

        .btn-secondary {
            background: transparent;
            color: #fff;
            border: 1px solid #a855f7;
        }

        .btn-secondary:hover {
            background: rgba(168, 85, 247, 0.1);
            transform: translateY(-2px);
        }

        /* Updated Responsive Styles */
        @media (max-width: 768px) {
            .container {
                padding: 0.75rem;
            }

            .profile-grid {
                gap: 1rem;
            }

            .footer-content {
                flex-direction: column;
                text-align: center;
                gap: 1.25rem;
            }
        }

        @media (max-width: 480px) {
            .profile-grid {
                grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            }

            .profile-card {
                width: 200px;
                height: 200px;
            }

            .profile-content {
                width: 50px;
            }

            .profile-name {
                font-size: 1rem;
            }

            .profile-role {
                font-size: 0.7rem;
            }

            .btn {
                padding: 0.5rem 1rem;
                font-size: 0.8rem;
            }
        }
    </style>
</head>
<body>
    <!-- Rest of the HTML and JavaScript remains the same -->
    <div class="stars"></div>
    
    <div class="container">
        <h1>MyIstriList</h1>
        <p align="center">Fiksi membawa kebahagiaan.</p><br>
        <div class="profile-grid" id="profileGrid"></div>
    </div>

    <footer>
        <div class="footer-content">
            <div class="footer-left">
                <h2>Everyone deserve happiness!</h2>
                <p>&copy; 2024 Fluorits Project.</p>
            </div>
            <div class="footer-buttons">
               <img height="50" width="50" src="https://i.ibb.co/RzCDyYH/image.jpg">
            </div>
        </div>
    </footer>
    <script src="
https://cdn.jsdelivr.net/npm/axios@1.7.9/dist/axios.min.js
"></script>
    <script>
        // Create starry background
        function createStars() {
            const starsContainer = document.querySelector('.stars');
            for (let i = 0; i < 100; i++) {
                const star = document.createElement('div');
                star.className = 'star';
                star.style.width = Math.random() * 3 + 'px';
                star.style.height = star.style.width;
                star.style.left = Math.random() * 100 + '%';
                star.style.top = Math.random() * 100 + '%';
                star.style.animationDuration = (Math.random() * 3 + 5) + 's';
                star.style.animationDelay = Math.random() * 5 + 's';
                starsContainer.appendChild(star);
            }
        }

        // Fetch profiles data from the API and create profile cards
         async function fetchProfiles() {
            try {
                const response = await fetch('mil-db.json');
                const data = await response.json();
                createProfileCards(data);
            } catch (error) {
                console.error('Error fetching profiles:', error);
            }
        }


        // Create profile cards
        function createProfileCards(profiles) {
            const grid = document.getElementById('profileGrid');
            profiles.forEach(profile => {
                const card = document.createElement('div');
                card.className = 'profile-card';
                card.innerHTML = `
                    <div class="profile-image-container">
                        <div class="profile-image" style="background-image: url('${profile.image}')"></div>
                    </div>
                    <div class="profile-content">
                        <div class="vertical-text">
                            <h3 class="profile-name">${profile.name}</h3>
                            <p class="profile-role">${profile.role}</p>
                        </div>
                    </div>
                `;
                grid.appendChild(card);
            });
        }

        // Initialize
        document.addEventListener('DOMContentLoaded', () => {
            createStars();
            fetchProfiles(); // Fetch profiles and create cards
        });
    </script>
</body>
</html>
