/* ฟอนต์ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

body {
    margin: 0;
    background: #05070a;
    font-family: 'Kanit', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
    color: #fff;
}

/* ========== HERO SECTION ========== */
.gp-hero {
    position: relative;
    min-height: 500px;
    background: radial-gradient(circle at top left, #1d2939 0, #05070a 55%, #020308 100%);
    overflow: hidden;
}

.gp-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url("<?= !empty($shop_data['cover_image']) ? 'plugins/image/cards_discord/' . htmlspecialchars($shop_data['cover_image']) : 'template/defoult/images/default-cover.jpg' ?>");
    background-position: right center;
    background-size: cover;
    opacity: 0.35;
    filter: blur(4px);
    transform: scale(1.05);
    padding-top: 40px;
}

.gp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(7, 10, 19, 0.96) 0%,
        rgba(7, 10, 19, 0.92) 35%,
        rgba(7, 10, 19, 0.6) 60%,
        rgba(7, 10, 19, 0.1) 100%
    );
}

.gp-hero-inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 150px 24px 0px;
    z-index: 2;
}

.gp-hero-content {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.gp-app-icon img {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

.gp-app-info {
    flex: 1;
    max-width: 560px;
}

.gp-app-title {
    font-size: 2.4rem;
    font-weight: 600;
    margin: 0 0 8px;
    text-align: left !important;
}

.gp-app-meta-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #cbd5f5;
}

.gp-dev-name {
    font-weight: 500;
}

.gp-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 255, 0.2);
    border: 1px solid rgba(148, 163, 255, 0.4);
    font-size: 0.8rem;
}

.gp-stat-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #d0d7ff;
}

.gp-stat-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gp-stat-main {
    font-size: 1rem;
    font-weight: 600;
}

.gp-stat-sub {
    font-size: 0.78rem;
    color: #9ca3c7;
}

.gp-stat-separator {
    width: 1px;
    background: rgba(148, 163, 255, 0.25);
    align-self: stretch;
}

.gp-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gp-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
    white-space: nowrap;
    font-family: 'Kanit', sans-serif;
}

.gp-btn-primary {
    background: #10b981;
    color: #04101a;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

.gp-btn-primary:hover {
    background: #0ea271;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.55);
}

.gp-btn-outline {
    background: transparent;
    color: #e5edff;
    border: 1px solid rgba(148, 163, 255, 0.7);
}

.gp-btn-outline:hover {
    background: rgba(148, 163, 255, 0.08);
}

.gp-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 255, 0.45);
    background: rgba(15, 23, 42, 0.85);
    color: #e5edff;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.1s ease, border-color 0.18s ease;
}

.gp-icon-btn:hover {
    background: rgba(148, 163, 255, 0.2);
    border-color: rgba(148, 163, 255, 0.9);
    transform: translateY(-1px);
}

/* ========== DETAILS SECTION ========== */
.gp-details {
    background: #f9fafb;
    padding: 32px 0 40px;
    border-top: 1px solid rgba(15, 23, 42, 0.6);
}

.gp-details-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 32px;
}

.gp-details-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ปุ่ม "ตัวอย่าง" มุมขวาล่าง */
.gp-preview-pill {
    position: absolute;
    right: 40px;
    bottom: 32px;
    padding: 8px 18px;
    border-radius: 999px;
    border: none;
    background: #050709;
    color: #f9fafb;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
    transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
}

.gp-preview-pill:hover {
    background: #090c10;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.8);
}

.gp-preview-icon {
    font-size: 0.9rem;
}

/* Modal วิดีโอ */

.gp-video-modal {
    position: fixed;
    inset: 0;
    display: none;              /* ซ่อนไว้ก่อน */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.gp-video-modal.is-open {
    display: flex;
}

.gp-video-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.gp-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(4px);
    opacity: 0.4;
}


.gp-video-dialog {
    position: relative;
    width: min(900px, 90vw);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
    z-index: 1;
}

.gp-video-frame {
    width: 100%;
    height: 100%;
}

.gp-video-frame iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.gp-video-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gp-video-close:hover {
    background: rgba(31, 41, 55, 0.95);
}

@media (max-width: 768px) {
    .gp-preview-pill {
        right: 16px;
        bottom: 16px;
    }
}


/* Gallery */
.gp-gallery {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 16px 48px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.gp-gallery-main img {
    width: 100%;
    max-height: 400px;
    border-radius: 16px;
    object-fit: cover;
}

.gp-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.gp-gallery-thumbs img {
    width: 140px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.gp-gallery-thumbs img.is-active,
.gp-gallery-thumbs img:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.25);
}

