/**
 * 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);
    }
}

/* メールフォームポップアップ */
.pbp-email-form {
    padding: 40px 30px;
    text-align: center;
    min-width: 300px;
}

.pbp-form-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}

.pbp-form-description {
    margin: 0 0 25px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* フォーム内バナー画像 */
.pbp-form-banner {
    margin: 0 0 20px 0;
}

.pbp-form-banner-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.pbp-subscribe-form {
    margin: 0;
}

.pbp-form-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pbp-email-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.pbp-email-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.pbp-email-input::placeholder {
    color: #999;
}

.pbp-submit-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.pbp-submit-button:hover {
    opacity: 0.9;
}

.pbp-submit-button:active {
    transform: scale(0.98);
}

.pbp-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pbp-form-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
}

.pbp-form-message.pbp-error {
    background: #ffebee;
    color: #c62828;
}

.pbp-form-message.pbp-success {
    background: #e8f5e9;
    color: #2e7d32;
}

/* 成功表示 */
.pbp-success-view {
    padding: 20px;
}

.pbp-success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: #4CAF50;
    color: #fff;
    font-size: 32px;
    line-height: 60px;
    border-radius: 50%;
    animation: pbpCheckmark 0.4s ease-out;
}

@keyframes pbpCheckmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.pbp-success-message {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

/* レスポンシブ: メールフォーム */
@media (max-width: 768px) {
    .pbp-email-form {
        padding: 30px 20px;
        min-width: auto;
    }

    .pbp-form-title {
        font-size: 20px;
    }

    .pbp-email-input,
    .pbp-submit-button {
        padding: 12px 14px;
        font-size: 15px;
    }
}
