/**
 * Frontend Features CSS
 * トップページ・フロートボタン用スタイル
 * SWELL上書き対策込み
 */

/* ===========================================
   Reset - SWELL上書き対策
   =========================================== */
.cardgame-top-page *,
.cardgame-float-button * {
    box-sizing: border-box;
}

.cardgame-top-page h2.cardgame-section-title {
    all: unset !important;
    display: block !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #333 !important;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

/* ===========================================
   Top Page Container
   =========================================== */
.cardgame-top-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===========================================
   Section Base
   =========================================== */
.cardgame-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

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

.section-header .cardgame-section-title {
    margin-bottom: 0 !important;
}

.more-link {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.more-link:hover {
    color: #ff6600;
}

/* ===========================================
   Search Section （アーカイブページのフィルターUIと統一）
   =========================================== */
.cardgame-search-section {
    background: #fff;
    color: #222;
}

.cardgame-search-section .cardgame-section-title {
    color: #222 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #888 !important;
    margin-bottom: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cardgame-search-form .search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cardgame-search-form .search-select,
.cardgame-search-form .search-input {
    flex: 1;
    min-width: 150px;
    padding: 10px 36px 10px 14px;
    background: #fff url('data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2712%27%20height%3D%278%27%20viewBox%3D%270%200%2012%208%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%3Cpath%20d%3D%27M1%201l5%205%205-5%27%20stroke%3D%27%23333%27%20stroke-width%3D%271.5%27%20fill%3D%27none%27%2F%3E%3C%2Fsvg%3E') no-repeat right 12px center;
    background-size: 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.2s;
}

/* テキスト入力は矢印アイコン不要 */
.cardgame-search-form .search-input {
    background-image: none;
    padding-right: 14px;
    cursor: text;
    font-weight: 500;
}

.cardgame-search-form .search-select:hover,
.cardgame-search-form .search-select:focus,
.cardgame-search-form .search-input:hover,
.cardgame-search-form .search-input:focus {
    outline: none;
    border-color: #3366cc;
}

.cardgame-search-form .search-button {
    flex: 0 0 auto;
    padding: 10px 28px;
    background: #3366cc;
    color: #fff;
    border: 1.5px solid #3366cc;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.cardgame-search-form .search-button:hover {
    background: #1e4799;
    border-color: #1e4799;
}

/* ===========================================
   Cards Section
   =========================================== */
.cards-scroll-container {
    overflow-x: auto;
    margin: 0 -24px;
    padding: 0 24px;
    -webkit-overflow-scrolling: touch;
}

.cards-grid {
    display: flex;
    gap: 16px;
    padding-bottom: 8px;
}

.card-item {
    flex: 0 0 140px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.card-item:hover {
    transform: translateY(-4px);
}

.card-item .card-image {
    width: 140px;
    height: 196px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 8px;
}

.card-item .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-item .card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-item .card-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-item .card-price {
    font-size: 14px;
    font-weight: 700;
    color: #d32f2f;
}

/* ===========================================
   Packs Section
   =========================================== */
.packs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pack-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.2s;
}

.pack-item:hover {
    background: #fff5f0;
    border-color: #ff6600;
    color: #ff6600;
}

.pack-item .pack-count {
    font-size: 12px;
    color: #888;
    background: #fff;
    padding: 2px 8px;
    border-radius: 12px;
}

/* ===========================================
   Articles Section
   =========================================== */
.articles-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-item {
    border-bottom: 1px solid #f0f0f0;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    text-decoration: none;
    color: #333;
    transition: color 0.2s;
}

.article-item a:hover {
    color: #ff6600;
}

.article-item .article-title {
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 16px;
}

.article-item .article-date {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

/* ===========================================
   Search Notice (検索結果ページ)
   =========================================== */
.cardgame-search-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff5f0 0%, #fff0e6 100%);
    border: 1px solid #ffcc99;
    border-radius: 12px;
    margin-bottom: 24px;
}

.cardgame-search-notice .notice-icon {
    font-size: 24px;
}

.cardgame-search-notice .notice-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.cardgame-search-notice .notice-link {
    padding: 8px 16px;
    background: #ff6600;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.cardgame-search-notice .notice-link:hover {
    background: #e55a00;
}

/* ===========================================
   Float Button
   =========================================== */
.cardgame-float-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.float-button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s;
}

.float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    border-color: #ff6600;
}

.float-btn-icon {
    font-size: 20px;
    line-height: 1;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 768px) {
    .cardgame-top-page {
        padding: 12px;
    }

    .cardgame-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .cardgame-search-form .search-row {
        flex-direction: column;
    }

    .cardgame-search-form .search-select,
    .cardgame-search-form .search-input {
        min-width: 100%;
    }

    .card-item {
        flex: 0 0 120px;
    }

    .card-item .card-image {
        width: 120px;
        height: 168px;
    }

    .cardgame-float-button {
        bottom: 16px;
        right: 16px;
    }

    .float-btn {
        width: 44px;
        height: 44px;
    }

    .cardgame-search-notice {
        flex-wrap: wrap;
    }

    .cardgame-search-notice .notice-link {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
}

/* ===========================================
   Custom Properties (カスタマイズ用)
   =========================================== */
:root {
    --cardgame-primary: #ff6600;
    --cardgame-primary-hover: #e55a00;
    --cardgame-text: #333;
    --cardgame-text-light: #666;
    --cardgame-border: #e0e0e0;
    --cardgame-bg: #fff;
    --cardgame-bg-light: #f8f9fa;
}
