/**
 * Market Homepage Sections
 * Banner, Games, Accounts, Shops, Trust Badges
 * Version: 1.0.0
 */

/* Homepage swiper — breathing room for card hover translateY(-2px) + box-shadow */
.swiper {
    padding: 6px 0;
    margin-top: -6px;
    margin-bottom: -6px;
}

/* Section shared */
.market-section {
    margin-bottom: 3rem;
}

/* Box-game wrapper — white card container like 4gamerviet */
.box-game {
    background: var(--market-bg-card);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    box-shadow: var(--market-shadow-sm);
    margin-bottom: 3rem;
    overflow: visible;
}

@media (max-width: 768px) {
    .box-game {
        padding: 1rem;
        border-radius: 0.75rem;
    }
}

/* Section title — like 4gamerviet .name-games-title */
.market-section-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--market-space-md);
}

.market-section-title {
    display: flex;
    align-items: center;
    gap: var(--market-space-sm);
    font-size: 21px;
    font-weight: 700;
    color: var(--market-text-primary);
    margin: 0;
    text-transform: uppercase;
}

.market-section-title .iconify {
    font-size: 1.4em;
    color: var(--market-primary-text);
}

.market-section-header .market-section-title {
    margin-bottom: 0;
}

/* Circular blue "more" button — like 4gamerviet .more-game */
.market-section-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: var(--market-primary);
    color: #fff;
    text-decoration: none;
    margin-left: 1rem;
    font-size: 20px;
    flex-shrink: 0;
    transition: var(--market-transition);
}

.market-section-more:hover {
    background: var(--market-primary-light);
    transform: scale(1.1);
}

.market-section-more:focus-visible {
    outline: 2px solid var(--market-focus-ring);
    outline-offset: 2px;
}

/* "Xem tất cả" text link at bottom — like 4gamerviet .view-all-text */
.market-view-all {
    text-align: center;
    margin-top: var(--market-space-md);
}

.market-view-all a {
    font-size: 1rem;
    font-weight: 600;
    color: var(--market-primary-text);
    text-decoration: none;
}

.market-view-all a .iconify {
    font-size: 1.5rem;
    vertical-align: middle;
}

.market-view-all a:focus-visible {
    outline: 2px solid var(--market-focus-ring);
    outline-offset: 2px;
}

/* Banner Slider */
.market-banner-section {
    margin-bottom: var(--market-space-xl);
    border-radius: var(--market-radius-md);
    overflow: hidden;
}

.market-banner-swiper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--market-radius-md);
    aspect-ratio: 3 / 1;
    object-fit: cover;
}

.market-banner-pagination {
    position: relative;
    margin-top: var(--market-space-sm);
    text-align: center;
}

.market-banner-pagination .swiper-pagination-bullet {
    background: var(--market-text-secondary);
    opacity: 0.5;
}

.market-banner-pagination .swiper-pagination-bullet-active {
    background: var(--market-primary);
    opacity: 1;
}

/* Swiper Pause/Play Toggle */
.market-swiper-pause {
    position: absolute;
    bottom: var(--market-space-sm);
    right: var(--market-space-sm);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: var(--market-transition);
}

.market-swiper-pause:hover {
    background: rgba(0, 0, 0, 0.7);
}

.market-swiper-pause:focus-visible {
    outline: 2px solid var(--market-focus-ring);
    outline-offset: 2px;
}

.market-banner-section .market-swiper-pause {
    bottom: auto;
    top: var(--market-space-sm);
}

/* Game Icons Grid — tag/pill style like 4gamerviet */
.market-games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--market-space-md);
}

@media (max-width: 768px) {
    .market-games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--market-space-sm);
    }
}

/* Game Categories — grid cards like 4gamerviet */
.market-game-swiper .swiper-slide {
    height: auto;
}

.market-game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px;
    border-radius: var(--market-radius-md);
    text-decoration: none;
    transition: var(--market-transition);
    text-align: center;
}

.market-game-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--market-shadow-sm);
}

.market-game-card:focus-visible {
    outline: 2px solid var(--market-focus-ring);
    outline-offset: 2px;
}

