/**
 * MomoGo Ad Stylesheet
 * 広告枠の美的なデザインシステムと、追従広告のレイアウト、閉じるアニメーション、Collapse（折りたたみ）処理を定義します。
 */

/* 1. 広告コンテナ共通 */
.ad-container {
    position: relative;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* 広告読み込み完了時の表示状態 */
.ad-container.ad-loaded {
    opacity: 1;
    max-height: 800px; /* 十分な高さ */
    margin: 20px auto;
    overflow: visible;
}

/* 広告が空の場合のCollapse */
.ad-container.ad-empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    opacity: 0 !important;
}

/* 閉じるアニメーション中 */
.ad-container.ad-closing {
    opacity: 0;
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transform: scale(0.9);
}

/* 2. 閉じる（×）ボタンのスタイル */
.ad-close-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    color: #555555;
    font-size: 18px;
    font-weight: bold;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.ad-close-btn:hover {
    background: #f44336;
    color: #ffffff;
    transform: scale(1.1);
    border-color: #f44336;
}

/* 3. モック広告のデザインシステム (プレミアム・高品質化) */
.ad-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 10;
}

/* ボタンの共通ホバー効果 */
.ad-mock-btn {
    background: #ff6f63;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(255, 111, 99, 0.3);
}
.ad-mock-btn:hover {
    background: #ff5245;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 111, 99, 0.4);
}

/* A. ヘッダー・インラインバナー (728x90) */
.ad-container[data-ad-slot="header-banner"] {
    width: 100%;
    max-width: 728px;
    height: 90px;
}
.ad-mock-banner {
    width: 100%;
    height: 90px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    display: flex;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(42, 82, 152, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.ad-mock-content {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 36px;
    box-sizing: border-box;
}
.ad-mock-text h3 {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 2px;
    color: #ffffff;
}
.ad-mock-text p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
}

/* B. ネイティブ広告 (リスト内の自然な挿入) */
.ad-container[data-ad-slot="native-ad"] {
    width: 100%;
}
.ad-mock-native {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    position: relative;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.ad-mock-native:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}
.ad-mock-native-body {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ad-mock-native-thumb {
    font-size: 32px;
    width: 50px;
    height: 50px;
    background: #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ad-mock-native-info h4 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #1e293b;
}
.ad-mock-native-info p {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

/* C. スライダー広告 (300x250 PC画面右下) */
.ad-container[data-ad-slot="slider-ad"] {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 300px;
    height: 250px;
    z-index: 9999;
}
.ad-mock-rect {
    width: 300px;
    height: 250px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    position: relative;
}
.ad-mock-rect-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100%;
    justify-content: space-around;
}
.ad-mock-rect-icon {
    font-size: 36px;
}
.ad-mock-rect h4 {
    font-size: 16px;
    font-weight: bold;
    color: #333333;
}
.ad-mock-rect p {
    font-size: 12px;
    color: #666666;
    line-height: 1.5;
}

/* D. サイドバースカイスクレイパー (160x600 PC用追従) */
.ad-container[data-ad-slot="sidebar-ad"] {
    position: absolute;
    left: 20px; /* メインコンテンツ左側に配置するための初期値、JS/CSSで別途レイアウト調整 */
    top: 150px;
    width: 160px;
    height: 600px;
    z-index: 999;
}
.ad-mock-skyscraper {
    width: 160px;
    height: 600px;
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    color: white;
    padding: 30px 15px;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,0.05);
}
.ad-mock-sky-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    height: 100%;
}
.ad-mock-sky-logo {
    font-size: 20px;
    font-weight: 900;
    color: #ff6f63;
    letter-spacing: 2px;
}
.ad-mock-sky-body h4 {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
}
.ad-mock-sky-icon {
    font-size: 48px;
}
.ad-mock-sky-body p {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
}

/* E. スマホ用ボトムアンカー広告 (320x50 / 画面下部固定) */
.ad-container[data-ad-slot="bottom-anchor"] {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 54px;
    z-index: 10000;
    margin: 0;
}
.ad-mock-anchor {
    width: 100%;
    height: 54px;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ad-mock-anchor-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    padding: 0 45px 0 15px; /* 右側のクローズボタンと被らないように右余白多め */
    box-sizing: border-box;
}
.ad-mock-anchor-content span {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-mock-anchor .ad-close-btn {
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    box-shadow: none;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 24px;
}
.ad-mock-anchor .ad-close-btn:hover {
    color: #ef4444;
    transform: translateY(-50%) scale(1.1);
    background: transparent;
}
.ad-mock-anchor .ad-mock-btn {
    padding: 4px 10px;
    font-size: 10px;
    flex-shrink: 0;
}

/* モバイル表示時の調整 */
@media screen and (max-width: 767px) {
    /* コンテンツの下部余白を追加し、アンカー広告がスクロール領域と被るのを防ぐ */
    body {
        padding-bottom: 60px !important;
    }
}
