/**
 * Homepage Shortcodes Styles
 * 
 * Styles for homepage sections and game cards
 * @version 1.1.0
 */

/* ========================================
   HERO STATS SECTION
   ======================================== */

.gcn-hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--color-card) 0%, var(--color-dark) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-6);
    margin-bottom: var(--space-8);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.gcn-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.gcn-hero-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2) 0;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gcn-hero-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-6) 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Live Search */
.gcn-live-search {
    position: relative;
    width: min(100%, 620px);
    margin: 0 auto var(--space-6);
    text-align: left;
    z-index: 5;
}

.gcn-live-search-field {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 52px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.82);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.gcn-live-search-field > i {
    width: 48px;
    color: var(--color-text-muted);
    text-align: center;
    flex-shrink: 0;
}

.gcn-live-search-field input {
    width: 100%;
    min-width: 0;
    height: 52px;
    border: 0;
    background: transparent;
    color: var(--color-text-primary);
    padding: 0 var(--space-4) 0 0;
}

.gcn-live-search-field input::placeholder {
    color: var(--color-text-muted);
}

.gcn-live-search-loader {
    display: none;
    width: 16px;
    height: 16px;
    margin-right: var(--space-4);
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: gcnSearchSpin 0.8s linear infinite;
    flex-shrink: 0;
}

.gcn-live-search.is-loading .gcn-live-search-loader {
    display: block;
}

.gcn-live-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 360px;
    overflow-y: auto;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.gcn-live-search.is-open .gcn-live-search-results {
    display: block;
}

.gcn-live-search-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    color: var(--color-text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border-light);
}

.gcn-live-search-item:last-child {
    border-bottom: 0;
}

.gcn-live-search-item:hover {
    color: var(--color-text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.gcn-live-search-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gcn-live-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gcn-live-search-title {
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gcn-live-search-empty {
    padding: var(--space-4);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    text-align: center;
}

@keyframes gcnSearchSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Stats Grid */
.gcn-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    max-width: 700px;
    margin: 0 auto;
}

/* Individual Stat Card */
.gcn-stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all var(--transition-base);
}

.gcn-stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--color-primary-border);
    transform: translateY(-2px);
}

/* Stat Icon */
.gcn-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: var(--text-xl);
    flex-shrink: 0;
}

.gcn-stat-icon-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.gcn-stat-icon-primary {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* Stat Content */
.gcn-stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.gcn-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    line-height: 1.2;
}

.gcn-stat-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Decorative Elements */
.gcn-hero-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.gcn-hero-glow {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

/* ========================================
   GAME CARD COMPONENT
   ======================================== */

.gcn-game-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gcn-game-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-lg);
}

.gcn-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Thumbnail */
.gcn-card-thumb {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: var(--color-surface);
    overflow: hidden;
}

.gcn-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gcn-game-card:hover .gcn-card-img {
    transform: scale(1.05);
}

.gcn-card-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    color: var(--color-text-muted);
}

/* Badge overlay */
.gcn-card-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    background: var(--color-success);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.gcn-card-badge.badge-empty {
    background: var(--color-text-muted);
}

/* Card Body */
.gcn-card-body {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gcn-card-title {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2) 0;
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gcn-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--space-3);
}

.gcn-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.gcn-meta-item i {
    color: var(--color-primary);
}

/* ========================================
   CODE UPDATES CARD
   ======================================== */

.gcn-update-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    height: 100%;
}

.gcn-update-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-lg);
}

.gcn-update-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.gcn-update-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--color-surface);
    overflow: hidden;
}

.gcn-update-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gcn-update-card:hover .gcn-update-img {
    transform: scale(1.04);
}

.gcn-update-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    color: var(--color-text-muted);
}

.gcn-update-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(34, 197, 94, 0.92);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: var(--font-bold);
    letter-spacing: 0.2px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.gcn-update-body {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gcn-update-title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gcn-update-count {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--color-success);
    font-weight: var(--font-semibold);
}

/* ========================================
   NEW GAMES SLIDER
   ======================================== */

.gcn-new-games-slider {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
}

.gcn-slider-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.gcn-slider-nav:hover:not(:disabled) {
    color: #fff;
    border-color: var(--color-primary-border);
    background: var(--color-primary);
}

