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

<head>
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>@yield('title', 'Dashboard') - Kei's Store</title>
    <link rel="icon" type="image/jpeg" href="{{ asset('images/logo3.jpg') }}">
    <script src="https://app.sandbox.midtrans.com/snap/snap.js"
        data-client-key="{{ config('services.midtrans.clientKey') }}"></script>

    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" />
    <!-- Bootstrap Icons -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css" rel="stylesheet" />
    <!-- Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet" />

    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">

    <!-- AOS Animation -->
    <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">

    <style>
        :root {
            --pink-1: #FF6B9D;
            --pink-2: #FF85B3;
            --pink-3: #FFB8D2;
            --pink-4: #FFE0EB;
            --pink-5: #FFF0F5;
            --peach: #FFB8A0;
            --gold: #FFD700;
            --rose-gold: #E8B4B8;
            --cream: #FFF9F5;
            --white: #FFFFFF;
            --soft-gray: #F8F9FA;
            --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.08);
            --shadow-md: 0 8px 24px rgba(255, 107, 157, 0.12);
            --shadow-lg: 0 16px 48px rgba(255, 107, 157, 0.15);
            --shadow-xl: 0 24px 64px rgba(255, 107, 157, 0.2);
            --shadow-glow: 0 0 30px rgba(255, 107, 157, 0.3);
        }

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

        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background: linear-gradient(135deg, #FFF9F5 0%, #FFF0F5 50%, #FFE0EB 100%);
            min-height: 100vh;
            position: relative;
            overflow-x: hidden;
        }

        /* Animated Background - Light & Airy */
        .animated-bg {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
            overflow: hidden;
        }

        .gradient-sphere {
            position: absolute;
            border-radius: 50%;
            filter: blur(100px);
            opacity: 0.5;
            animation: float 25s infinite ease-in-out;
        }

        .sphere-1 {
            width: 700px;
            height: 700px;
            background: radial-gradient(circle, var(--pink-2), var(--pink-4));
            top: -300px;
            right: -200px;
            animation-delay: 0s;
        }

        .sphere-2 {
            width: 600px;
            height: 600px;
            background: radial-gradient(circle, var(--peach), var(--pink-3));
            bottom: -250px;
            left: -150px;
            animation-delay: 5s;
        }

        .sphere-3 {
            width: 500px;
            height: 500px;
            background: radial-gradient(circle, var(--gold), var(--peach));
            top: 40%;
            left: 30%;
            animation-delay: 10s;
            opacity: 0.3;
        }

        .sphere-4 {
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, var(--pink-1), var(--rose-gold));
            bottom: 20%;
            right: 15%;
            animation-delay: 15s;
        }

        @keyframes float {
            0%, 100% {
                transform: translate(0, 0) rotate(0deg);
            }
            33% {
                transform: translate(40px, -40px) rotate(120deg);
            }
            66% {
                transform: translate(-30px, 30px) rotate(240deg);
            }
        }



        /* Sparkle Animation */
        @keyframes sparkle {
            0%, 100% { opacity: 0; transform: scale(0); }
            50% { opacity: 1; transform: scale(1); }
        }

        /* Splash Screen */
        @keyframes flip {
            0%, 100% { transform: rotateY(0deg); }
            50% { transform: rotateY(180deg); }
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        @keyframes pulseGlow {
            0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.4); }
            50% { box-shadow: 0 0 0 20px rgba(255, 107, 157, 0); }
        }

        @keyframes shimmer {
            0% { background-position: -1000px 0; }
            100% { background-position: 1000px 0; }
        }

        /* TOP NAVBAR - Premium Light */
        .top-navbar {
            position: fixed;
            top: 20px;
            left: 20px;
            right: 20px;
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(20px);
            border-radius: 80px;
            z-index: 1000;
            height: 80px;
            border: 1px solid rgba(255, 107, 157, 0.2);
            box-shadow: var(--shadow-lg);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .top-navbar.scrolled {
            top: 0;
            left: 0;
            right: 0;
            border-radius: 0;
            background: rgba(255, 255, 255, 0.98);
            box-shadow: var(--shadow-xl);
        }

        .navbar-container {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 100%;
            padding: 0 2rem;
            max-width: 1600px;
            margin: 0 auto;
        }

        /* Brand - Luxury */
        .navbar-brand {
            display: flex;
            align-items: center;
            gap: 15px;
            text-decoration: none;
            position: relative;
        }

        .navbar-brand::after {
            content: '✦';
            position: absolute;
            right: -25px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 1.2rem;
            color: var(--pink-1);
            animation: sparkle 2s infinite;
        }

        .brand-logo {
            width: 52px;
            height: 52px;
            border-radius: 28px;
            background: linear-gradient(135deg, var(--pink-1), var(--gold));
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            animation: pulseGlow 2s infinite;
            box-shadow: var(--shadow-md);
            transition: all 0.3s ease;
        }

        .brand-logo:hover {
            transform: scale(1.05);
            box-shadow: var(--shadow-glow);
        }

        .brand-logo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .brand-text {
            display: flex;
            flex-direction: column;
        }

        .brand-name {
            font-family: 'Playfair Display', serif;
            font-weight: 800;
            font-size: 1.8rem;
            background: linear-gradient(135deg, var(--pink-1), var(--gold), var(--pink-2));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: -0.5px;
        }

        .brand-tagline {
            font-size: 0.7rem;
            color: var(--pink-1);
            letter-spacing: 3px;
            font-weight: 500;
        }

        /* Navigation - Elegant */
        .navbar-menu {
            display: flex;
            align-items: center;
            gap: 8px;
            height: 100%;
        }

        .nav-item {
            position: relative;
            height: 100%;
            display: flex;
            align-items: center;
        }

        .nav-link {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 0 1.3rem;
            height: 80px;
            text-decoration: none;
            color: #4A4A4A;
            font-weight: 600;
            font-size: 0.95rem;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            position: relative;
            border-radius: 40px;
        }

        .nav-link i {
            font-size: 1.2rem;
            transition: all 0.3s ease;
            color: var(--pink-1);
        }

        .nav-link::before {
            content: '';
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%) scaleX(0);
            width: 35px;
            height: 3px;
            background: linear-gradient(90deg, var(--pink-1), var(--gold));
            border-radius: 3px;
            transition: transform 0.3s ease;
        }

        .nav-link:hover::before,
        .nav-link.active::before {
            transform: translateX(-50%) scaleX(1);
        }

        .nav-link:hover {
            color: var(--pink-1);
            background: linear-gradient(135deg, var(--pink-5), var(--cream));
        }

        .nav-link:hover i {
            transform: translateY(-3px) scale(1.1);
        }

        .nav-link.active {
            color: var(--pink-1);
            background: linear-gradient(135deg, var(--pink-5), var(--cream));
        }

        /* Dropdown - Premium */
        .dropdown-menu {
            position: absolute;
            top: 80px;
            left: 0;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(20px);
            min-width: 270px;
            border-radius: 24px;
            border: 1px solid rgba(255, 107, 157, 0.2);
            box-shadow: var(--shadow-xl);
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px) scale(0.98);
            transition: all 0.3s ease;
            z-index: 1001;
            padding: 0.5rem 0;
        }

        .dropdown-menu.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0) scale(1);
        }

        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 0.8rem 1.5rem;
            color: #4A4A4A;
            text-decoration: none;
            transition: all 0.3s ease;
            font-weight: 500;
            position: relative;
            margin: 0 0.5rem;
            border-radius: 16px;
        }

        .dropdown-item:hover {
            background: linear-gradient(135deg, var(--pink-5), var(--cream));
            color: var(--pink-1);
            transform: translateX(5px);
        }

        .dropdown-item i {
            font-size: 1.1rem;
            transition: all 0.3s ease;
            color: var(--pink-2);
        }

        .dropdown-item:hover i {
            transform: scale(1.2);
            color: var(--pink-1);
        }

        .dropdown-item.active {
            background: linear-gradient(135deg, var(--pink-5), var(--cream));
            color: var(--pink-1);
        }

        .dropdown-item.active i {
            color: var(--pink-1);
        }

        /* Profile Section - Glam */
        .navbar-user {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .profile-dropdown {
            position: relative;
        }

        .btn-profile-dropdown {
            background: linear-gradient(135deg, var(--pink-5), var(--cream));
            border: 1px solid rgba(255, 107, 157, 0.3);
            border-radius: 60px;
            padding: 5px 18px 5px 8px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-profile-dropdown:hover {
            border-color: var(--pink-1);
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--pink-1), var(--gold));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 1rem;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            flex-shrink: 0;
        }

        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .user-info {
            text-align: left;
        }

        .user-name {
            font-weight: 700;
            color: #2D2D2D;
            font-size: 0.9rem;
        }

        .user-role {
            font-size: 0.7rem;
            color: var(--pink-1);
            font-weight: 600;
        }

        .dropdown-arrow-icon {
            color: var(--pink-1);
            font-size: 0.8rem;
            transition: transform 0.3s ease;
        }

        /* Profile Dropdown Menu */
        .profile-dropdown .dropdown-menu {
            position: absolute;
            top: calc(100% + 10px);
            right: 0;
            left: auto;
            min-width: 320px;
            padding: 0;
        }

        .profile-dropdown .dropdown-header {
            padding: 1.5rem;
            background: linear-gradient(135deg, var(--pink-5), var(--cream));
            border-radius: 24px 24px 0 0;
        }

        .profile-dropdown .dropdown-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--pink-1), var(--gold));
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
        }

        .profile-dropdown .dropdown-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .profile-dropdown .dropdown-fullname {
            font-weight: 800;
            color: #2D2D2D;
            margin-bottom: 0.25rem;
            font-size: 1rem;
        }

        .profile-dropdown .dropdown-email {
            font-size: 0.8rem;
            color: #8A8A8A;
        }

        /* Modern Logout Button */
        .btn-logout-desktop {
            background: linear-gradient(135deg, var(--pink-1), var(--gold));
            color: white;
            border: none;
            padding: 0.6rem 1.3rem;
            border-radius: 40px;
            font-weight: 600;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-md);
            cursor: pointer;
        }

        .btn-logout-desktop:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-glow);
        }

        /* Mobile Menu Toggle */
        .mobile-toggle {
            display: none;
            background: linear-gradient(135deg, var(--pink-1), var(--gold));
            border: none;
            color: white;
            width: 45px;
            height: 45px;
            border-radius: 15px;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.3rem;
            transition: all 0.3s ease;
        }

        .mobile-toggle:hover {
            transform: scale(1.05);
            box-shadow: var(--shadow-md);
        }

        /* Badge */
        .nav-badge {
            position: absolute;
            top: 18px;
            right: 5px;
            background: linear-gradient(135deg, var(--pink-1), var(--gold));
            color: white;
            font-size: 0.65rem;
            padding: 0.1rem 0.4rem;
            border-radius: 20px;
            font-weight: bold;
            animation: pulseGlow 1.5s infinite;
        }

        /* Main Content - Glassmorphism Light */
        .main-content-wrapper {
            margin-top: 120px;
            padding: 2rem;
            min-height: calc(100vh - 120px);
            position: relative;
            z-index: 1;
        }

        .main-content {
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(10px);
            border-radius: 48px;
            padding: 2rem;
            border: 1px solid rgba(255, 255, 255, 0.5);
            box-shadow: var(--shadow-xl);
            animation: fadeInUp 0.6s ease-out;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(40px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Overlay */
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(6px);
            z-index: 998;
            opacity: 0;
            visibility: hidden;
            transition: all 0.4s ease;
        }

        .overlay.active {
            opacity: 1;
            visibility: visible;
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar {
            width: 10px;
        }

        ::-webkit-scrollbar-track {
            background: var(--pink-5);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(135deg, var(--pink-1), var(--gold));
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(135deg, var(--pink-2), var(--rose-gold));
        }

        /* Responsive */
        @media (max-width: 1200px) {
            .nav-link {
                padding: 0 1rem;
                font-size: 0.85rem;
            }
        }

        @media (max-width: 992px) {
            .mobile-toggle {
                display: flex;
            }

            .navbar-menu {
                position: fixed;
                top: 0;
                left: -100%;
                width: 300px;
                max-width: 85%;
                height: 100vh;
                background: rgba(255, 255, 255, 0.98);
                backdrop-filter: blur(20px);
                flex-direction: column;
                align-items: stretch;
                padding: 2rem 0;
                transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
                border-right: 1px solid rgba(255, 107, 157, 0.2);
                box-shadow: var(--shadow-xl);
                overflow-y: auto;
            }

            .navbar-menu.active {
                left: 0;
            }

            .nav-item {
                height: auto;
            }

            .nav-link {
                height: auto;
                padding: 0.9rem 1.5rem;
                justify-content: flex-start;
                border-radius: 0;
            }

            .nav-link::before {
                bottom: auto;
                top: 50%;
                left: 0;
                transform: translateY(-50%) scaleX(0);
                width: 4px;
                height: 24px;
            }

            .nav-link:hover::before,
            .nav-link.active::before {
                transform: translateY(-50%) scaleX(1);
            }

            .btn-logout-desktop {
                display: none;
            }
        }

        @media (max-width: 768px) {
            .top-navbar {
                top: 10px;
                left: 10px;
                right: 10px;
                height: 70px;
            }

            .navbar-container {
                padding: 0 1.25rem;
            }

            .main-content-wrapper {
                padding: 1rem;
                margin-top: 100px;
            }
            
            .main-content {
                padding: 1.25rem;
                border-radius: 32px;
            }

            .brand-name {
                font-size: 1.2rem;
            }

            .brand-logo {
                width: 40px;
                height: 40px;
            }

            .navbar-brand::after {
                display: none;
            }

            .mobile-toggle {
                width: 40px;
                height: 40px;
                font-size: 1.1rem;
            }
        }

        @media (max-width: 576px) {
            .navbar-container {
                padding: 0 0.75rem;
            }

            .brand-text {
                display: flex; /* Keep visible but maybe smaller? */
            }

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

            .brand-tagline {
                font-size: 0.55rem;
                letter-spacing: 1px;
            }

            .user-info {
                display: none;
            }

            .btn-profile-dropdown {
                padding: 4px 8px 4px 4px;
            }
            
            .user-avatar {
                width: 32px;
                height: 32px;
            }
        }

        /* Custom Pagination Styling */
        .pagination {
            gap: 4px;
            margin-top: 1.25rem;
            flex-wrap: wrap;
            justify-content: center;
        }

        .page-item .page-link {
            border: 1px solid var(--pink-4);
            color: #4A4A4A;
            padding: 5px 12px;
            border-radius: 10px;
            font-weight: 600;
            font-size: 0.75rem;
            transition: all 0.3s ease;
            background: white;
            box-shadow: var(--shadow-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 34px;
            height: 34px;
        }

        .page-item:first-child .page-link,
        .page-item:last-child .page-link {
            border-radius: 10px;
            padding-left: 14px;
            padding-right: 14px;
        }

        .page-item.active .page-link {
            background: linear-gradient(135deg, var(--pink-1), var(--pink-2));
            border-color: transparent;
            color: white;
            box-shadow: var(--shadow-md);
        }

        .page-item .page-link:hover:not(.active) {
            background: var(--pink-5);
            color: var(--pink-1);
            border-color: var(--pink-1);
            transform: translateY(-2px);
        }

        .page-item.disabled .page-link {
            background: #f8f9fa;
            color: #adb5bd;
            border-color: #edf2f7;
            opacity: 0.6;
        }

        /* Responsive Pagination */
        @media (max-width: 576px) {
            .page-item .page-link {
                padding: 4px 10px;
                font-size: 0.7rem;
                min-width: 30px;
                height: 30px;
            }
        }

        /* Fix for giant SVG icons in Laravel Pagination */
        .pagination svg, 
        nav[role="navigation"] svg {
            width: 16px !important;
            height: 16px !important;
            display: inline-block;
            vertical-align: middle;
        }

        /* Tidy up the pagination info text */
        .pagination + div p,
        nav[role="navigation"] + div p {
            font-size: 0.75rem;
            color: #6b7280;
            margin-top: 0.5rem;
        }

        /* Hide the redundant large icons if they are not inside page-link */
        nav div.hidden.sm\:flex-1.sm\:flex.sm\:items-center.sm\:justify-between {
            display: none !important;
        }

        /* Live Clock Styling */
        .live-clock-container {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(255, 255, 255, 0.6);
            backdrop-filter: blur(10px);
            padding: 8px 20px;
            border-radius: 50px;
            border: 1px solid rgba(255, 107, 157, 0.2);
            box-shadow: var(--shadow-sm);
            transition: all 0.3s ease;
            margin: 0 15px;
        }

        .live-clock-container:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
            border-color: var(--pink-1);
        }

        .live-clock-container i {
            color: var(--pink-1);
            font-size: 1.1rem;
            animation: pulseGlow 2s infinite;
        }

        #live-clock {
            font-weight: 700;
            font-size: 1rem;
            background: linear-gradient(135deg, var(--pink-1), var(--pink-2));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-family: 'Plus Jakarta Sans', sans-serif;
            min-width: 80px;
            text-align: center;
        }

        @media (max-width: 1200px) {
            .live-clock-container {
                padding: 6px 15px;
                margin: 0 10px;
            }
            #live-clock {
                font-size: 0.9rem;
                min-width: 70px;
            }
        }
    </style>
