/* ============================================
   毘沙門にゃん チャットボット CSS
   ============================================ */

.bishamonyan-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

/* アイコンボタン */
.bishamonyan-icon {
    width: 180px;
    height: 180px;
    border-radius: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    overflow: visible;
    box-shadow: none;
    transition: transform 0.3s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    transform: translateY(200px);
    animation: bishamonyanAppear 0.6s 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bishamonyanAppear {
    from {
        transform: translateY(200px);
    }
    to {
        transform: translateY(0);
    }
}

.bishamonyan-icon:hover {
    transform: scale(1.05);
}

.bishamonyan-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* ふきだし */
.bishamonyan-bubble {
    position: absolute;
    bottom: 190px;
    right: 0;
    background: var(--color-main, #1a1a2e);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px 12px 0 12px;
    font-size: 0.8rem;
    line-height: 1.6;
    max-width: 220px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    animation: bubbleAppear 0.5s 2s forwards;
    pointer-events: none;
    font-family: 'Noto Sans JP', sans-serif;
}

.bishamonyan-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 50px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--color-main, #1a1a2e);
}

@keyframes bubbleAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* チャットウィンドウ */
.bishamonyan-chat {
    position: absolute;
    bottom: 190px;
    right: 0;
    width: 340px;
    height: 460px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.bishamonyan-chat.active {
    display: flex;
}

.bishamonyan-chat-header {
    background: var(--color-main, #1a1a2e);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Noto Serif JP', serif;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.bishamonyan-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    padding: 0 4px;
}

.bishamonyan-close:hover {
    opacity: 1;
}

/* チャット本体 */
.bishamonyan-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.chat-message {
    margin-bottom: 12px;
    max-width: 85%;
}

.chat-nyan {
    margin-right: auto;
}

.chat-nyan p {
    background: #f0ede6;
    padding: 10px 14px;
    border-radius: 2px 12px 12px 12px;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #333;
}

.chat-user {
    margin-left: auto;
}

.chat-user p {
    background: var(--color-main, #1a1a2e);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px 2px 12px 12px;
    font-size: 0.85rem;
    line-height: 1.7;
}

/* クイックボタン */
.chat-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chat-quick-btn {
    background: #fff;
    border: 1px solid var(--color-gold, #8b6f2e);
    color: var(--color-gold, #8b6f2e);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Noto Sans JP', sans-serif;
}

.chat-quick-btn:hover {
    background: var(--color-gold, #8b6f2e);
    color: #fff;
}

/* 入力エリア */
.bishamonyan-chat-footer {
    display: flex;
    border-top: 1px solid #e8e5de;
    padding: 8px;
    gap: 8px;
}

#bishamonyan-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: 'Noto Sans JP', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

#bishamonyan-input:focus {
    border-color: var(--color-gold, #8b6f2e);
}

#bishamonyan-send {
    background: var(--color-gold, #8b6f2e);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Noto Sans JP', sans-serif;
    transition: background 0.3s;
    flex-shrink: 0;
}

#bishamonyan-send:hover {
    background: #b8993e;
}

/* レスポンシブ：タブレット */
@media (max-width: 768px) {
    .bishamonyan-widget {
        bottom: 16px;
        right: 16px;
    }

    .bishamonyan-icon {
        width: 100px;
        height: 100px;
    }

    .bishamonyan-bubble {
        bottom: 110px;
        max-width: 180px;
        font-size: 0.75rem;
        padding: 10px 14px;
    }

    .bishamonyan-chat {
        bottom: 110px;
        width: 320px;
        height: 420px;
    }

    #bishamonyan-input {
        min-width: 0;
        flex: 1;
    }

    #bishamonyan-send {
        flex-shrink: 0;
    }
}

/* レスポンシブ：スマホ */
@media (max-width: 480px) {
    .bishamonyan-widget {
        bottom: 12px;
        right: 12px;
    }

    .bishamonyan-icon {
        width: 140px;
        height: 140px;
    }

    .bishamonyan-bubble {
        bottom: 150px;
        right: -4px;
        max-width: 160px;
        font-size: 0.72rem;
        padding: 8px 12px;
    }

    .bishamonyan-bubble::after {
        right: 30px;
    }

    .bishamonyan-chat {
        position: fixed;
        bottom: 160px;
        left: 10px;
        right: 10px;
        width: auto;
        height: 50vh;
        border-radius: 12px;
    }

    #bishamonyan-input {
        min-width: 0;
        flex: 1;
    }

    #bishamonyan-send {
        flex-shrink: 0;
    }
}
