/* リセットとベーススタイル */
* {
    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;
}

#app {
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 表示切替タブ */
.view-switcher {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    justify-content: center;
}

.tab-btn {
    background: #f3f4f6;
    color: #374151;
    border: none;
    padding: 8px 14px;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.9rem;
}

.tab-btn.active {
    background: #4F46E5;
    color: white;
}

/* 一括入力 */
.hidden { display: none; }

.bulk-editor {
    padding: 0 16px 16px 16px;
}

.bulk-section {
    margin-bottom: 16px;
}

.bulk-label {
    display: block;
    color: #111827;
    font-weight: 600;
    margin-bottom: 8px;
}

.bulk-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
}

.bulk-months {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bulk-month {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 12px;
    border: 2px solid #e5e7eb;
}

.bulk-month label {
    display: block;
    font-size: 0.9rem;
    color: #4F46E5;
    margin-bottom: 6px;
}

.bulk-month input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

/* ヘッダー */
.yearly-goal-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

#yearly-goal-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
    line-height: 1.4;
}

.edit-btn {
    background: #4F46E5;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* （ヘッダー内の追加ボタンは削除） */

/* タイムライン */
.timeline-container {
    flex: 1;
    padding: 20px 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.timeline {
    display: flex;
    gap: 16px;
    padding: 0 20px;
    min-width: max-content;
    align-items: center;
    height: 100%;
}

.month-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    min-width: 200px;
    max-width: 200px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.month-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.month-card.current-month {
    border-color: #7C3AED; /* 強調色（Indigo→Violet寄り） */
    background: #ffffff; /* 背景を白に固定 */
    transform: scale(1.1);
    box-shadow: 0 10px 34px rgba(124, 58, 237, 0.35);
    animation: currentPulse 3s ease-in-out infinite;
}

.month-card.current-month .month-name {
    color: #7C3AED;
}

.month-card.current-month .month-goal.goal-set {
    color: #111827;
}

@keyframes currentPulse {
    0% {
        transform: scale(1.08);
        box-shadow: 0 8px 28px rgba(124, 58, 237, 0.30);
    }
    50% {
        transform: scale(1.12);
        box-shadow: 0 14px 42px rgba(124, 58, 237, 0.40);
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 10px 34px rgba(124, 58, 237, 0.35);
    }
}

.month-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4F46E5;
    margin-bottom: 12px;
}

.month-goal {
    font-size: 0.9rem;
    margin-bottom: 16px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.month-goal.goal-set {
    color: #1f2937;
    font-weight: 500;
}

.month-goal.goal-not-set {
    color: #9ca3af;
    font-style: italic;
}

.achievement-icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.achievement-icon.achieved {
    color: #10b981;
}

.achievement-icon.partial {
    color: #f59e0b;
}

.achievement-icon.not-achieved {
    color: #ef4444;
}

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

.modal.show {
    display: flex;
}

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

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

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    text-align: center;
}

#yearly-goal-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#yearly-goal-input:focus {
    outline: none;
    border-color: #4F46E5;
}

#month-goal-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
}

#month-goal-input:focus {
    outline: none;
    border-color: #4F46E5;
}

.achievement-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.achievement-btn {
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.achievement-btn:hover {
    border-color: #4F46E5;
    background: #f8fafc;
}

.achievement-btn.selected {
    border-color: #4F46E5;
    background: #4F46E5;
    color: white;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary {
    background: #4F46E5;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #4338CA;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .yearly-goal-header {
        padding: 15px;
    }
    
    #yearly-goal-text {
        font-size: 1.3rem;
    }
    
    .timeline {
        padding: 0 15px;
    }
    
    .month-card {
        min-width: 180px;
        max-width: 180px;
        padding: 15px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .achievement-buttons {
        flex-direction: column;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}

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

.timeline-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
