<!DOCTYPE html>
<html lang="en">
<head>
    <?php require $_SERVER['DOCUMENT_ROOT'].'/hethong/head2.php';?>
    <title>Kho Mẫu Logo Sáng Tạo | <?=$lxtdev['ten_web'];?></title>
    <?php require $_SERVER['DOCUMENT_ROOT'].'/hethong/nav.php';?>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">

    <style>
        /* Tối ưu hóa thẻ Card danh mục Logo cao cấp */
        .premium-logo-card {
            border: 1px solid rgba(0, 0, 0, 0.05) !important;
            border-radius: 16px !important;
            background: #ffffff;
            overflow: hidden;
            transition: all 0.3s ease-in-out !important;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
        }
        
        .premium-logo-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08) !important;
            border-color: rgba(48, 133, 214, 0.2) !important;
        }

        [data-bs-theme="dark"] .premium-logo-card {
            background: #1e1e2d;
            border: 1px solid rgba(255, 255, 255, 0.05) !important;
        }
        [data-bs-theme="dark"] .premium-logo-card:hover {
            border-color: rgba(48, 133, 214, 0.4) !important;
        }

        /* Khung chứa ảnh tỷ lệ cố định chống vỡ giao diện */
        .logo-image-wrapper {
            position: relative;
            width: 100%;
            padding-top: 75%; /* Tỷ lệ khung hình 4:3 */
            overflow: hidden;
            background: #f8fafc;
        }
        [data-bs-theme="dark"] .logo-image-wrapper {
            background: #151521;
        }

        .logo-image-wrapper img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .premium-logo-card:hover .logo-image-wrapper img {
            transform: scale(1.08);
        }

        .logo-title {
            font-size: 1.1rem !important;
            font-weight: 700 !important;
            color: #181c32 !important;
            transition: color 0.2s ease;
        }
        [data-bs-theme="dark"] .logo-title {
            color: #cdcdde !important;
        }
        .premium-logo-card:hover .logo-title {
            color: #3085d6 !important;
        }
    </style>
</head>

<body id="kt_app_body" data-kt-app-layout="light-sidebar" data-kt-app-header-fixed="true"
    data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="true"
    data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true"
    data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default">
    
    <script>var defaultThemeMode = "light"; var themeMode; if (document.documentElement) { if (document.documentElement.hasAttribute("data-bs-theme-mode")) { themeMode = document.documentElement.getAttribute("data-bs-theme-mode"); } else { if (localStorage.getItem("data-bs-theme") !== null) { themeMode = localStorage.getItem("data-bs-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-bs-theme", themeMode); }</script>
    
    <div class="d-flex flex-column flex-root app-root" id="kt_app_root">
        <div class="app-page flex-column flex-column-fluid" id="kt_app_page">
            
            <div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
                <?php require $_SERVER['DOCUMENT_ROOT'].'/hethong/sider.php';?>
            </div>
            
            <div class="app-main flex-column flex-row-fluid" id="kt_app_main">
                <div class="d-flex flex-column flex-column-fluid">
                    
                    <div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
                        <div id="kt_app_toolbar_container" class="app-container container-fluid d-flex flex-stack">
                            <div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
                                <h1 class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0">
                                    <i class="fa-solid fa-palette text-primary fs-4 mb-1"></i> Kho Hệ Thống Mẫu Logo
                                </h1>
                                <ul class="breadcrumb breadcrumb-separatorless fw-semibold fs-7 my-0 pt-1">
                                    <li class="breadcrumb-item text-muted"><a href="/" class="text-muted text-hover-primary">Home</a></li>
                                    <li class="breadcrumb-item"><span class="bullet bg-gray-400 w-5px h-2px"></span></li>
                                    <li class="breadcrumb-item text-muted">Graphics Design</li>
                                </ul>
                            </div>
                            <div class="d-flex align-items-center gap-2 gap-lg-3">
                                <a href="#" class="btn btn-sm fw-bold btn-light-success px-4 py-3" data-bs-toggle="modal" data-bs-target="#kt_modal_create_app">
                                    <i class="fa-solid fa-wallet me-1"></i> <?=tien($user['money']);?>đ
                                </a>
                            </div>
                        </div>
                    </div>

                    <div id="kt_app_content" class="app-content flex-column-fluid">
                        <div class="container-xxl" id="kt_content_container">
                            
                            <div class="row g-6 g-xl-9">
                                <?php
                                $result = mysqli_query($ketnoi,"SELECT * FROM `mau_logo` ORDER BY `id` DESC ");
                                while($row = mysqli_fetch_assoc($result)) { ?>
                                
                                <div class="col-sm-6 col-xl-4">
                                    <div class="card premium-logo-card h-100">
                                        
                                        <div class="logo-image-wrapper">
                                            <img src="<?=$row['image'];?>" alt="<?=$row['name'];?>" loading="lazy" />
                                        </div>

                                        <div class="card-body p-6 d-flex flex-column justify-content-between">
                                            <div class="mb-5 text-center">
                                                <h3 class="logo-title mb-3 text-hover-primary">
                                                    <?=$row['name'];?>
                                                </h3>
                                                
                                                <div class="d-flex flex-center mt-2">
                                                    <span class="badge badge-light-primary fs-5 fw-boldest px-4 py-2 rounded-pill">
                                                        <?=tien($row['price']);?> <span class="fs-7 fw-normal ms-0.5">đ</span>
                                                    </span>
                                                </div>
                                            </div>

                                            <div class="pt-2">
                                                <a href="/tao-logo/<?=$row['id'];?>" class="btn btn-primary fw-bold w-100 py-3 shadow-sm">
                                                    <i class="fa-solid fa-wand-magic-sparkles me-1"></i> Khởi Tạo Thiết Kế Ngay
                                                </a>
                                            </div>
                                        </div>
                                        
                                    </div>
                                </div>
                                <?php } ?>
                            </div>

                        </div>
                    </div>
                    
                </div>
                
                <?php require $_SERVER['DOCUMENT_ROOT'].'/hethong/foot.php';?>
            </div>
        </div>
    </div>
</body>
</html>