.market-game-logo {
    width: 50px;
    height: 50px;
    border-radius: 35%;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.market-game-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.market-game-name {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.market-game-count {
    font-size: 0.7rem;
    color: var(--market-text-muted);
}

.market-game-pagination {
    position: relative;
    margin-top: var(--market-space-sm);
    text-align: center;
}

.market-game-pagination .swiper-pagination-bullet {
    background: var(--market-text-secondary);
    opacity: 0.5;
}

.market-game-pagination .swiper-pagination-bullet-active {
    background: var(--market-primary);
    opacity: 1;
}

/* Account Cards — moved to market.css (shared component) */

/* Category Grid (per-game) */
.market-cate-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--market-space-md);
    /* Breathing room for card hover shadow + translateY */
    padding: 6px;
    margin: -6px;
}

@media (max-width: 768px) {
    .market-cate-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.market-cate-card {
    display: block;
    background: var(--market-bg-card);
    border: 1px solid var(--market-border);
    border-radius: var(--market-radius-md);
    overflow: hidden;
    text-decoration: none;
    transition: var(--market-transition);
}

.market-cate-card:hover {
    border-color: var(--market-primary-text);
    transform: translateY(-2px);
}

.market-cate-img {
    width: 100%;
    aspect-ratio: 5 / 3;
    object-fit: cover;
    display: block;
}

.market-cate-info {
    padding: var(--market-space-sm) var(--market-space-md);
}

.market-cate-info strong {
    display: block;
    color: var(--market-text-primary);
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.market-cate-info span {
    font-size: 0.75rem;
    color: var(--market-text-secondary);
}

/* Shop Cards — 4gamerviet style */
.market-shop-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.75rem;
    background: #272450;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    text-decoration: none;
    transition: var(--market-transition);
    text-align: center;
    box-shadow: none;
    width: 100%;
}

.market-shop-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}

.market-shop-card:focus-visible {
    outline: 2px solid var(--market-focus-ring);
    outline-offset: 2px;
}

@media (max-width: 1024px) {
    .market-shop-card {
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.market-shop-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.market-shop-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 2px 0;
}

.market-shop-slug {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 0.75rem 0;
}

.market-shop-stats {
    display: flex;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

.market-shop-stat {
    flex: 1 1 0;
    max-width: 100%;
    padding: 0.7rem 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.market-shop-stat-value {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.market-shop-stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 400;
}

/* Trust Badges Section — matching 4gamerviet .feautues */
.market-trust-section {
    margin: 4rem 0;
}

.market-trust-section .market-section-title {
    justify-content: center;
    margin-bottom: 3rem;
}

.market-trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    /* Room for .market-trust-icon absolute top: -30px */
    padding-top: 35px;
}

@media (max-width: 1024px) {
    .market-trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .market-trust-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

.market-trust-item {
    position: relative;
    background: url("/public/assets/images/footer_frame.png") no-repeat;
    background-size: 100% 100%;
    height: 135px;
    overflow: visible;
}

@media (max-width: 1024px) {
    .market-trust-item {
        margin-bottom: 3rem;
    }
}

@media (max-width: 600px) {
    .market-trust-item {
        margin-bottom: 2rem;
    }
}

.market-trust-icon {
    position: absolute;
    top: -30px;
    right: 30px;
    background-color: var(--market-primary);
    border: 2px solid var(--market-primary-light);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.market-trust-icon img {
    height: 100%;
}

.market-trust-title {
    font-weight: 700;
    color: #fff;
    font-size: 17px;
    font-style: italic;
    margin-bottom: 8px;
    margin-top: 20px;
    padding: 0 25px;
}

.market-trust-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 22px;
    padding: 0 15px;
    color: #fff;
}

/* ===========================================
   CONTRAST — Primary color (#222222) passes
   AA on white (4.55:1). Use var directly.
   =========================================== */

/* Submit post button — white text on blue gradient */
#btn-submit-post {
    color: #fff;
}

/* .market-acc-price-current light theme override — moved to market.css */
