/* ==========================================
   AIチャットボット - スタイル
   ========================================== */

/* チャットボタン（右下に固定） */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ff5563 0%, #ff0050 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(255, 0, 80, 0.4);
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: chatPulse 2s ease-in-out infinite;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 0, 80, 0.6);
}

.chat-button i {
    font-size: 30px;
    color: #ffffff;
}

/* パルスアニメーション */
@keyframes chatPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 0, 80, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 0, 80, 0.8), 0 0 0 10px rgba(255, 0, 80, 0.1);
    }
}

/* チャットウィンドウ */
.chat-window {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* チャットヘッダー */
.chat-header {
    background: linear-gradient(135deg, #ff5563 0%, #ff0050 100%);
    color: #ffffff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-title i {
    font-size: 24px;
}

.chat-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.chat-close:hover {
    transform: rotate(90deg);
}

/* チャットメッセージエリア */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
}

/* メッセージバブル */
.message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bot {
    justify-content: flex-start;
}

.message-user {
    justify-content: flex-end;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5563 0%, #ff0050 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    flex-shrink: 0;
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-bot .message-bubble {
    background: #ffffff;
    color: #333333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message-user .message-bubble {
    background: linear-gradient(135deg, #ff5563 0%, #ff0050 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #999999;
    margin-top: 5px;
    padding: 0 5px;
}

/* タイピングインジケーター */
.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 18px;
    width: fit-content;
}

.typing-indicator.active {
    display: block;
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #999999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* チャット入力エリア */
.chat-input-area {
    padding: 15px 20px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    border-color: #ff5563;
}

.chat-send-button {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #ff5563 0%, #ff0050 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 0, 80, 0.4);
}

.chat-send-button:active {
    transform: scale(0.95);
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 150px);
        right: 10px;
        bottom: 100px;
    }
    
    .chat-button {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }
    
    .chat-button i {
        font-size: 26px;
    }
}

/* スクロールバーのカスタマイズ */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999999;
}