.gp-section {
    background: #fff;
    border-radius: 20px;
    padding: 20px 20px 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.gp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.gp-section-header h2 {
    font-size: 1.35rem;
    margin: 0;
    color: #111827;
}

.gp-link-inline {
    font-size: 0.9rem;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}

.gp-link-inline:hover {
    text-decoration: underline;
}

/* กล่องบทความหลัก (เผื่อคุณใช้คลาสนี้อยู่แล้ว) */
.gp-body-text,
.gp-body-article {
    text-align: left;      /* ให้ข้อความชิดซ้าย */
    line-height: 1.7;
    font-size: 15px;
    color: black;
}

/* ให้ทุก <p> ข้างในบทความชิดซ้าย */
.gp-body-text p,
.gp-body-article p {
    text-align: left;
    margin: 0 0 1rem;
    color: black;
}

/* =========================
   จัดการรูปภาพในบทความ
   HTML: <figure class="image"><img ...></figure>
   ========================= */

/* กล่องครอบรูป */
figure.image {
    margin: 16px 0;
    text-align: center;           /* รูปอยู่กลาง */
}

/* รูปภาพให้ปรับตามพื้นที่และรองรับทุกหน้าจอ */
figure.image img,
img.image {                        /* เผื่อใช้ class="image" ตรง ๆ */
    display: block;
    max-width: 100%;               /* ไม่ให้เกินความกว้าง container */
    height: auto;                  /* รักษาสัดส่วนรูป */
    margin: 0 auto;                /* กึ่งกลางแนวนอน */
    border-radius: 8px;            /* มุมโค้งนิด ๆ (เอาออกได้ถ้าไม่ชอบ) */
    object-fit: contain;           /* ใส่ในกรอบอย่างสมดุลไม่เบี้ยว */
}

/* ถ้ารูปใหญ่มากในหน้าจอใหญ่ ๆ อยากจำกัดไม่ให้กว้างเกินไป */
.gp-body-article figure.image img {
    max-width: 100%;              /* ปรับเลขได้ตามดีไซน์คุณ */
}

/* ครอบทุกอย่างในบทความให้อยู่ในกรอบเสมอ */
/* บังคับ container บทความไม่ให้มี overflow */
.gp-about {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* บังคับ figure ให้ไม่เกิน container */
.gp-about figure.image {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px auto;
    padding: 0;
    overflow: hidden;
}

/* บังคับรูปภาพใน figure ให้ไม่สามารถหลุดออกไปได้ */
.gp-about figure.image > img {
    display: block;
    width: 100% !important;        /* บังคับยืดตาม container */
    max-width: 100% !important;    /* กันเกิน */
    height: auto !important;       /* รักษาสัดส่วน */
    object-fit: contain !important;
    border-radius: 8px;
}

/* รูปภาพต้องยุบตาม container */
.gp-about img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    margin: 16px auto;
    object-fit: contain;
}

/* figure ก็ห้ามเกินขอบ */
.gp-about figure {
    max-width: 100% !important;
    margin: 16px auto;
    text-align: center;
}

/* iframe เช่น YouTube ต้องตอบสนองมือถือ */
.gp-about iframe {
    max-width: 100% !important;
    width: 100% !important;
    height: auto;
}

/* ข้อความให้อยู่ซ้าย */
.gp-about p {
    text-align: left;
}



.gp-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.86rem;
}

.gp-meta-label {
    color: #6b7280;
}

.gp-meta-value {
    color: #111827;
    font-weight: 500;
}

.gp-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.gp-tag {
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4ff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
}

/* Sidebar */
.gp-details-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gp-sidebar-card {
    background: #111827;
    color: #e5e7eb;
    border-radius: 20px;
    padding: 18px 18px 20px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.6);
    font-size: 0.9rem;
}

.gp-sidebar-primary {
    background: #020617;
}

.gp-sidebar-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.gp-sidebar-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: radial-gradient(circle at 30% 20%, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.gp-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    text-align: left !important;
    margin-bottom: 2px;
}

.gp-sidebar-subtitle {
    font-size: 0.8rem;
    color: #9ca3af;
}

.gp-sidebar-link {
    display: inline-block;
    margin: 4px 0 10px;
}

.gp-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gp-sidebar-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    text-align: left !important;
}

.gp-sidebar-list li::before {
    content: "•";
    position: absolute;
    left: 2px;
    top: 0;
    color: #22c55e;
}

.gp-spec-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}

.gp-spec-list li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.9);
}

.gp-spec-list li:last-child {
    border-bottom: none;
}

.gp-spec-label {
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: left !important;
}

.gp-spec-value {
    font-size: 0.88rem;
    text-align: left !important;
}

/* Related Shops */
.related-shops-section {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    margin-top: 24px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.related-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: black;
    display: block;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    background: linear-gradient(135deg, #1e1e1f 0%, #1e1e1f 100%);
    color: white;
}

.related-card img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 8px;
    object-fit: cover;
}

.related-card-name {
    font-size: 0.85rem;
    color: #000;
    font-weight: 600;
    margin-bottom: 4px;
}

.related-card-views {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Breadcrumb */
.breadcrumb-nav {
    background: transparent;
    padding: 15px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb-nav a {
    color: #cbd5f5;
    text-decoration: none;
    font-weight: 400;
    transition: opacity 0.2s ease;
}

.breadcrumb-nav a:hover {
    opacity: 0.8;
}

.breadcrumb-nav span {
    color: #9ca3c7;
    margin: 0 8px;
}

.breadcrumb-current {
    color: white;
    font-weight: 500;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .gp-details-inner {
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .gp-hero-inner {
        padding: 32px 16px 24px;
    }

    .gp-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .gp-app-title {
        font-size: 1.8rem;
    }

    .gp-stat-row {
        flex-wrap: wrap;
    }
    
    .gp-details {
        padding: 24px 0 32px;
    }

    .gp-details-inner {
        padding: 0 16px;
        grid-template-columns: minmax(0, 1fr);
    }

    .gp-gallery {
        padding: 12px 32px;
    }

    .gp-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}