/* ============================================
   チャットボット UI スタイル
   ============================================ */

/* フローティングボタン */
.chatbot-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 120px;
    height: 120px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
}

.chatbot-floating-btn:hover {
    transform: scale(1.1);
}

.chatbot-floating-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chatbot-floating-btn svg {
    display: none;
}

/* ポップアップオーバーレイ */
.chatbot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chatbot-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* ポップアップコンテナ */
.chatbot-popup {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.chatbot-overlay.active .chatbot-popup {
    transform: scale(1);
}

/* ヘッダー */
.chatbot-header {
    background: #ff751f;
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.chatbot-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ボディ */
.chatbot-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* 機能選択画面 */
.chatbot-function-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.chatbot-function-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.chatbot-function-btn:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.chatbot-function-btn .icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.chatbot-function-btn .title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.chatbot-function-btn .description {
    font-size: 12px;
    color: #666;
}

/* 入力フォーム */
.chatbot-input-form {
    display: none;
}

.chatbot-input-form.active {
    display: block;
}

.chatbot-back-btn {
    background: #f5f5f5;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
    transition: background 0.2s ease;
}

.chatbot-back-btn:hover {
    background: #e0e0e0;
}

.chatbot-form-group {
    margin-bottom: 20px;
}

.chatbot-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.chatbot-form-group input,
.chatbot-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.chatbot-form-group input:focus,
.chatbot-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.chatbot-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.chatbot-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.chatbot-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chatbot-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ローディング */
.chatbot-loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.chatbot-loading.active {
    display: block;
}

.chatbot-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chatbot-loading-text {
    color: #666;
    font-size: 14px;
}

/* 結果表示 */
.chatbot-result {
    display: none;
}

.chatbot-result.active {
    display: block;
}

.chatbot-result-header {
    margin-bottom: 20px;
}

.chatbot-result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.chatbot-result-content {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.chatbot-result-text {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* プランカード */
.chatbot-plans {
    display: grid;
    gap: 15px;
}

.chatbot-plan-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chatbot-plan-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.chatbot-plan-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.chatbot-plan-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.chatbot-plan-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.chatbot-plan-category {
    color: #667eea;
    font-weight: 500;
}

.chatbot-plan-price {
    color: #333;
    font-weight: 600;
}

.chatbot-new-search-btn {
    background: #f5f5f5;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: background 0.2s ease;
}

.chatbot-new-search-btn:hover {
    background: #e0e0e0;
}

/* エラー表示 */
.chatbot-error {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    padding: 15px;
    color: #c33;
    margin-bottom: 15px;
    display: none;
}

.chatbot-error.active {
    display: block;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .chatbot-floating-btn {
        bottom: 20px;
        right: 20px;
        width: 100px;
        height: 100px;
    }

    .chatbot-popup {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .chatbot-header {
        border-radius: 0;
    }

    .chatbot-function-select {
        grid-template-columns: 1fr;
    }

    .chatbot-body {
        padding: 20px;
    }
}

/* スクロールバーのスタイル */
.chatbot-body::-webkit-scrollbar {
    width: 8px;
}

.chatbot-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chatbot-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}
