/**
 * サッチーゲーミング離脱防止ポップアップ
 * スタイルシート
 */

/* ポップアップオーバーレイ */
.sg-exit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999;
    display: none;
    animation: sgFadeIn 0.3s ease-out;
}

@keyframes sgFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* メインコンテナ */
.sg-exit-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    animation: sgPopupSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes sgPopupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotateX(0);
    }
}

/* グラデーション枠 */
.sg-popup-gradient-border {
    background: linear-gradient(45deg, #f093fb, #f5576c, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: sgGradientShift 3s ease infinite;
    padding: 3px;
    border-radius: 20px;
}

@keyframes sgGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* コンテンツエリア */
.sg-exit-popup-content {
    background: #fff;
    border-radius: 17px;
    padding: 35px 30px;
    position: relative; /* 閉じるボタンの位置基準を明確化 */
    overflow: hidden;
    min-height: 200px; /* 最小高さを設定 */
}

/* パーティクルエフェクト */
.sg-popup-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.sg-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    border-radius: 50%;
    animation: sgParticleFloat 6s infinite;
}

@keyframes sgParticleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

/* ヘッダー */
.sg-popup-header {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 25px;
}

.sg-popup-header h3 {
    font-size: 28px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: bold;
    margin: 0;
    animation: sgTextPulse 2s ease-in-out infinite;
}

@keyframes sgTextPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.sg-popup-subtitle {
    display: block;
    font-size: 15px;
    color: #666;
    margin-top: 10px;
    font-weight: normal;
    -webkit-text-fill-color: #666;
    animation: sgSlideInFromBottom 0.6s ease-out 0.3s both;
}

@keyframes sgSlideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 閉じる方法のヒント */
.sg-popup-close-hint {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin-top: 8px;
    font-weight: normal;
}

/* CTAセクション */
.sg-popup-cta-primary {
    position: relative;
    z-index: 1;
    margin: 25px 0;
    animation: sgSlideInFromBottom 0.6s ease-out 0.4s both;
}

.sg-cta-label {
    text-align: center;
    color: #ff6b6b;
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 14px;
    animation: sgBlink 2s ease-in-out infinite;
}

@keyframes sgBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.sg-cta-note {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* アフィリエイト画像 */
.sg-affiliate-image-link {
    display: block;
    margin-bottom: 20px;
}

.sg-popup-affiliate-image {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    animation: sgImageFloat 3s ease-in-out infinite;
}

@keyframes sgImageFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* アフィリエイトボタン */
.sg-popup-affiliate-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    border: none;
    cursor: pointer;
}

.sg-popup-affiliate-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: sgButtonShine 3s infinite;
}

@keyframes sgButtonShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.sg-popup-affiliate-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
    color: white !important;
}

.sg-button-icon {
    margin-left: 10px;
    font-size: 22px;
    animation: sgArrowMove 1s ease-in-out infinite;
}

@keyframes sgArrowMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* 区切り線 */
.sg-popup-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
    color: #999;
    font-size: 14px;
}

.sg-popup-divider:before,
.sg-popup-divider:after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
}

.sg-popup-divider:before { left: 0; }
.sg-popup-divider:after { right: 0; }

/* 内部リンクセクション */
.sg-popup-internal-section {
    position: relative;
    z-index: 1;
    margin-top: 30px;
    animation: sgSlideInFromBottom 0.6s ease-out 0.5s both;
}

.sg-internal-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    position: relative;
}

.sg-internal-title:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.sg-internal-links-grid {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.sg-internal-link-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.sg-internal-link-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    transition: left 0.5s;
}

.sg-internal-link-card:hover:before {
    left: 100%;
}

.sg-internal-link-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.sg-link-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
}

.sg-link-thumbnail-placeholder {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.sg-link-content {
    flex: 1;
}

.sg-link-title {
    font-size: 14px;
    color: #333;
    font-weight: bold;
    margin: 0 0 5px;
    line-height: 1.4;
}

.sg-link-meta {
    color: #667eea;
    font-size: 12px;
    font-weight: bold;
}

/* 閉じるボタン - 改良版 */
.sg-exit-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: #333;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.sg-exit-popup-close:hover {
    background: #ff4444;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* モバイル用の閉じるボタン調整 */
@media (max-width: 640px) {
    .sg-exit-popup-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

/* ボディのスクロール制御 */
body.sg-popup-open {
    overflow: hidden;
}

/* モバイル対応 */
@media (max-width: 640px) {
    .sg-exit-popup-container {
        width: 95%;
        max-height: 90vh;
    }
    
    .sg-exit-popup-content {
        padding: 25px 20px;
    }
    
    .sg-popup-header h3 {
        font-size: 22px;
    }
    
    .sg-popup-subtitle {
        font-size: 13px;
    }
    
    .sg-popup-affiliate-button {
        font-size: 16px;
        padding: 16px 25px;
    }
    
    .sg-internal-link-card {
        padding: 12px;
    }
    
    .sg-link-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .sg-link-title {
        font-size: 13px;
    }
    
    .sg-popup-affiliate-image {
        max-width: 100%;
    }
}

/* タブレット対応 */
@media (min-width: 641px) and (max-width: 1024px) {
    .sg-internal-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* PC対応（2カラム） */
@media (min-width: 1025px) {
    .sg-internal-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}