/**
 * 広告スロット・関連UIのスタイル
 * assets/css/ad-styles.css
 * 
 * Phase 1-2: 広告枠レイアウト + プレースホルダー
 */

/* ========================================
   広告スロット共通
   ======================================== */

.ad-slot {
    width: 100%;
    text-align: center;
    overflow: hidden;
    margin: 16px 0;
}

.ad-slot-home_top {
    margin-top: 0;
    margin-bottom: 20px;
}

.ad-slot-home_bottom {
    margin-top: 30px;
    margin-bottom: 0;
}

.ad-slot-result_top {
    margin-bottom: 16px;
}

.ad-slot-result_bottom {
    margin-top: 20px;
}

.ad-slot-title_infeed {
    margin: 12px 0;
}

/* ========================================
   インフィード広告（タイトル一覧内）
   ======================================== */

.title-item-ad {
    list-style: none;
    padding: 4px 20px;
    border-bottom: 1px solid #eee;
    background: transparent;
}

/* ========================================
   プレースホルダー（開発・審査中用）
   ======================================== */

.ad-placeholder {
    border: 2px dashed #CFD8DC;
    border-radius: 8px;
    background: #FAFAFA;
}

.ad-placeholder-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    color: #90A4AE;
    font-size: 13px;
}

.ad-placeholder-icon {
    font-size: 20px;
}

.ad-placeholder-label {
    font-weight: bold;
    color: #78909C;
}

.ad-placeholder-info {
    font-size: 11px;
    background: #ECEFF1;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ========================================
   関連商品レコメンド（結果画面用）
   ======================================== */

.ad-product-recommendations {
    margin-top: 20px;
    padding: 16px;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: 10px;
}

.ad-recommendations-title {
    font-size: 14px;
    font-weight: bold;
    color: #F57F17;
    margin: 0 0 12px 0;
    text-align: center;
}

.ad-recommendations-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.ad-product-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #FFE082;
    border-radius: 8px;
    font-size: 13px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ad-product-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.ad-product-icon {
    font-size: 20px;
}

.ad-product-name {
    font-weight: bold;
    color: #424242;
}

.ad-product-link {
    padding: 3px 10px;
    background: #FF9800;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    transition: background 0.2s;
}

.ad-product-link:hover {
    background: #F57C00;
}

.ad-product-link-rakuten {
    background: #BF0000;
}

.ad-product-link-rakuten:hover {
    background: #9C0000;
}

/* ========================================
   有料プラン誘導バナー
   ======================================== */

.ad-upgrade-banner {
    margin: 20px 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, #E3F2FD 0%, #F3E5F5 100%);
    border: 1px solid #CE93D8;
    border-radius: 10px;
}

.ad-upgrade-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.ad-upgrade-icon {
    font-size: 28px;
}

.ad-upgrade-text {
    flex: 1;
}

.ad-upgrade-text strong {
    display: block;
    font-size: 14px;
    color: #4A148C;
    margin-bottom: 2px;
}

.ad-upgrade-text p {
    margin: 0;
    font-size: 12px;
    color: #7B1FA2;
}

.ad-upgrade-button {
    padding: 8px 20px;
    background: linear-gradient(135deg, #7B1FA2, #9C27B0);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ad-upgrade-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(123, 31, 162, 0.4);
}

/* ========================================
   ユーザーTierバッジ（ヘッダー用）
   ======================================== */

.user-tier-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
}

.user-tier-badge.tier-guest {
    background: rgba(255, 255, 255, 0.2);
    color: #E0E0E0;
}

.user-tier-badge.tier-free {
    background: rgba(33, 150, 243, 0.2);
    color: #BBDEFB;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.user-tier-badge.tier-paid {
    background: rgba(255, 215, 0, 0.3);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

/* ========================================
   フッター: アフィリエイト表記
   ======================================== */

.footer-affiliate-notice {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #455A64;
    font-size: 11px;
    color: #78909C;
}

.footer-affiliate-notice a {
    color: #90CAF9;
    text-decoration: none;
}

.footer-affiliate-notice a:hover {
    text-decoration: underline;
}

/* ========================================
   レスポンシブ
   ======================================== */

@media (max-width: 768px) {
    .ad-placeholder-inner {
        flex-direction: column;
        gap: 4px;
        padding: 12px;
    }
    
    .ad-recommendations-grid {
        flex-direction: column;
    }
    
    .ad-product-card {
        justify-content: center;
    }
    
    .ad-upgrade-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Phase 3: スコア連動レコメンド
   ======================================== */

/* スコア別アドバイス */
.ad-score-advice {
    font-size: 13px;
    color: #5D4037;
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
    padding: 8px 14px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 12px;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.ad-score-advice--visible {
    max-height: 60px;
    opacity: 1;
    padding: 8px 14px;
}

/* ハイライトカード */
.ad-product-card--highlight {
    border: 2px solid #FF9800 !important;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFF3E0 100%) !important;
    box-shadow: 0 3px 12px rgba(255, 152, 0, 0.25) !important;
    transform: translateY(-2px);
}

/* リンク未設定時のプレースホルダー */
.ad-product-link-placeholder {
    font-size: 11px;
    color: #BDBDBD;
    padding: 3px 8px;
    border: 1px dashed #BDBDBD;
    border-radius: 10px;
}

/* アフィリエイト表記 */
.ad-affiliate-notice {
    font-size: 10px;
    color: #9E9E9E;
    text-align: right;
    margin: 8px 0 0 0;
}

/* ========================================
   Phase 3: A8.net バナー
   ======================================== */

.ad-a8-banner {
    text-align: center;
    margin: 16px 0;
    overflow: hidden;
}

.ad-a8-banner--sidebar {
    margin: 20px auto;
    max-width: 300px;
}

.ad-a8-banner--result {
    margin: 16px 0;
}

/* ========================================
   Phase 3: フッター おすすめアイテム
   ======================================== */

.footer-recommend {
    padding: 20px 0 0 0;
    margin-top: 20px;
    border-top: 1px solid #455A64;
}

.footer-recommend-title {
    font-size: 13px;
    font-weight: bold;
    color: #90CAF9;
    margin: 0 0 12px 0;
    letter-spacing: 0.05em;
}

.footer-recommend-items {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.footer-recommend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 8px 14px;
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}

.footer-recommend-icon {
    font-size: 18px;
}

.footer-recommend-name {
    font-size: 12px;
    color: #CFD8DC;
    flex: 1;
}

.footer-recommend-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.footer-recommend-link {
    font-size: 11px;
    font-weight: bold;
    padding: 3px 9px;
    border-radius: 12px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.footer-recommend-link:hover { opacity: 0.8; }

.footer-recommend-link--amazon {
    background: #FF9900;
    color: #fff;
}

.footer-recommend-link--rakuten {
    background: #BF0000;
    color: #fff;
}

.footer-recommend-notice {
    font-size: 10px;
    color: #607D8B;
    margin: 4px 0 0 0;
}

@media (max-width: 768px) {
    .footer-recommend-items { flex-direction: column; }
    .footer-recommend-item  { max-width: 100%; }
}