.gcn-slider-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gcn-new-games-track {
    flex: 1;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--space-3) * (var(--gcn-slider-columns-desktop, 3) - 1))) / var(--gcn-slider-columns-desktop, 3));
    gap: var(--space-3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}

.gcn-new-games-track::-webkit-scrollbar {
    display: none;
}

.gcn-new-games-item {
    scroll-snap-align: start;
}

.gcn-new-game-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    transition: all var(--transition-base);
}

.gcn-new-game-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-md);
}

.gcn-new-game-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    text-decoration: none;
    color: inherit;
    min-height: 88px;
}

.gcn-new-game-icon-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
    flex-shrink: 0;
}

.gcn-new-game-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gcn-new-game-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.gcn-new-game-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    font-size: 9px;
    font-weight: var(--font-bold);
    letter-spacing: 0.25px;
    line-height: 1.1;
    text-transform: uppercase;
    z-index: 2;
}

.gcn-new-game-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gcn-new-game-title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gcn-new-game-count {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

/* ========================================
   LATEST POSTS (DESIGN A)
   ======================================== */

.gcn-latest-post-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    transition: all var(--transition-base);
}

.gcn-latest-post-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-md);
}

.gcn-latest-post-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.gcn-latest-post-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--color-surface);
    overflow: hidden;
}

.gcn-latest-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gcn-latest-post-card:hover .gcn-latest-post-img {
    transform: scale(1.04);
}

.gcn-latest-post-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    color: var(--color-text-muted);
}

.gcn-latest-post-body {
    padding: var(--space-3);
}

.gcn-latest-post-title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   SECTIONS GRID LAYOUT
   ======================================== */

.gcn-section-grid {
    display: grid;
    grid-template-columns: repeat(var(--gcn-grid-columns-desktop, 4), minmax(0, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */

@media (max-width: 1024px) {
    /* Keep desktop variable layout through tablet for consistency. */
}

@media (max-width: 768px) {
    .gcn-hero-section {
        padding: var(--space-6) var(--space-4);
    }

    .gcn-hero-title {
        font-size: var(--text-2xl);
    }

    .gcn-hero-subtitle {
        font-size: var(--text-sm);
    }

    .gcn-hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-2);
    }

    .gcn-stat-card {
        flex-direction: column;
        text-align: center;
        padding: var(--space-3);
        gap: var(--space-2);
    }

    .gcn-stat-icon {
        width: 40px;
        height: 40px;
        font-size: var(--text-lg);
    }

    .gcn-stat-content {
        align-items: center;
    }

    .gcn-stat-value {
        font-size: var(--text-lg);
    }

    .gcn-stat-label {
        font-size: 10px;
    }

    /* Grid adjustments */
    .gcn-section-grid {
        grid-template-columns: repeat(var(--gcn-grid-columns-mobile, 2), minmax(0, 1fr));
    }

    .gcn-new-games-track {
        grid-auto-columns: calc((100% - (var(--space-3) * (var(--gcn-slider-columns-mobile, 1) - 1))) / var(--gcn-slider-columns-mobile, 1));
    }

    .gcn-new-game-link {
        min-height: 82px;
        padding: var(--space-2);
    }

    .gcn-new-game-icon-wrap {
        width: 56px;
        height: 56px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 480px) {
    .gcn-hero-section {
        padding: var(--space-5) var(--space-3);
        border-radius: var(--radius-lg);
    }

    .gcn-hero-title {
        font-size: var(--text-xl);
    }

    .gcn-hero-subtitle {
        font-size: var(--text-xs);
        margin-bottom: var(--space-4);
    }

    .gcn-stat-card {
        padding: var(--space-2);
    }

    .gcn-stat-icon {
        width: 36px;
        height: 36px;
        font-size: var(--text-base);
    }

    .gcn-stat-value {
        font-size: var(--text-base);
    }

    /* Grid to 2 columns on mobile as requested */
    .gcn-section-grid {
        grid-template-columns: repeat(var(--gcn-grid-columns-mobile, 2), minmax(0, 1fr));
        gap: var(--space-3);
    }

    .gcn-card-body {
        padding: var(--space-3);
    }

    .gcn-card-title {
        font-size: var(--text-sm);
    }

    .gcn-card-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .gcn-new-games-slider {
        gap: var(--space-1);
    }

    .gcn-slider-nav {
        width: 32px;
        height: 32px;
    }
}
