/**
 * Chabo Mascot Styles
 * チャボマスコットの共通スタイル
 */

/* Chabo Mascot Animation */
.chabo-mascot {
    position: fixed;
    bottom: -200px;
    width: 400px;
    height: 200px;
    z-index: 9999;
    pointer-events: none;
    overflow: visible;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chabo-mascot img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: top center;
    clip-path: inset(0 0 50% 0);
    pointer-events: auto;
    cursor: pointer;
}

.chabo-right {
    right: 30px;
}

.chabo-left {
    left: 30px;
    transform: scaleX(-1);
}

.chabo-mascot.peek-up {
    transform: translateY(-210px);
}

.chabo-left.peek-up {
    transform: scaleX(-1) translateY(-210px);
}

/* Speech Bubble */
.chabo-speech-bubble {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: white;
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 8px 30px rgba(26, 43, 74, 0.15);
    min-width: 280px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    z-index: 10000;
}

.chabo-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 14px solid white;
}

.chabo-speech-bubble p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #1A2B4A;
}

.chabo-speech-bubble p:first-child {
    font-weight: bold;
    font-size: 16px;
    color: #1A2B4A;
}

.chabo-name {
    display: inline-block;
    background: linear-gradient(135deg, #E8734A 0%, #F5C242 100%);
    color: white;
    font-size: 20px;
    font-weight: bold;
    padding: 2px 12px;
    border-radius: 8px;
    margin: 0 2px;
    box-shadow: 0 2px 8px rgba(232, 115, 74, 0.3);
}

.chabo-speech-bubble p:last-of-type {
    margin-bottom: 0;
}

.chabo-question {
    font-weight: 500;
    color: #3D3D3D;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #F5F0E8;
}

.chabo-btn {
    display: inline-block;
    background: linear-gradient(135deg, #E8734A 0%, #F5C242 100%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(232, 115, 74, 0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.chabo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(232, 115, 74, 0.4);
}

.chabo-left .chabo-btn:hover {
    transform: translateY(-2px);
}

/* 代表者について / スローガンについて コンテンツ */
.chabo-content-about,
.chabo-content-slogan {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
}

.chabo-content-about::-webkit-scrollbar,
.chabo-content-slogan::-webkit-scrollbar {
    width: 4px;
}

.chabo-content-about::-webkit-scrollbar-track,
.chabo-content-slogan::-webkit-scrollbar-track {
    background: #F5F0E8;
    border-radius: 2px;
}

.chabo-content-about::-webkit-scrollbar-thumb,
.chabo-content-slogan::-webkit-scrollbar-thumb {
    background: #E8734A;
    border-radius: 2px;
}

.chabo-about-text {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 10px;
    color: #3D3D3D;
}

.chabo-about-text strong {
    color: #E8734A;
    font-weight: bold;
}

.chabo-btn-back {
    display: block;
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 15px;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chabo-btn-back:hover {
    border-color: #E8734A;
    color: #E8734A;
}

.chabo-btn-contact {
    display: inline-block;
    width: auto;
}

.chabo-btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.chabo-btn-group .chabo-btn {
    margin-top: 0;
}

.chabo-bubble-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chabo-bubble-close:hover {
    background: #E8734A;
    color: white;
}


.chabo-left .chabo-speech-bubble {
    transform: scaleX(-1) translateX(50%) scale(0);
}

.chabo-mascot.show-bubble .chabo-speech-bubble {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.chabo-left.show-bubble .chabo-speech-bubble {
    transform: scaleX(-1) translateX(50%) scale(1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chabo-mascot {
        width: 280px;
        height: 140px;
        /* Safari iOS対応: タブバーの高さ（約50px）を考慮して深く隠す */
        bottom: calc(-200px - env(safe-area-inset-bottom, 0px));
    }
    .chabo-right {
        right: 15px;
    }
    .chabo-left {
        left: 15px;
    }
    .chabo-mascot.peek-up {
        transform: translateY(calc(-205px - env(safe-area-inset-bottom, 0px)));
    }
    .chabo-left.peek-up {
        transform: scaleX(-1) translateY(calc(-205px - env(safe-area-inset-bottom, 0px)));
    }
    .chabo-speech-bubble {
        bottom: 120px;
        min-width: 240px;
        padding: 16px 20px;
    }
    .chabo-speech-bubble p {
        font-size: 12px;
    }
    .chabo-speech-bubble p:first-child {
        font-size: 14px;
    }
    .chabo-content-about,
    .chabo-content-slogan {
        max-height: 280px;
    }
    .chabo-about-text {
        font-size: 11px;
        line-height: 1.6;
        margin-bottom: 8px;
    }
    .chabo-btn {
        font-size: 12px;
        padding: 8px 16px;
    }
    .chabo-btn-back {
        font-size: 11px;
        padding: 5px 10px;
    }
}

