/**
 * 功能模块 (features.css)
 * 合并了以下文件：
 * - promo-styles.css: 广告相关样式
 * - description.css: 描述模块样式
 * - game-history.css: 游戏历史记录样式
 * - history-dropdown.css: 历史记录下拉框样式
 */

/**
 * 广告样式
 * 包含所有广告相关的样式定义
 */

/* ===== 通用广告样式 ===== */
.maple-game-ad {
    position: relative;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.promo-label {
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 0 0 4px 0;
    z-index: 2;
}

.promo-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 100px;
}

/* ===== 首页广告样式 ===== */
/* 首页主要广告位 */
.featured-ad {
    padding: 0 0 1rem;
}

.primary-ad {
    width: 100%;
    height: 120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-card.primary-ad {
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
    min-height: 120px;
}

/* ===== 游戏列表广告样式 ===== */
/* 游戏列表中的广告样式 */
.game-item.promo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-item.promo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.game-item-image-wrapper.promo-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 游戏网格中的广告卡片 */
.game-card.promo-card {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 游戏详情页广告样式 ===== */
/* 游戏详情页广告位 */
.game-detail-content {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 1.5rem;
}

.game-side-ad .vertical-ad {
    width: 200px;
    height: 600px;
}

.sidebar-card.promo-card {
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
}

.horizontal-ad {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-horizontal-ad {
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: fit-content;
    border-top: 4px solid transparent;
    overflow: hidden;
    /* 瀑布流关键样式：确保每个卡片占据整个列宽并在新列中显示 */
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
}

/* ===== 广告悬停效果 ===== */
.info-card:hover {
    transform: translateY(-5px);
    /* box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12); */
}

.game-horizontal-ad:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 0 3px var(--primary-color);
}

.vertical-ad:hover{
    transform: translateY(-5px);
    box-shadow: 4px 4px 0 3px var(--primary-color);
}

/* ===== 响应式调整 ===== */
@media (max-width: 1024px) {
    .game-detail-content {
        grid-template-columns: 1fr 180px;
    }

    .game-side-ad {
        width: 180px;
        height: 600px;
    }
}

@media (max-width: 768px) {
    .primary-ad {
        height: 100px;
    }

    .horizontal-ad {
        height: 100px;
    }

    .game-detail-content {
        grid-template-columns: 1fr;
    }

    .game-side-ad {
        display: none;
    }

    .promo-card.primary-ad,
    .game-horizontal-ad .promo-card {
        min-height: 100px;
    }

    .sidebar-card.promo-card {
        min-height: 200px;
    }

    .game-item-image-wrapper.promo-wrapper {
        min-height: 100px;
    }
}

/* ===== 描述模块样式 ===== */
.description-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 20px;
}

.description-card {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.description-card:hover {
    transform: translateY(-10px);
}

.card-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.card-icon i {
    font-size: 2rem;
    color: var(--white);
    margin: 0;
}

.description-card h3 {
    color: var(--dark-text);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.description-card p {
    color: var(--medium-text);
    font-size: 1rem;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .description-grid {
        gap: 20px;
    }

    .description-card {
        padding: 25px;
    }

    .card-icon {
        width: 60px;
        height: 60px;
    }

    .card-icon i {
        font-size: 1.75rem;
    }

    .description-card h3 {
        font-size: 1.3rem;
    }
}

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

    .description-card {
        padding: 20px;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }

    .card-icon i {
        font-size: 1.5rem;
    }

    .description-card h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .description-card p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .description-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .description-card {
        padding: 20px 15px;
    }

    .description-card:hover {
        transform: translateY(-5px);
    }
}

/* ===== 游戏历史记录样式 ===== */
/**
 * 游戏历史记录页面样式
 */

/* 游戏历史记录容器 */
.game-history-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* 历史统计信息 */
.history-stats {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-stats .stat-item {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #333;
}

.history-stats .stat-item i {
    margin-right: 10px;
    color: #f44336;
    font-size: 20px;
}

.history-stats .stat-item strong {
    color: #f44336;
    font-weight: 700;
    margin: 0 5px;
}

/* 游戏卡片网格 */
.history-grid {
    margin-bottom: 30px;
}

/* 游戏卡片历史特殊样式 */
.history-game-item .game-badge {
    position: absolute;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.history-game-item .game-badge.play-count {
    top: 8px;
    left: 8px;
    background-color: #4CAF50;
    display: flex;
    align-items: center;
}

.history-game-item .game-badge.play-count i {
    margin-right: 4px;
    font-size: 0.7rem;
}

.history-game-item .game-badge.last-played {
    bottom: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    font-size: 0.7rem;
}

/* 操作按钮区域 */
.history-actions {
    margin-top: 20px;
    text-align: right;
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.button:hover {
    background-color: #d32f2f;
}

/* 无历史记录状态 */
.no-history {
    padding: 40px 30px;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.no-history p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #666;
}

/* 加载状态 */
.loading {
    padding: 30px;
    text-align: center;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .history-stats .stat-item {
        font-size: 14px;
    }

    .history-stats .stat-item i {
        font-size: 18px;
    }

    .games-grid.history-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .history-game-item .game-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* ===== 历史记录下拉框样式 ===== */
/**
 * 游戏历史记录下拉框样式
 */

/* 历史记录下拉框容器 */
.history-dropdown-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.history-dropdown-container.active {
    opacity: 1;
    visibility: visible;
}

/* 历史记录下拉框 */
.history-dropdown {
    width: 350px;
    height: 100%;
    background-color: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transform: translateX(100%);
    transition:transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.history-dropdown-container.active .history-dropdown {
    transform: translateX(0);
}

/* 历史记录下拉框头部 */
.history-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 1;
}

.history-dropdown-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-dropdown {
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.close-dropdown:hover {
    color: #f44336;
}

/* 历史记录内容 */
.history-dropdown-content {
    padding: 15px;
}

/* 历史记录统计 */
.history-stats {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.history-stats .stat-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #333;
}

.history-stats .stat-item i {
    margin-right: 8px;
    color: #f44336;
    font-size: 16px;
}

.history-stats .stat-item strong {
    color: #f44336;
    font-weight: 700;
    margin: 0 3px;
}

/* 历史记录网格 */
.dropdown-history-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

/* 历史记录游戏项 */
.history-game-item {
    display: block;
    padding: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #333;
}

.history-game-item:hover {
    background-color: #f0f0f0;
}

.history-game-thumbnail {
    display: flex;
    align-items: center;
}

.history-game-thumbnail img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 10px;
}

.history-game-info {
    flex-grow: 1;
}

.history-game-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

.history-game-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.history-game-meta .play-count {
    display: flex;
    align-items: center;
}

.history-game-meta .play-count i {
    margin-right: 3px;
    color: #4CAF50;
}

.history-game-meta .last-played {
    color: #999;
}

/* 历史记录操作 */
.history-actions {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.button.clear-button {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.button.clear-button:hover {
    background-color: #d32f2f;
}

/* 无历史记录状态 */
.no-history {
    padding: 30px 20px;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.no-history p {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.no-history .button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.no-history .button:hover {
    background-color: #388E3C;
}

/* 加载状态 */
.loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .history-dropdown {
        width: 300px;
    }
}
