/**
 * 布局组件模块 (layout-components.css)
 * 合并了以下文件：
 * - header.css: 页面头部样式
 * - footer.css: 页面底部样式
 * - hero.css: 首页英雄区域样式
 */

/* ===== 页面头部样式 ===== */
.site-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: var(--white);
    padding: 5px 0;
    /* position: sticky; */
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}


.search-form{
    display: flex;
    width: 100%;
}

.search-area {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    padding: 6px 6px 6px 18px;
    flex-grow: 1;
    max-width: 200px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* overflow: hidden; */
}

.search-area input[type="search"] {
    border: none;
    outline: none;
    flex-grow: 1;
    font-size: 0.8rem;
    background: transparent;
    color: var(--dark-text);
}

.search-area input[type="search"]::placeholder {
    color: var(--medium-text);
    opacity: 0.8;
}

.search-area button {
    background-color: var(--primary-yellow);
    color: var(--dark-text);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-area .search-submit {
    display: none;
}

.search-area .search-toggle {
    display: flex;
}

.search-area.collapsed {
    max-width: 40px;
    padding: 4px;
    background-color: transparent;
    box-shadow: none;
}

.search-area.collapsed input[type="search"] {
    width: 0;
    padding: 0;
    opacity: 0;
}

.search-area.collapsed .search-submit {
    display: none;
}

.search-area:not(.collapsed) .search-toggle {
    display: none;
}

.search-area:not(.collapsed) .search-submit {
    display: flex;
}

.search-area button:hover {
    background-color: #e6c032;
    box-shadow: 0 3px 0 var(--yellow-dark-text);
    transform: translateY(-2px);
}

.search-area button i {
    margin-right: 0;
    font-size: 0.9rem;
}

.main-nav {
    display: flex;
    gap: 25px;
    align-items: center;
    overflow: visible; /* 修改为 visible，确保下拉菜单可见 */
}

.main-nav a {
    color: var(--white);
    font-weight: 600;
    display: flex;
    align-items: center;
}

.main-nav a:hover {
    color: var(--primary-yellow);
    /* transform: translateY(-2px); */
}

.main-nav a i {
    font-size: 1.1em;
    color: var(--primary-yellow);
    padding: 0 3px;
}

/* ===== 页面底部样式 ===== */
.site-footer {
    background: linear-gradient(135deg, #333, #222);
    color: var(--light-border);
    padding: 30px 0;
    margin-top: 20px;
    font-size: 0.9rem;
    border-top: 4px solid var(--primary-yellow);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
}

.footer-logo span {
    color: var(--primary-yellow);
}

.site-footer p {
    color: #aaa;
    flex-basis: 100%;
    order: 3;
    margin-top: 10px;
}

.footer-nav {
    display: flex;
    gap: 20px;
    order: 2;
}

.footer-nav a {
    color: #ccc;
}

.footer-nav a:hover {
    color: var(--primary-yellow);
}

.footer-social {
    display: flex;
    gap: 15px;
    order: 1;
}

.footer-social a {
    color: #ccc;
    font-size: 1.4rem;
}

.footer-social a:hover {
    color: var(--primary-yellow);
    transform: scale(1.2);
}

/* ===== 首页英雄区域样式 ===== */
.hero-section {
    perspective: 2000px;
    overflow: hidden;
    padding: 20px 0;
    width: 100%;
}

.hero-deck {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    transform-style: preserve-3d;
    min-height: 280px;
    width: 100%;
    justify-content: center;
}

.featured-card {
    position: relative;
    width: 100%;
    height: 330px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 2px 2px 15px 2px rgb(64 64 64 / 30%);
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.featured-card .card-front {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--white);
    z-index: 1;
}

.featured-card .card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition:transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.featured-card:hover .card-front img {
    transform: scale(1.05);
}

.featured-card .card-back {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45px;
    padding: 5px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.5));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    z-index: 2;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.featured-card .game-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.featured-card .game-meta {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    color:var(--white);
}

.featured-card .game-category {
    background: var(--primary-blue);
    color: var(--white);
    padding: 3px;
    border-radius: 10px;
    font-size: 1rem;
}

.featured-card .game-rating {
    color: var(--star-yellow);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
}

.featured-card .game-description {
    display: none;
    color: var(--light-border);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 8px 0;
    max-height: 60px;
    overflow: hidden;
    width: 100%;
}

.featured-card .play-button {
    opacity: 0;
}

.featured-card:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    background-color: var(--primary-yellow);
    /* transform: translateY(-2px); */
    box-shadow: 2px 2px 4px 0px var(--yellow-dark-text);
}

.featured-card:hover .play-button i {
    color: var(--yellow-dark-text);
}

.featured-card:hover {
    transform: rotate(-2deg);
    box-shadow: 2px 2px 15px 2px rgb(64 64 64 / 50%);
    border-bottom: 6px solid var(--primary-yellow);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
    opacity: 0.8;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.play-button i {
    color: var(--white);
    font-size: 1.5rem;
    margin-left: 0;
    margin-right: 0;
}

.featured-card:hover .card-back {
    height: 70px;
}

.featured-card:hover .game-meta {
    display: flex;
}

.featured-card:hover .game-description {
    display: block;
}

.featured-main {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    transform: translateZ(20px);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateZ(20px); }
    50% { transform: translateY(-10px) translateZ(20px); }
}

.hero-section .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.hero-content {
    max-width: 55%;
    flex-grow: 1;
}

.hero-content h2 {
    font-family: var(--font-heading);
    color: var(--medium-text);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.hero-content h1 {
    font-family: var(--font-heading);
    color: var(--primary-blue);
    font-size: 2.8rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--medium-text);
    margin-bottom: 25px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    padding: 12px 30px;
    background: linear-gradient(45deg, var(--primary-yellow), #ffd01a);
    color: var(--dark-text);
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 220, 74, 0.4);
    transform: translateY(0);
}

.cta-button:hover {
    box-shadow: 0 6px 20px rgba(255, 220, 74, 0.6);
    transform: translateY(-3px);
}

.cta-button i {
    margin-left: 8px;
    margin-right: 0;
}

.hero-image img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 100%;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .hero-deck {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 15px;
    }

    .featured-card {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 20px 0;
    }

    .hero-deck {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        min-height: 280px;
    }

    .featured-card {
        height: 220px;
    }

    .featured-card .game-title {
        font-size: 1rem;
    }

    .play-button {
        width: 50px;
        height: 50px;
    }

    .play-button i {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 10px 0;
    }

    .hero-deck {
        grid-template-columns: repeat(1, 1fr);
        gap: 15px;
    }

    .featured-card {
        height: 200px;
    }

    .featured-card .card-back {
        height: 40px;
    }

    .featured-card:hover .card-back {
        height: 80px;
    }

}