/* Think-Do v2.0 - 2タブ構成UI */

/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* アプリコンテナ */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

/* ヘッダー */
.app-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.app-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px; /* タブナビゲーションのスペース */
}

/* タブコンテンツ */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* タブヘッダー */
.tab-header {
    margin-bottom: 25px;
    text-align: center;
}

.tab-header h2 {
    font-size: 1.5rem;
    color: #4a5568;
    margin-bottom: 5px;
}

.tab-header p {
    color: #718096;
    font-size: 0.9rem;
}

/* クイック入力セクション */
.quick-input-section {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* 入力方法タブ */
.input-method-tabs {
    display: flex;
    margin-bottom: 20px;
    background: white;
    border-radius: 15px;
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.input-tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-label {
    font-size: 0.8rem;
    font-weight: bold;
}

/* 音声入力エリア */
.voice-controls {
    text-align: center;
    margin-bottom: 15px;
}

.record-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 20px 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    min-width: 200px;
    justify-content: center;
}

.record-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.record-btn.recording {
    background: linear-gradient(45deg, #ff4757, #c44569);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.recording-status {
    margin-top: 15px;
    color: #ff4757;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pulse {
    width: 12px;
    height: 12px;
    background: #ff4757;
    border-radius: 50%;
    animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.transcript-result {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 15px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.transcript-content p {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #4a5568;
}

.transcript-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* テキスト入力エリア */
.text-input-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.text-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: white;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-input::placeholder {
    color: #999;
    font-style: italic;
}

.text-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ボタンスタイル */
.save-btn, .cancel-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.save-btn {
    background: #2ed573;
    color: white;
}

.save-btn:hover {
    background: #26d065;
    transform: translateY(-1px);
}

.cancel-btn {
    background: #ddd;
    color: #666;
}

.cancel-btn:hover {
    background: #ccc;
}

/* セクションヘッダー */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    font-size: 1.1rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.task-stats {
    display: flex;
    gap: 15px;
}

.completed-count {
    color: #2ed573;
    font-size: 0.9rem;
    font-weight: bold;
}

/* タスクリスト */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    background: white;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.task-item.completed {
    opacity: 0.7;
    border-left-color: #2ed573;
    background: #f8fff8;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #999;
}

/* タスクチェックボックス */
.task-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: white;
    transition: all 0.3s ease;
}

.task-checkbox:checked {
    background: #2ed573;
    border-color: #2ed573;
}

.task-checkbox:checked::after {
    content: '✓';
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* タスクテキスト */
.task-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.4;
    color: #4a5568;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.task-text:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

/* タスクアクション */
.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 入力方法バッジは削除 */

.task-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.edit-btn {
    background: #ffa726;
    color: white;
}

.edit-btn:hover {
    background: #ff9800;
    transform: translateY(-1px);
}

.delete-btn {
    background: #ef5350;
    color: white;
}

.delete-btn:hover {
    background: #e53935;
    transform: translateY(-1px);
}

/* 完了済みタスクリスト */
.completed-list .task-item {
    opacity: 0.6;
    transform: scale(0.98);
}

.completed-list .task-item:hover {
    transform: scale(1);
}

/* タブナビゲーション */
.tab-navigation {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    padding: 10px 0;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-btn.active {
    color: #667eea;
}

.nav-btn:not(.active) {
    color: #999;
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-label {
    font-size: 0.8rem;
    font-weight: bold;
}

.nav-badge {
    position: absolute;
    top: 5px;
    right: 20px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* 空の状態 */
.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 20px 0;
}

/* アニメーション */
.task-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* タスク完了アニメーション */
.task-item.completing {
    animation: completeTask 0.5s ease-in-out;
}

@keyframes completeTask {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background: #2ed573; }
    100% { transform: scale(1); }
}

/* レスポンシブデザイン */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }
    
    .main-content {
        padding: 15px;
        padding-bottom: 100px;
    }
    
    .quick-input-section {
        padding: 15px;
    }
    
    .record-btn {
        padding: 15px 25px;
        font-size: 0.9rem;
        min-width: 180px;
    }
    
    .task-item {
        padding: 12px;
    }
    
    .nav-btn {
        padding: 8px;
    }
    
    .nav-icon {
        font-size: 1.3rem;
    }
    
    .nav-label {
        font-size: 0.7rem;
    }
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #4a5568;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.task-preview {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.ai-question {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.ai-question p {
    font-size: 1.2rem;
    font-weight: bold;
}

.ai-loading {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.user-response-area {
    margin-top: 20px;
}

.user-response-area label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #4a5568;
}

.response-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.response-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.response-actions {
    margin-top: 15px;
    text-align: center;
}

.analyze-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.ai-analysis-area {
    margin-top: 20px;
}

.analysis-loading {
    text-align: center;
    padding: 20px;
}

.analysis-result {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.analysis-scores {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.score-item {
    text-align: center;
}

.score-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.score-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    text-align: center;
}

.importance-高, .urgency-高 {
    background: #ff4757;
    color: white;
}

.importance-中, .urgency-中 {
    background: #ffa726;
    color: white;
}

.importance-低, .urgency-低 {
    background: #2ed573;
    color: white;
}

.analysis-reason, .analysis-recommendation {
    margin-bottom: 15px;
}

.recommendation-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.recommendation-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.recommendation-text {
    flex: 1;
}

.recommendation-text strong {
    display: block;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 4px;
}

.recommendation-reason {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.analysis-reason p, .analysis-recommendation p {
    margin: 5px 0;
    color: #4a5568;
}

.final-decision-area {
    margin-top: 20px;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.do-btn, .dont-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.do-btn {
    background: #2ed573;
    color: white;
}

.do-btn:hover {
    background: #26d065;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 213, 115, 0.4);
}

.dont-btn {
    background: #ff4757;
    color: white;
}

.dont-btn:hover {
    background: #ff3742;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2ed573;
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(46, 213, 115, 0.4);
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: #ff4757;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

/* ユーティリティクラス */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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