/* 気持ちスッキリ整理ボット - フロントエンドスタイル */

.mood-bot-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 20px auto;
    max-width: 800px;
}

.mood-bot-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    text-align: center;
}

.mood-bot-header h1 {
    font-size: 24px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.mood-bot-header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.security-badge {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 5px;
    font-weight: bold;
}

.mood-bot-chat-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    min-height: 400px;
    max-height: 500px;
}

.mood-bot-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

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

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

.mood-bot-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.mood-bot-message.bot .mood-bot-message-content {
    background: #e3f2fd;
    color: #1565c0;
}

.mood-bot-message.user .mood-bot-message-content {
    background: #667eea;
    color: white;
}

.mood-bot-input-area {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.mood-bot-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#moodBotUserInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

#moodBotUserInput:focus {
    border-color: #667eea;
}

.mood-bot-send-btn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    font-size: 14px;
    font-family: inherit;
}

.mood-bot-send-btn:hover {
    background: #5a6fd8;
}

.mood-bot-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 思考のクセ選択ボタン */
.mood-bot-distortion-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.mood-bot-distortion-btn {
    padding: 10px 15px;
    background: #f0f4f8;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
    font-size: 13px;
    font-family: inherit;
}

.mood-bot-distortion-btn:hover {
    background: #e3f2fd;
    border-color: #667eea;
}

.mood-bot-distortion-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.mood-bot-distortion-btn strong {
    display: block;
    margin-bottom: 4px;
}

.mood-bot-distortion-btn small {
    color: inherit;
    opacity: 0.8;
}

/* 結果サマリー（スマホ対応のレスポンシブ表示） */
.mood-bot-result-summary {
    margin: 15px 0;
    width: 100%;
}

.mood-bot-result-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mood-bot-result-label {
    font-weight: bold;
    color: #667eea;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mood-bot-result-content {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    word-wrap: break-word;
}

/* ボタンスタイル */
.mood-bot-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
    margin: 5px;
    font-family: inherit;
}

.mood-bot-btn-primary {
    background: #4caf50;
    color: white;
}

.mood-bot-btn-primary:hover {
    background: #45a049;
}

.mood-bot-btn-secondary {
    background: #ff9800;
    color: white;
}

.mood-bot-btn-secondary:hover {
    background: #f57c00;
}

.mood-bot-btn-tertiary {
    background: #667eea;
    color: white;
}

.mood-bot-btn-tertiary:hover {
    background: #5a6fd8;
}

/* メール入力エリア */
.mood-bot-email-input-area {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.mood-bot-email-input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

#moodBotEmailInput {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

#moodBotEmailInput:focus {
    border-color: #667eea;
}

.mood-bot-privacy-notice {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
    margin-top: 8px;
}

/* 提案ボタン */
.mood-bot-suggest-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: background 0.3s;
    font-family: inherit;
}

.mood-bot-suggest-btn:hover {
    background: #f57c00;
}

/* ローディング状態 */
.mood-bot-loading {
    opacity: 0.7;
    pointer-events: none;
}

.mood-bot-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: mood-bot-spin 1s linear infinite;
}

@keyframes mood-bot-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* エラー表示 */
.mood-bot-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #f44336;
    font-size: 14px;
}

/* 成功表示 */
.mood-bot-success {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #4caf50;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .mood-bot-container {
        border-radius: 0;
        margin: 0;
        height: 100vh;
    }
    
    .mood-bot-header h1 {
        font-size: 20px;
    }
    
    .mood-bot-message-content {
        max-width: 85%;
    }
    
    .mood-bot-distortion-buttons {
        grid-template-columns: 1fr;
    }
    
    .mood-bot-email-input-group {
        flex-direction: column;
    }
    
    #moodBotEmailInput {
        min-width: auto;
        width: 100%;
    }
    
    .mood-bot-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    #moodBotUserInput {
        width: 100%;
        box-sizing: border-box;
    }
    
    .mood-bot-send-btn {
        width: 100%;
        border-radius: 20px;
    }
    
    .mood-bot-result-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .mood-bot-result-label {
        font-size: 13px;
    }
    
    .mood-bot-result-content {
        font-size: 12px;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .mood-bot-header {
        padding: 15px;
    }
    
    .mood-bot-header h1 {
        font-size: 18px;
    }
    
    .mood-bot-chat-area {
        padding: 15px;
        min-height: 300px;
    }
    
    .mood-bot-input-area {
        padding: 15px;
    }
    
    .mood-bot-distortion-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
    .mood-bot-chat-area {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .mood-bot-message.bot .mood-bot-message-content {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .mood-bot-input-area {
        background: #2d3748;
        border-top-color: #4a5568;
    }
    
    #moodBotUserInput {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }
    
    #moodBotUserInput::placeholder {
        color: #a0aec0;
    }
}

/* アクセシビリティ改善 */
.mood-bot-distortion-btn:focus,
.mood-bot-send-btn:focus,
.mood-bot-btn:focus,
#moodBotUserInput:focus,
#moodBotEmailInput:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .mood-bot-container {
        border: 2px solid #000;
    }
    
    .mood-bot-message.bot .mood-bot-message-content {
        border: 1px solid #000;
    }
    
    .mood-bot-message.user .mood-bot-message-content {
        border: 1px solid #fff;
    }
}

/* アニメーション削減設定対応 */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}