/**
 * Popup Banner Pro - Frontend Styles
 */

/* オーバーレイ */
.pbp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    justify-content: center;
    align-items: center;
}

.pbp-overlay.pbp-active {
    display: flex;
    opacity: 1;
}

/* ポップアップコンテナ */
.pbp-popup {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.3);
    animation: pbpSlideIn 0.4s ease-out;
    max-height: 90vh;
    overflow: hidden;
}

@keyframes pbpSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ポップアップ位置 */
.pbp-position-center {
    margin: auto;
}

.pbp-position-top {
    margin-top: 5vh;
    margin-left: auto;
    margin-right: auto;
    align-self: flex-start;
}

.pbp-position-bottom {
    margin-bottom: 5vh;
    margin-left: auto;
    margin-right: auto;
    align-self: flex-end;
}

/* 閉じるボタン */
.pbp-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pbp-close:hover {
    background: #f44336;
    transform: scale(1.1);
}

.pbp-close:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* バナー画像 */
.pbp-banner-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* ポップアップ内のリンク */
.pbp-popup a {
    display: block;
    line-height: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .pbp-popup {
        margin: 20px !important;
        max-width: calc(100% - 40px) !important;
    }
    
    .pbp-close {
        top: 6px;
        right: 6px;
        width: 28px;
        height: 28px;
        font-size: 18px;
        line-height: 28px;
    }
}

/* アニメーション解除用クラス */
.pbp-popup.pbp-closing {
    animation: pbpSlideOut 0.3s ease-in forwards;
}

@keyframes pbpSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}
