/**
 * Copy Button v2.0.0 - フロントエンド CSS
 * Design A: グラデーションリボン + フルオーバーレイ演出
 */

/* ボックス */
.cpb-box {
    position: relative;
    max-width: 480px;
    margin: 20px auto;
    overflow: hidden;
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
}

/* リボンヘッダー */
.cpb-ribbon {
    color: #fff;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.5;
}

/* コンテンツ部 */
.cpb-content {
    padding: 28px 20px 24px;
    text-align: center;
    transition: background 0.4s ease;
}
.cpb-content.is-copied {
    background: #f5f5f5;
}

/* コード表示 */
.cpb-code-display {
    display: block;
    border: 2px dashed;
    border-radius: 10px;
    padding: 14px 32px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 3px;
    margin: 0 auto 20px auto;
    max-width: 320px;
    transition: all 0.4s ease;
}

/* コピーボタン */
.cpb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    border: none;
    padding: 10px 28px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(255,107,138,0.3);
    font-family: inherit;
    line-height: 1.5;
}
.cpb-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(255,107,138,0.4);
}
.cpb-btn:active {
    transform: translateY(0);
}
.cpb-btn.is-copied {
    pointer-events: none;
}
.cpb-btn.is-copied:hover {
    transform: none;
}

/* アイコン切り替え */
.cpb-icon-copy,
.cpb-icon-check {
    display: inline-flex;
    align-items: center;
}
.cpb-icon-check {
    display: none;
}
.cpb-btn.is-copied .cpb-icon-copy {
    display: none;
}
.cpb-btn.is-copied .cpb-icon-check {
    display: inline-flex;
    animation: cpb-check-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cpb-check-pop {
    0%   { transform: scale(0) rotate(-45deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ============================================
   オーバーレイ演出
   ============================================ */
.cpb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 10;
}
.cpb-overlay.is-show {
    opacity: 1;
}

.cpb-overlay-check {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.cpb-overlay.is-show .cpb-overlay-check {
    animation: cpb-overlay-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cpb-overlay-pop {
    0%   { transform: scale(0); }
    100% { transform: scale(1); }
}

.cpb-overlay-text {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 480px) {
    .cpb-box {
        margin: 16px 10px;
    }
    .cpb-code-display {
        font-size: 18px;
        padding: 10px 20px;
        letter-spacing: 2px;
    }
    .cpb-ribbon {
        font-size: 13px;
        padding: 12px 16px;
    }
    .cpb-overlay-check {
        width: 48px;
        height: 48px;
    }
    .cpb-overlay-check svg {
        width: 24px;
        height: 24px;
    }
    .cpb-overlay-text {
        font-size: 14px;
    }
}