</head>

<body>

    <!-- Animated Background - Light & Airy -->
    <div class="animated-bg">
        <div class="gradient-sphere sphere-1"></div>
        <div class="gradient-sphere sphere-2"></div>
        <div class="gradient-sphere sphere-3"></div>
        <div class="gradient-sphere sphere-4"></div>
    </div>

    <!-- SPLASH SCREEN - Luxury Light -->
    <div id="splash-screen"
        style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, #FFF9F5 0%, #FFF0F5 50%, #FFE0EB 100%); z-index: 9999; display: flex; align-items: center; justify-content: center; transition: opacity 0.8s ease;">
        <div style="text-align: center;">
            <div style="width: 200px; height: 200px; margin: 0 auto 30px; perspective: 1000px;">
                <div style="width: 100%; height: 100%; position: relative; transform-style: preserve-3d; animation: flip 2.5s infinite;">
                    <div style="position: absolute; width: 100%; height: 100%; backface-visibility: hidden;">
                        <img src="{{ asset('images/logo3.jpg') }}" alt="Kei's Store"
                            style="width: 100%; height: 100%; object-fit: cover; border-radius: 50px; box-shadow: 0 30px 50px rgba(255, 107, 157, 0.3);">
                    </div>
                    <div style="position: absolute; width: 100%; height: 100%; backface-visibility: hidden; transform: rotateY(180deg); background: linear-gradient(135deg, #FF6B9D, #FFD700); border-radius: 50px; display: flex; align-items: center; justify-content: center;">
                        <i class="bi bi-flower1" style="font-size: 80px; color: white;"></i>
                    </div>
                </div>
            </div>
            <h2 style="background: linear-gradient(135deg, #FF6B9D, #FFD700, #FF85B3); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; margin-bottom: 10px; font-size: 2.8rem; font-family: 'Playfair Display', serif;">Kei's Store</h2>
            <p style="color: #FF6B9D; font-weight: 500; letter-spacing: 3px;">✦ LUXURY BEAUTY ✦</p>
            <div style="display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 30px;">
                <div style="width: 40px; height: 40px; border: 3px solid rgba(255, 107, 157, 0.2); border-top: 3px solid #FF6B9D; border-radius: 50%; animation: spin 1s linear infinite;"></div>
            </div>
        </div>
    </div>

    <!-- Top Navbar -->
    <nav class="top-navbar" id="topNavbar">
        <div class="navbar-container">
            <a href="{{ route('dashboard') }}" class="navbar-brand">
                <div class="brand-logo">
                    <img src="{{ asset('images/logo3.jpg') }}" alt="Kei's Store"
                        onerror="this.style.display='none'; this.parentNode.innerHTML='<i class=\'bi bi-flower1\'></i>';">
                </div>
                <div class="brand-text">
                    <div class="brand-name">Kei's Store</div>
                    <div class="brand-tagline">BEAUTY & ELEGANCE</div>
                </div>
            </a>

            <div class="live-clock-container d-none d-md-flex">
                <i class="bi bi-clock-fill"></i>
                <span id="live-clock">00:00:00</span>
            </div>

            <button class="mobile-toggle" id="mobileToggle">
                <i class="bi bi-grid-3x3-gap-fill"></i>
            </button>

            <div class="navbar-menu" id="navbarMenu">
                @auth
                    <div class="mobile-user-info d-block d-lg-none" style="padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,107,157,0.15); margin-bottom: 1rem;">
                        <div class="d-flex align-items-center gap-3">
                                <div class="user-avatar shadow-sm">
                                    <img src="{{ auth()->user()->avatar_url }}" alt="{{ auth()->user()->username }}" onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';">
                                    <img src="https://ui-avatars.com/api/?name={{ urlencode(auth()->user()->username) }}&background=FF85B3&color=fff&bold=true" style="display: none; width: 100%; height: 100%; object-fit: cover;">
                                </div>
                            <div class="flex-grow-1">
                                <div style="color: #2D2D2D; font-weight: 700;">{{ auth()->user()->username }}</div>
                                <div style="color: var(--pink-1); font-size: 0.75rem; font-weight: 600;">{{ ucfirst(auth()->user()->role) }}</div>
                            </div>
                        </div>
                    </div>
                @endauth

                <div class="nav-item">
                    <a href="{{ route('dashboard') }}" class="nav-link {{ request()->routeIs('dashboard') ? 'active' : '' }}">
                        <i class="bi bi-house-heart-fill"></i>
                        <span>Dashboard</span>
                    </a>
                </div>

                @auth
                    @if (auth()->user()->role === 'admin')
                        <div class="nav-item dropdown">
                            <a href="javascript:void(0)" class="nav-link dropdown-toggle" onclick="toggleDropdown('masterData')">
                                <i class="bi bi-crown-fill"></i>
                                <span>Master Data</span>
                                <i class="bi bi-chevron-down" style="font-size: 0.8rem;"></i>
                            </a>
                            <div class="dropdown-menu" id="dropdownMasterData">
                                <a href="{{ route('kategori.index') }}" class="dropdown-item {{ request()->routeIs('kategori.*') ? 'active' : '' }}">
                                    <i class="bi bi-tag-fill"></i>
                                    <span>Merk</span>
                                </a>
                                <a href="{{ route('product.index') }}" class="dropdown-item {{ request()->routeIs('product.*') ? 'active' : '' }}">
                                    <i class="bi bi-bag-heart-fill"></i>
                                    <span>Produk</span>
                                </a>
                                <a href="{{ route('users.index') }}" class="dropdown-item {{ request()->routeIs('users.*') ? 'active' : '' }}">
                                    <i class="bi bi-people-fill"></i>
                                    <span>User</span>
                                </a>
                            </div>
                        </div>

                        <div class="nav-item dropdown">
                            <a href="javascript:void(0)" class="nav-link dropdown-toggle" onclick="toggleDropdown('transaksiAdmin')">
                                <i class="bi bi-wallet-fill"></i>
                                <span>Transaksi</span>
                                <i class="bi bi-chevron-down" style="font-size: 0.8rem;"></i>
                            </a>
                            <div class="dropdown-menu" id="dropdownTransaksiAdmin">
                                <a href="{{ route('penjualan.index') }}" class="dropdown-item {{ request()->routeIs('penjualan.*') ? 'active' : '' }}">
                                    <i class="bi bi-cart-check-fill"></i>
                                    <span>Order</span>
                                </a>
                                <a href="{{ route('laporan.index') }}" class="dropdown-item {{ request()->routeIs('laporan.*') ? 'active' : '' }}">
                                    <i class="bi bi-graph-up"></i>
                                    <span>Laporan</span>
                                </a>
                            </div>
                        </div>

                        <div class="nav-item">
                            <a href="{{ route('pengiriman.index') }}" class="nav-link {{ request()->routeIs('pengiriman.*') ? 'active' : '' }}">
                                <i class="bi bi-send-fill"></i>
                                <span>Pengiriman</span>
                            </a>
                        </div>
                    @elseif(auth()->user()->role === 'pengguna')
                        <div class="nav-item dropdown">
                            <a href="javascript:void(0)" class="nav-link dropdown-toggle" onclick="toggleDropdown('transaksiPengguna')">
                                <i class="bi bi-bag-fill"></i>
                                <span>Belanja</span>
                                <i class="bi bi-chevron-down" style="font-size: 0.8rem;"></i>
                            </a>
                            <div class="dropdown-menu" id="dropdownTransaksiPengguna">
                                <a href="{{ route('cart.index') }}" class="dropdown-item {{ request()->routeIs('cart.*') ? 'active' : '' }}">
                                    <i class="bi bi-cart-fill"></i>
                                    <span>Keranjang</span>
                                    <span class="nav-badge" id="cartBadge">0</span>
                                </a>
                                <a href="{{ route('product.index') }}" class="dropdown-item {{ request()->routeIs('product.index') ? 'active' : '' }}">
                                    <i class="bi bi-grid-3x3-gap-fill"></i>
                                    <span>Produk</span>
                                </a>
                                <a href="{{ route('penjualan.index') }}" class="dropdown-item {{ request()->routeIs('penjualan.index') ? 'active' : '' }}">
                                    <i class="bi bi-clock-fill"></i>
                                    <span>Order</span>
                                </a>
                            </div>
                        </div>
                    @endif
                @endauth
            </div>

            @auth
                <div class="navbar-user">
                    <div class="profile-dropdown">
                        <button class="btn-profile-dropdown" type="button" id="profileDropdown" onclick="toggleProfileDropdown()">
                            <div class="user-profile">
                                <div class="user-avatar shadow-sm">
                                    <img src="{{ auth()->user()->avatar_url }}" alt="{{ auth()->user()->username }}" onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';">
                                    <img src="https://ui-avatars.com/api/?name={{ urlencode(auth()->user()->username) }}&background=FF85B3&color=fff&bold=true" style="display: none; width: 100%; height: 100%; object-fit: cover;">
                                </div>
                                <div class="user-info d-none d-md-block">
                                    <div class="user-name">{{ auth()->user()->username }}</div>
                                    <div class="user-role">{{ ucfirst(auth()->user()->role) }}</div>
                                </div>
                                <i class="bi bi-chevron-down dropdown-arrow-icon"></i>
                            </div>
                        </button>

                        <div class="dropdown-menu" id="profileDropdownMenu">
                            <div class="dropdown-header">
                                <div class="d-flex align-items-center gap-3">
                                    <div class="dropdown-avatar shadow-sm">
                                        <img src="{{ auth()->user()->avatar_url }}" alt="{{ auth()->user()->username }}" onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';">
                                    <img src="https://ui-avatars.com/api/?name={{ urlencode(auth()->user()->username) }}&background=FF85B3&color=fff&bold=true" style="display: none; width: 100%; height: 100%; object-fit: cover;">
                                    </div>
                                    <div class="flex-grow-1 text-start">
                                        <div class="dropdown-fullname">{{ auth()->user()->fullname ?? auth()->user()->username }}</div>
                                        <div class="dropdown-email">{{ auth()->user()->email }}</div>
                                    </div>
                                </div>
                            </div>
                            <a class="dropdown-item" href="{{ route('profile.show') }}">
                                <i class="bi bi-person-circle"></i>
                                <span>Lihat Profile</span>
                            </a>
                            <a class="dropdown-item" href="{{ route('profile.edit') }}">
                                <i class="bi bi-pencil-square"></i>
                                <span>Edit Profile</span>
                            </a>
                
                            <div class="dropdown-divider" style="margin: 0.5rem 0; border-color: rgba(255,107,157,0.15);"></div>
                            <form action="{{ route('logout') }}" method="POST">
                                @csrf
                                <button type="submit" class="dropdown-item text-danger" style="width: 100%;" onclick="return confirm('Yakin ingin logout?')">
                                    <i class="bi bi-box-arrow-right"></i>
                                    <span>Logout</span>
                                </button>
                            </form>
                        </div>
                    </div>

                    <button type="button" class="btn-logout-desktop d-none d-lg-flex" onclick="document.getElementById('logout-form-desktop').submit()">
                        <i class="bi bi-box-arrow-right"></i>
                        <span>Logout</span>
                    </button>
                    <form id="logout-form-desktop" action="{{ route('logout') }}" method="POST" class="d-none">
                        @csrf
                    </form>
                </div>
            @endauth
        </div>
    </nav>

    <div class="overlay" id="overlay"></div>

    <div class="main-content-wrapper">
        <main class="main-content">
            @yield('content')

            @hasSection('content')
            @else
                <div class="text-center py-5">
                    <img src="{{ asset('images/logo3.jpg') }}" class="mb-4 shadow-lg" style="width: 120px; height: 120px; border-radius: 40px; object-fit: cover; border: 4px solid white; animation: pulseGlow 2s infinite;">
                    <h2 style="background: linear-gradient(135deg, #FF6B9D, #FFD700); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; font-family: 'Playfair Display', serif;">Welcome to Kei's Store</h2>
                    <p style="color: #8A8A8A; margin-top: 1rem; font-weight: 500;">Discover luxury beauty products ✨</p>
                </div>
            @endif
        </main>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    @stack('scripts')

    <script>


        // Clock Logic
        function updateClock() {
            const now = new Date();
            const hours = String(now.getHours()).padStart(2, '0');
            const minutes = String(now.getMinutes()).padStart(2, '0');
            const seconds = String(now.getSeconds()).padStart(2, '0');
            const clockElement = document.getElementById('live-clock');
            if (clockElement) {
                clockElement.textContent = `${hours}:${minutes}:${seconds}`;
            }
        }

        // Splash Screen
        document.addEventListener('DOMContentLoaded', function() {
            updateClock();
            setInterval(updateClock, 1000);
            
            setTimeout(() => {
                const splash = document.getElementById('splash-screen');
                splash.style.opacity = '0';
                setTimeout(() => splash.style.display = 'none', 800);
            }, 2500);
        });

        // Navbar Scroll Effect
        window.addEventListener('scroll', () => {
            const navbar = document.getElementById('topNavbar');
            if (window.scrollY > 50) {
                navbar.classList.add('scrolled');
            } else {
                navbar.classList.remove('scrolled');
            }
        });

        // Mobile Menu
        const mobileToggle = document.getElementById('mobileToggle');
        const navbarMenu = document.getElementById('navbarMenu');
        const overlay = document.getElementById('overlay');

        if (mobileToggle) {
            mobileToggle.addEventListener('click', () => {
                navbarMenu.classList.toggle('active');
                overlay.classList.toggle('active');
                closeProfileDropdown();
            });
        }

        if (overlay) {
            overlay.addEventListener('click', () => {
                navbarMenu.classList.remove('active');
                overlay.classList.remove('active');
                closeAllDropdowns();
                closeProfileDropdown();
            });
        }

        // Dropdown Functions
        function toggleProfileDropdown() {
            const dropdown = document.getElementById('profileDropdownMenu');
            const isOpen = dropdown.classList.contains('show');
            closeAllDropdowns();
            if (isOpen) {
                dropdown.classList.remove('show');
            } else {
                dropdown.classList.add('show');
            }
        }

        function closeProfileDropdown() {
            const dropdown = document.getElementById('profileDropdownMenu');
            if (dropdown) dropdown.classList.remove('show');
        }

        function toggleDropdown(dropdownId) {
            const dropdown = document.getElementById('dropdown' + dropdownId.charAt(0).toUpperCase() + dropdownId.slice(1));
            const isMobile = window.innerWidth <= 992;
            closeProfileDropdown();

            if (isMobile) {
                if (dropdown.style.display === 'block') {
                    dropdown.style.display = 'none';
                } else {
                    closeAllDropdowns();
                    dropdown.style.display = 'block';
                }
            } else {
                if (dropdown.classList.contains('show')) {
                    dropdown.classList.remove('show');
                } else {
                    closeAllDropdowns();
                    dropdown.classList.add('show');
                }
            }
        }

        function closeAllDropdowns() {
            const dropdowns = document.querySelectorAll('.dropdown-menu:not(#profileDropdownMenu)');
            dropdowns.forEach(dropdown => {
                dropdown.classList.remove('show');
                dropdown.style.display = '';
            });
        }

        document.addEventListener('click', (event) => {
            if (!event.target.closest('.profile-dropdown') && window.innerWidth > 992) {
                closeProfileDropdown();
            }
            if (!event.target.closest('.navbar-menu') && !event.target.closest('.mobile-toggle') && window.innerWidth > 992) {
                closeAllDropdowns();
            }
        });

        // Close mobile menu on link click
        document.querySelectorAll('.nav-link, .dropdown-item').forEach(link => {
            link.addEventListener('click', () => {
                if (window.innerWidth <= 992 && !link.classList.contains('dropdown-toggle')) {
                    navbarMenu.classList.remove('active');
                    overlay.classList.remove('active');
                }
            });
        });

        // Update cart badge
        function updateCartBadge() {
            const cartBadge = document.getElementById('cartBadge');
            if (cartBadge) {
                const cartCount = localStorage.getItem('cartCount') || 0;
                cartBadge.textContent = cartCount;
                cartBadge.style.display = cartCount > 0 ? 'flex' : 'none';
            }
        }

        document.addEventListener('DOMContentLoaded', () => {
            updateCartBadge();
            const activeItem = document.querySelector('.dropdown-item.active');
            if (activeItem) {
                const dropdown = activeItem.closest('.dropdown-menu');
                if (dropdown && dropdown.id !== 'profileDropdownMenu') {
                    const parentLink = dropdown.previousElementSibling;
                    if (parentLink?.classList.contains('dropdown-toggle')) {
                        parentLink.classList.add('active');
                        dropdown.classList.add('show');
                        if (window.innerWidth <= 992) dropdown.style.display = 'block';
                    }
                }
            }
        });
    </script>
</body>

</html>