/* SCF Popup Manager Styles */
.scf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.scf-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.scf-popup-overlay.position-center {
    justify-content: center;
    align-items: center;
}

.scf-popup-overlay.position-bottom-right {
    justify-content: flex-end;
    align-items: flex-end;
    padding: 20px;
    background-color: transparent;
}

.scf-popup-overlay.position-bottom-left {
    justify-content: flex-start;
    align-items: flex-end;
    padding: 20px;
    background-color: transparent;
}

.scf-popup-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.scf-popup-overlay.show .scf-popup-container {
    transform: scale(1);
}

.scf-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.scf-popup-close:hover {
    background: #d32f2f;
}

/* デザインタイプ1: シンプルなタイトル + 本文 */
.design-type-1 {
    width: 400px;
    padding: 40px 30px 30px;
}

.design-type-1 .popup-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 15px;
    color: #333;
    text-align: center;
}

.design-type-1 .popup-content {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    text-align: center;
}

/* デザインタイプ2: タイトル + 本文 + ボタン */
.design-type-2 {
    width: 450px;
    padding: 40px 30px 30px;
}

.design-type-2 .popup-title {
    font-size: 22px;
    font-weight: bold;
    margin: 0 0 20px;
    color: #333;
    text-align: center;
}

.design-type-2 .popup-content {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 25px;
    text-align: center;
}

.design-type-2 .popup-buttons {
    text-align: center;
}

.design-type-2 .popup-button {
    display: inline-block;
    padding: 12px 30px;
    background: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.design-type-2 .popup-button:hover {
    background: #1976D2;
}

/* デザインタイプ3: タイトル + 本文 + 2つのボタン */
.design-type-3 {
    width: 500px;
    padding: 40px 30px 30px;
}

.design-type-3 .popup-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 20px;
    color: #333;
    text-align: center;
}

.design-type-3 .popup-content {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

.design-type-3 .popup-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.design-type-3 .popup-button.primary {
    padding: 12px 25px;
    background: #2196F3;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.design-type-3 .popup-button.primary:hover {
    background: #1976D2;
}

.design-type-3 .popup-button.secondary {
    padding: 12px 25px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.design-type-3 .popup-button.secondary:hover {
    background: #e0e0e0;
}

/* デザインタイプ4: 画像のみ */
.design-type-4 {
    width: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.design-type-4 .scf-popup-close {
    background: rgba(0, 0, 0, 0.7);
    top: 5px;
    right: 5px;
}

.design-type-4 .popup-image {
    display: block;
    max-width: 80vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* 右下・左下配置時のスタイル調整 */
.position-bottom-right .scf-popup-container,
.position-bottom-left .scf-popup-container {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.position-bottom-right .design-type-1,
.position-bottom-right .design-type-2,
.position-bottom-right .design-type-3,
.position-bottom-left .design-type-1,
.position-bottom-left .design-type-2,
.position-bottom-left .design-type-3 {
    width: 320px;
    padding: 30px 20px 20px;
}

.position-bottom-right .popup-title,
.position-bottom-left .popup-title {
    font-size: 16px;
    margin-bottom: 12px;
}

.position-bottom-right .popup-content,
.position-bottom-left .popup-content {
    font-size: 13px;
    margin-bottom: 15px;
}

.position-bottom-right .popup-button,
.position-bottom-left .popup-button {
    padding: 10px 20px;
    font-size: 13px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .design-type-1,
    .design-type-2,
    .design-type-3 {
        width: 90vw;
        max-width: 350px;
        padding: 30px 20px 20px;
    }
    
    .design-type-1 .popup-title,
    .design-type-2 .popup-title,
    .design-type-3 .popup-title {
        font-size: 18px;
    }
    
    .design-type-3 .popup-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .design-type-3 .popup-button {
        width: 100%;
        text-align: center;
    }
    
    .position-bottom-right,
    .position-bottom-left {
        padding: 10px;
    }
    
    .position-bottom-right .scf-popup-container,
    .position-bottom-left .scf-popup-container {
        width: calc(100vw - 20px);
        max-width: 300px;
    }
    
    .design-type-4 .popup-image {
        max-width: 95vw;
        max-height: 70vh;
    }
}

/* アニメーション */
@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.position-bottom-right.show .scf-popup-container {
    animation: slideInRight 0.4s ease;
}

.position-bottom-left.show .scf-popup-container {
    animation: slideInLeft 0.4s ease;
}